Skip to content

Commit

Permalink
Merge pull request #265 from penguin-statistics/dev
Browse files Browse the repository at this point in the history
v1.1.7 Release
  • Loading branch information
AlvISsReimu authored Apr 8, 2020
2 parents ca9317c + 6e946f1 commit 914e644
Show file tree
Hide file tree
Showing 40 changed files with 1,030 additions and 268 deletions.
265 changes: 256 additions & 9 deletions CHANGELOG.md

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions build/serve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"public": "dist",
"headers": [
{
"source": "/service-worker.js",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=0, must-revalidate"
}
]
},
{
"source": "**",
"headers": [
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; script-src 'self' 'unsafe-inline' https://client.crisp.chat https://settings.crisp.chat https://www.google-analytics.com/; script-src-attr 'none'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://client.crisp.chat; img-src 'self' data: blob: https://penguin.upyun.galvincdn.com https://www.google-analytics.com https://stats.g.doubleclick.net https://image.crisp.chat https://client.crisp.chat; font-src 'self' https://fonts.gstatic.com https://fonts.gstatic.cn https://client.crisp.chat; connect-src 'self' https://penguin-stats.io https://penguin.upyun.galvincdn.com https://sentry.io https://client.crisp.chat wss://client.relay.crisp.chat https://storage.crisp.chat; prefetch-src 'self' https://penguin.upyun.galvincdn.com; upgrade-insecure-requests; block-all-mixed-content"
}
]
}
],
"rewrites": [
{ "source": "**", "destination": "/index.html" }
]
}
15 changes: 12 additions & 3 deletions now.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
"headers": [
{
"source": "/service-worker.js",
"headers" : [
"headers": [
{
"key" : "Cache-Control",
"value" : "public, max-age=0, must-revalidate"
"key": "Cache-Control",
"value": "public, max-age=0, must-revalidate"
}
]
},
{
"source": "(.*)",
"headers": [
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; script-src 'self' 'unsafe-inline' https://client.crisp.chat https://settings.crisp.chat https://www.google-analytics.com/; script-src-attr 'none'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://client.crisp.chat; img-src 'self' data: blob: https://penguin.upyun.galvincdn.com https://www.google-analytics.com https://stats.g.doubleclick.net https://image.crisp.chat https://client.crisp.chat; font-src 'self' https://fonts.gstatic.com https://fonts.gstatic.cn https://client.crisp.chat; connect-src 'self' https://penguin-stats.io https://penguin.upyun.galvincdn.com https://sentry.io https://client.crisp.chat wss://client.relay.crisp.chat https://storage.crisp.chat; prefetch-src 'self' https://penguin.upyun.galvincdn.com; upgrade-insecure-requests; block-all-mixed-content"
}
]
}
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "penguin-stats-frontend",
"version": "1.1.5",
"version": "1.1.7",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "npx --max_old_space_size=4096 vue-cli-service build --modern",
"build:single": "npx --max_old_space_size=4096 vue-cli-service build",
"lint": "vue-cli-service lint",
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'",
"submit": "git add . && git cz && git push",
"preview": "yarn build && serve -s -d dist",
"preview:single": "yarn build:single && serve -s -d dist"
"serveDist": "serve -c build/serve.json",
"preview": "yarn build && yarn serveDist",
"preview:single": "yarn build:single && yarn serveDist",
"release": "standard-version"
},
"dependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.8.3",
Expand Down
25 changes: 25 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@
<v-app
:class="languageFont"
>
<!-- <v-overlay-->
<!-- :opacity="0.97"-->
<!-- style="z-index:99999999999"-->
<!-- >-->
<!-- <v-row class="justify-center">-->
<!-- <v-col-->
<!-- cols="10"-->
<!-- sm="10"-->
<!-- md="12"-->
<!-- lg="12"-->
<!-- xl="12"-->
<!-- >-->
<!-- <h1>-->
<!-- 截断型信息标题-->
<!-- </h1>-->
<!-- <p class="subtitle-1 mb-9">-->
<!-- 截断型信息内容-->
<!-- </p>-->

<!-- <h2 class="display-4">-->
<!-- 00<span class="display-3">:00</span>-->
<!-- </h2>-->
<!-- </v-col>-->
<!-- </v-row>-->
<!-- </v-overlay>-->
<GlobalSnackbar />
<PWAPopups />
<v-navigation-drawer
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion src/components/drawer/LocaleSwitcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
mdi-translate
</v-icon> {{ $t('menu.languages') }}
</v-subheader>
<v-list-item-group v-model="activeLocale">
<v-list-item-group
v-model="activeLocale"
mandatory
>
<v-list-item
v-for="(locale, i) in localizations"
:key="i"
Expand Down
21 changes: 21 additions & 0 deletions src/components/global/GlobalSnackbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@
"skipWaitingTimeout": "Failed to apply changes: ServiceWorker timed out. Please refresh page and try again"
}
}
},
"ko": {
"network": {
"error": "네트워크 오류. 인터넷 연결을 확인한 후 다시 시도하세요."
},
"clipboard": {
"success": "클립보드에 복사되었습니다.",
"error": "클립보드에 복사하지 못했습니다. 텍스트를 수동으로 선택하고 복사해주세요."
},
"planner": {
"import": {
"jsonError": "가져오지 못했습니다. 데이터 구문 분석 오류입니다. 입력값을 확인해 주세요. ({error})",
"success": "{amount}개 항목에 대한 데이터를 성공적으로 가져왔습니다."
},
"calculationError": "계산오류: {error}"
},
"pwaPopup": {
"update": {
"skipWaitingTimeout": "변경 내용을 적용하지 못했습니다. 서비스가 시간 초과되었습니다. 페이지를 새로 고친 후 다시 시도하세요."
}
}
}
}
</i18n>
Expand Down
2 changes: 1 addition & 1 deletion src/components/global/ItemStepper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
watch: {
quantity: function (newValue, oldValue) {
let diff = newValue - oldValue;
const diff = newValue - oldValue;
this.$emit("change", [this.item.itemId, diff])
}
},
Expand Down
6 changes: 6 additions & 0 deletions src/components/global/PWAPopups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"refresh": "Refresh",
"success": "Website Updated!"
}
},
"en": {
"update": {
"refresh": "새로고침",
"success": "업데이트 완료!"
}
}
}
</i18n>
Expand Down
12 changes: 6 additions & 6 deletions src/components/global/RandomBackground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
return 15 * 60
} else {
// is not mobile device; use ttl of 5 minutes to show off ;)
return 5 * 60
return 10 * 60
}
}
}
Expand Down Expand Up @@ -65,7 +65,7 @@
return `https://penguin.upyun.galvincdn.com/backgrounds/${id}.${this.webpSupport ? 'webp' : 'optimized.png'}`
},
setBlur (flag) {
Console.info("setting blur to", flag)
Console.info("RandomBackground", "setting blur to", flag)
this.blurred = flag
},
async testWebp() {
Expand All @@ -92,20 +92,20 @@
},
async updateBackgroundByRandom(ignoreUrl) {
// Console.log("check at random", this.isSpecialUrl(this.$route), this.$route)
let isSpecial = this.isSpecialUrl(this.$route);
const isSpecial = this.isSpecialUrl(this.$route);
if (ignoreUrl || isSpecial === false) {
this.updateBackgroundByUrl(await this.getRandomBackgroundUrl())
}
},
async updateBackgroundByUrl(url) {
let background = this.$refs.background;
const background = this.$refs.background;
this.lastLoading = true;
window.fetch(url)
.then((response) => {
return response.blob();
})
.then((blob) => {
let dataUrl = URL.createObjectURL(blob);
const dataUrl = URL.createObjectURL(blob);
background.style.backgroundImage = `url(${dataUrl})`;
// Console.log(`created ${dataUrl} | revoking ${this.lastUrl}`)
!this.lastUrl && URL.revokeObjectURL(this.lastUrl);
Expand All @@ -125,7 +125,7 @@
checkSpecialImage (to, from) {
if (this.isSpecialUrl(to)) {
// yes we do have a special image for the CURRENT path. APPLY IT!
let imageUrl = this.specialImageMap[to.params.stageId]
const imageUrl = this.specialImageMap[to.params.stageId]
this.updateBackgroundByUrl(imageUrl)
} else if (this.isSpecialUrl(from)) {
// we do not have a special image for the current path but we DO have a special image for the PREVIOUS path.
Expand Down
4 changes: 2 additions & 2 deletions src/components/stats/DataSourceToggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"personal": "個人"
}
},
"ko": {
"ko": {
"dataSourceToggle": {
"title": "로그인 필요",
"loginNotice": "개인 보고서를 보려면 로그인하여 주십시오.",
"loginNotice": "개인 보고서를 보시려면 로그인해 주세요.",
"all": "전체",
"personal": "개인"
}
Expand Down
17 changes: 9 additions & 8 deletions src/components/stats/StageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
"ACTIVITY_CLOSED": "이벤트 (종료)"
},
"status": {
"closed": "Closed",
"open": "Open"
"closed": "닫힘",
"open": "개방중"
}
},
"stage": {
Expand Down Expand Up @@ -235,7 +235,7 @@
class="pa-0 pt-2"
>
<span
v-if="$vuetify.breakpoint.smAndUp"
v-if="!$vuetify.breakpoint.xs"
class="stage-id--background font-weight-black display-4 px-12 py-6"
>
{{ selectedStage.code || "" }}
Expand Down Expand Up @@ -322,10 +322,10 @@
categorizedZones() {
const categoriesSet = [["ACTIVITY_OPEN", "MAINLINE"], ["WEEKLY"]];
if (!this.hideClosed) categoriesSet[1].push("ACTIVITY_CLOSED");
let result = [[], []];
for (let [index, categories] of categoriesSet.entries()) {
for (let category of categories) {
let filter = null;
const result = [[], []];
for (const [index, categories] of categoriesSet.entries()) {
for (const category of categories) {
let filter;
let zones = get.zones.byType(category.startsWith("ACTIVITY") ? "ACTIVITY" : category);
if (category === "ACTIVITY_OPEN") {
filter = zone => !zone.isOutdated;
Expand Down Expand Up @@ -363,7 +363,7 @@
return get.stages.byParentZoneId(zoneId);
},
selectStage (zone, stage) {
Console.log("chose", zone, stage);
Console.log("StageSelector", "chose", zone, stage);
this.selected.zone = zone;
this.selected.stage = stage;
this.$emit("select", {zone, stage});
Expand Down Expand Up @@ -405,6 +405,7 @@
word-break: break-all;
overflow: hidden;
pointer-events: none;
text-align: right;
}
.theme--light .stage-id--background {
color: rgba(0, 0, 0, .075);
Expand Down
10 changes: 5 additions & 5 deletions src/components/toolbar/AccountManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"success": "登录成功",
"failed": {
"message": "登录失败:{message}",
"notfound": "未找到所提供的用户 ID"
"notfound": "未找到此用户ID。请注意这不是游戏内的ID。在本站上传一次掉落数据即可自动获得。"
},
"login": "登录",
"logout": "退出登录",
Expand All @@ -18,7 +18,7 @@
"success": "Successfully logged in",
"failed": {
"message": "Failed to log in: {message}",
"notfound": "The specified User ID could not be found"
"notfound": "This User ID cannot be found. Please not that this is not the ID in the game. You will get one after your first drop report."
},
"login": "Login",
"logout": "Logout",
Expand Down Expand Up @@ -208,7 +208,7 @@
}
},
mounted () {
let userId = Cookies.get(this.cookies.key);
const userId = Cookies.get(this.cookies.key);
if (userId !== this.$store.getters['auth/username']) {
this.$store.commit("auth/login", userId);
}
Expand All @@ -226,12 +226,12 @@
color: "success",
text: this.$t('success')
};
this.$store.dispatch("data/refreshPersonalMatrix");
this.$emit('afterLogin');
this.auth.dialog = false
this.$store.dispatch("data/refreshPersonalMatrix");
})
.catch((err) => {
Console.error("AccountManager", "auth failed", err)
Console.info("AccountManager", "auth failed", err)
if (err.response && err.response.status && err.response.status === 404) {
this.error = this.$t('failed.message', {message: this.$t('failed.notfound')})
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/config/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const client = {
source: "frontend-v2",
version: "v1.1.6"
version: "v1.1.7"
};

module.exports = {
Expand Down
8 changes: 6 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"home": "Home",
"report": "Report Drops",
"stats": {
"_name": "Statistics",
"_name": "Drop Rates",
"stage": "By stage",
"item": "By item"
},
Expand Down Expand Up @@ -39,7 +39,11 @@
},
"credit": "Penguin Statistics | {date}"
},
"separator": ", "
"separator": ", ",
"quotation": {
"start": "\"",
"end": "\""
}
},
"stats": {
"headers": {
Expand Down
8 changes: 6 additions & 2 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"home": "トップページ",
"report": "ドロップ報告",
"stats": {
"_name": "統計結果",
"_name": "ドロップ率",
"stage": "作戦別",
"item": "素材別"
},
Expand Down Expand Up @@ -39,7 +39,11 @@
},
"credit": "ペンギン急便データ統計処理部門 | {date}"
},
"separator": ""
"separator": "",
"quotation": {
"start": "",
"end": ""
}
},
"stats": {
"headers": {
Expand Down
Loading

0 comments on commit 914e644

Please sign in to comment.