Skip to content

Commit

Permalink
Merge pull request #302 from penguin-statistics/dev
Browse files Browse the repository at this point in the history
Release v1.1.11
  • Loading branch information
AlvISsReimu authored May 11, 2020
2 parents 99db098 + 3ad66e9 commit a975fde
Show file tree
Hide file tree
Showing 102 changed files with 3,041 additions and 867 deletions.
6 changes: 6 additions & 0 deletions now.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@
}
]
}
],
"rewrites": [
{
"source": "/PenguinStats/api/(.*)",
"destination": "https://penguin-stats.io/PenguinStats/api/$1"
}
]
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "penguin-stats-frontend",
"version": "1.1.8",
"version": "1.1.11",
"private": true,
"homepage": "https://github.com/penguin-statistics/frontend-v2#readme",
"bugs": {
"url": "https://github.com/penguin-statistics/frontend-v2/issues"
},
"license" : "MIT",
"license": "MIT",
"author": "All Contributors <*@*.*> (https://github.com/*)",
"contributors": [
"AlvISs_Reimu <alvissreimu@gmail.com> (https://github.com/AlvISsReimu)",
Expand All @@ -27,14 +27,14 @@
},
"dependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.8.3",
"@chenfengyuan/vue-number-input": "^1.2.1",
"@sentry/apm": "^5.15.4",
"@sentry/browser": "^5.6.2",
"@sentry/integrations": "^5.6.1",
"animejs": "^3.1.0",
"clipboard-polyfill": "^2.8.6",
"dayjs": "^1.8.23",
"extract-domain": "^2.2.1",
"intl-collator": "^0.1.6",
"js-cookie": "^2.2.1",
"vue": "^2.6.10",
"vue-analytics": "^5.22.1",
Expand Down
23 changes: 14 additions & 9 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<title>企鹅物流数据统计</title>
<link rel="preconnect" href="https://penguin.upyun.galvincdn.com">
<link rel="preconnect" href="https://penguin-stats.s3.amazonaws.com">
<style>#app,body,html{height:100vh;margin:0;padding:0;transition:background .3s cubic-bezier(.25,.8,.5,1)!important}body{background:#121212}#loader-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:999999;background:#121212;background:linear-gradient(to top right,#294266 30%,#00608c)}#loader-logo{top:20%;height:100px;width:100px;margin:-50px 0 0 -50px}#loader-logo,.sk-chase{display:block;position:relative;left:50%}.sk-chase{top:50%;width:72px;height:72px;margin:-152px 0 0 -36px;animation:sk-chase 2.5s infinite linear both}.sk-chase-dot{width:100%;height:100%;position:absolute;left:0;top:0;animation:sk-chase-dot 2s infinite cubic-bezier(.455,.03,.515,.955) both}.sk-chase-dot:before{content:'';display:block;width:25%;height:25%;background-color:#f0f0f0;border-radius:100%;animation:sk-chase-dot-before 2s infinite cubic-bezier(.455,.03,.515,.955) both}.sk-chase-dot:nth-child(1){animation-delay:-1.1s}.sk-chase-dot:nth-child(2){animation-delay:-1s}.sk-chase-dot:nth-child(3){animation-delay:-.9s}.sk-chase-dot:nth-child(4){animation-delay:-.8s}.sk-chase-dot:nth-child(5){animation-delay:-.7s}.sk-chase-dot:nth-child(6){animation-delay:-.6s}.sk-chase-dot:nth-child(1):before{animation-delay:-1.1s}.sk-chase-dot:nth-child(2):before{animation-delay:-1s}.sk-chase-dot:nth-child(3):before{animation-delay:-.9s}.sk-chase-dot:nth-child(4):before{animation-delay:-.8s}.sk-chase-dot:nth-child(5):before{animation-delay:-.7s}.sk-chase-dot:nth-child(6):before{animation-delay:-.6s}@keyframes sk-chase{to{transform:rotate(360deg)}}@keyframes sk-chase-dot{80%,to{transform:rotate(360deg)}}@keyframes sk-chase-dot-before{50%{transform:scale(.4)}0%,to{transform:scale(1)}}#loader-wrapper .load_text{font-family:Open Sans,sans-serif;color:#f0f0f0;font-size:19px;width:100%;text-align:center;z-index:9999999999999;position:absolute;opacity:1;line-height:30px}#loader-wrapper .load_title{top:55%}#loader-wrapper .load_footer{bottom:15%;opacity:.7;font-size:13px}#loader-wrapper .load_text span.load_caption{line-height:16px;font-weight:400;font-size:13px;color:#f0f0f0;opacity:.5}</style>
<style>#app,body,html{height:100vh;margin:0;padding:0;transition:background .3s cubic-bezier(.25,.8,.5,1)!important}body{background:#121212}#loader-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:999999;background:#121212;background:linear-gradient(to top right,#294266 30%,#00608c)}#loader-logo{top:20%;height:100px;width:100px;margin:-50px 0 0 -50px}#loader-logo,.sk-chase{display:block;position:relative;left:50%}.sk-chase{top:50%;width:72px;height:72px;margin:-152px 0 0 -36px;animation:sk-chase 2.5s infinite linear both}.sk-chase-dot{width:100%;height:100%;position:absolute;left:0;top:0;animation:sk-chase-dot 2s infinite cubic-bezier(.455,.03,.515,.955) both}.sk-chase-dot:before{content:'';display:block;width:25%;height:25%;background-color:#f0f0f0;border-radius:100%;animation:sk-chase-dot-before 2s infinite cubic-bezier(.455,.03,.515,.955) both}.sk-chase-dot:nth-child(1){animation-delay:-1.1s}.sk-chase-dot:nth-child(2){animation-delay:-1s}.sk-chase-dot:nth-child(3){animation-delay:-.9s}.sk-chase-dot:nth-child(4){animation-delay:-.8s}.sk-chase-dot:nth-child(5){animation-delay:-.7s}.sk-chase-dot:nth-child(6){animation-delay:-.6s}.sk-chase-dot:nth-child(1):before{animation-delay:-1.1s}.sk-chase-dot:nth-child(2):before{animation-delay:-1s}.sk-chase-dot:nth-child(3):before{animation-delay:-.9s}.sk-chase-dot:nth-child(4):before{animation-delay:-.8s}.sk-chase-dot:nth-child(5):before{animation-delay:-.7s}.sk-chase-dot:nth-child(6):before{animation-delay:-.6s}@keyframes sk-chase{to{transform:rotate(360deg)}}@keyframes sk-chase-dot{80%,to{transform:rotate(360deg)}}@keyframes sk-chase-dot-before{50%{transform:scale(.4)}0%,to{transform:scale(1)}}#loader-wrapper .load_text{font-family:Open Sans,sans-serif;color:#f0f0f0;font-size:19px;width:100%;text-align:center;z-index:9999999999999;position:absolute;opacity:1;line-height:30px;transition:all .3s cubic-bezier(.25,.8,.5,1)!important}#loader-wrapper .load_title{top:50%}#loader-wrapper .load_footer{bottom:15%;opacity:.7;font-size:13px}#loader-wrapper .load_text span.load_caption{line-height:16px;font-weight:400;font-size:13px;color:#f0f0f0;opacity:.5}#loader-wrapper .load_failed{top:42.5%;line-height:16px;font-weight:700;font-size:14px;color:#f0f0f0;width:100%;border-top:2px solid rgba(204,124,45,.9);border-bottom:2px solid rgba(204,124,45,.9);padding:1em 0;background:repeating-linear-gradient(-45deg,rgba(237,144,53,.9),rgba(237,144,53,.9) 45px,rgba(0,0,0,.8) 45px,rgba(0,0,0,.8) 90px);display:none}#loader-wrapper .load_button{padding:6px 8px;border:1px solid #fff;border-radius:4px;letter-spacing:.75px;background:rgba(0,0,0,.1);margin-top:1em;color:#fff;box-sizing:border-box;font-weight:700;box-shadow:0 2px 5px rgba(0,0,0,.5);cursor:pointer}</style>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#2d66ba">
<meta name="theme-color" content="#1565c0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="企鹅物流数据统计">
Expand Down Expand Up @@ -56,18 +56,23 @@
<br>
<span class="load_caption" id="load_caption--text">首次加载可能较慢,请耐心等待</span>
</div>
<div class="load_text load_failed">
<span class=load_failed_title id=load_failed--text>
检测到页面资源异常,请尝试更新到最新版本
</span>
<br>
<button class=load_button id=load_failed_button--text onclick=__reload()>
更新到最新版本
</button>
</div>
<div class="load_text load_footer">
<span id="load_copyright--text">企鹅物流数据统计</span> &copy; <span id="load_copyright_year--text">2020</span>
</div>
</div>
</main>
<script type="text/javascript">function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}
function _iterableToArrayLimit(a,b){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a)){var c=[],e=!0,d=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(e=(h=g.next()).done)&&(c.push(h.value),!b||c.length!==b);e=!0);}catch(k){d=!0,f=k}finally{try{if(!e&&null!=g["return"])g["return"]()}finally{if(d)throw f;}}return c}}function _arrayWithHoles(a){if(Array.isArray(a))return a}
var _i18n={getFirstBrowserLanguageWithRegionCode:function(){var a=window.navigator,b=["language","browserLanguage","systemLanguage","userLanguage"],c,e=null;if(Array.isArray(a.languages))for(c=0;c<a.languages.length;c++){var d=a.languages[c];var f=d.length;!e&&f&&(e=d);if(d&&2<f)return d}for(c=0;c<b.length;c++)if(d=a[b[c]],null!=d&&(f=d.length,!e&&f&&(e=d),d&&2<f))return d;return e},getFirstBrowserLanguage:function(){var a=this.getFirstBrowserLanguageWithRegionCode().replace("_","-");if(!a)return"zh";
var b=a.split("-");return 1===b.length?a:2===b.length?b[0]:a},data:{en:{"load_title--text":"Loading","load_caption--text":"Initialization may take some time","load_copyright--text":"Penguin Statistics"},ja:{"load_title--text":"\u8aad\u307f\u8fbc\u307f\u4e2d...","load_caption--text":"\u521d\u3081\u3066\u306e\u8aad\u307f\u8fbc\u307f\u306f\u52d5\u4f5c\u304c\u9045\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059<br>\u5c11\u3005\u304a\u5f85\u3061\u4e0b\u3055\u3044","load_copyright--text":"\u30da\u30f3\u30ae\u30f3\u6025\u4fbf\u30c7\u30fc\u30bf\u7d71\u8a08\u51e6\u7406\u90e8\u9580"},
ko:{"load_title--text":"\ub85c\ub529\uc911...","load_caption--text":"\ucd08\uae30 \uc124\uc815\uc5d0 \uc2dc\uac04\uc774 \uc880 \uac78\ub9b4 \uc218 \uc788\uc73c\ub2c8, \uae30\ub2e4\ub824 \uc8fc\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4","load_copyright--text":"\ud3ad\uadc4 \ubb3c\ub958 \ub370\uc774\ud130 \ubd84\uc11d \ubd80\uc11c"}},fill:function(a,b){document.querySelector("#"+a).innerHTML=b},render:function(){document.querySelector("#load_copyright_year--text").textContent=(new Date).getFullYear().toString();
var a=this.getFirstBrowserLanguage();if(a in this.data&&"string"===typeof a&&2>=a.length){var b=0;for(a=Object.entries(this.data[a]);b<a.length;b++){var c=_slicedToArray(a[b],2);this.fill(c[0],c[1])}}}};try{_i18n.render()}catch(a){console.error(a)};
</script>
<!--<script type="text/javascript">"use strict";navigator.serviceWorker.getRegistrations().then(function(registrations){for(let registration of registrations){registration.unregister()}});caches.keys().then(keys=>{keys.forEach(el => caches.delete(el))});</script>-->
<script type="text/javascript">"use strict";function __reload(){navigator.serviceWorker.getRegistrations().then(function(registrations){for(let registration of registrations){registration.unregister()}});caches.keys().then(keys=>{caches.delete(keys.find(el=>~el.indexOf("workbox-precache")))});window.location.reload()}(function(){function processNode(node){var tagName=(node.tagName||'').toLowerCase();var nodeAttribute=tagName==='script'&&node.src?'src':tagName==='link'&&node.rel==='stylesheet'&&node.href?'href':null;if(nodeAttribute){node.onerror=function(e){console.error("failing to get assets.",e);if(!~e.target.src.indexOf(window.location.origin)){return;}document.querySelector(".load_failed").style.display="block";document.querySelector(".sk-chase").style.opacity=0;document.querySelector(".load_title").style.opacity=0}}}new MutationObserver(function(mutations){for(var i=0;i<mutations.length;++i){var mutation=mutations[i];var addedNodes=mutation.addedNodes;for(var j=0;j<addedNodes.length;++j){processNode(addedNodes[j])}}}).observe(document,{childList:true,attributes:true,characterData:false,subtree:true,attributeOldValue:false})}());</script>
<script type="text/javascript">"use strict";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i]}return arr2}function _iterableToArrayLimit(arr,i){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(arr)))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e;}}return _arr}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}var _i18n={getFirstBrowserLanguageWithRegionCode:function getFirstBrowserLanguageWithRegionCode(){var nav=window.navigator,browserLanguagePropertyKeys=['language','browserLanguage','systemLanguage','userLanguage'],i,language,len,shortLanguage=null;if(Array.isArray(nav.languages)){for(i=0;i<nav.languages.length;i++){language=nav.languages[i];len=language.length;if(!shortLanguage&&len){shortLanguage=language}if(language&&len>2){return language}}}for(i=0;i<browserLanguagePropertyKeys.length;i++){language=nav[browserLanguagePropertyKeys[i]];if(language==null){continue}len=language.length;if(!shortLanguage&&len){shortLanguage=language}if(language&&len>2){return language}}return shortLanguage},getFirstBrowserLanguage:function getFirstBrowserLanguage(){var language=this.getFirstBrowserLanguageWithRegionCode().replace("_","-");if(!language)return"zh";var languages=language.split("-");if(languages.length===1){return language}else if(languages.length===2){return languages[0]}else{return language}},data:{"en":{"load_title--text":"Loading","load_caption--text":"Initialization may take some time","load_copyright--text":"Penguin Statistics","load_failed--text":"Page resource corrupted. Please upgrade to the latest version","load_failed_button--text":"UPGRADE AND RELOAD"},"ja":{"load_title--text":"読み込み中...","load_caption--text":"初めての読み込みは動作が遅くなる可能性があります<br>少々お待ち下さい","load_copyright--text":"ペンギン急便データ統計処理部門","load_failed--text":"Page resource corrupted. Please upgrade to the latest version","load_failed_button--text":"UPGRADE AND RELOAD"},"ko":{"load_title--text":"로딩중...","load_caption--text":"초기 설정에 시간이 좀 걸릴 수 있으니, 기다려 주시기 바랍니다","load_copyright--text":"펭귄 물류 데이터 분석 부서","load_failed--text":"Page resource corrupted. Please upgrade to the latest version","load_failed_button--text":"UPGRADE AND RELOAD"}},fill:function fill(key,content){document.querySelector("#"+key).innerHTML=content},render:function render(){document.querySelector("#load_copyright_year--text").textContent=new Date().getFullYear().toString();var language=this.getFirstBrowserLanguage();try{language=JSON.parse(localStorage.getItem("penguin-stats-settings"))["settings"]["language"]}catch(e){}if(language in this.data&&typeof language==="string"&&language.length<=2){var messages=this.data[language];for(var _i=0,_Object$entries=Object.entries(messages);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];this.fill(key,value)}}}};try{_i18n.render()}catch(e){console.error(e)}</script>
<script type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="2aa1bf4c-8c34-4028-9e1c-ca1f6c330779";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
</body>
</html>
Expand Down
Empty file added public/robots.txt
Empty file.
20 changes: 20 additions & 0 deletions public/service-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* eslint-env serviceworker */

self.addEventListener('install', () => {
skipWaiting();
});

self.addEventListener('activate', () => {
caches.has("workbox-precache-v2").then(has => {
if (has) {
caches.keys().then(keys => {
keys.forEach(key => {
caches.delete(key)
})
})
}
})
})

// intentially left blank
// because there's no handlers anymore, the service-worker is just an empty service worker now.
35 changes: 27 additions & 8 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--suppress CssInvalidFunction -->
<template>
<v-app
:class="languageFont"
Expand Down Expand Up @@ -28,20 +27,21 @@
<!-- </v-col>-->
<!-- </v-row>-->
<!-- </v-overlay>-->
<UpgradeNotifier />
<GlobalSnackbar />
<PWAPopups />
<MirrorSelector />
<v-navigation-drawer
v-model="drawer"
app
:style="{'filter': isInSpecialUI ? 'grayscale(1)' : ''}"
width="calc(env(safe-area-inset-left) + 300px)"
class="safe-area--navigation-drawer"
width="300px"
>
<Logo />
<v-list
dense
nav
style="padding-left: calc(max(env(safe-area-inset-left), 8px))"
class="safe-area--navigation"
>
<Navigation
v-for="route in routes"
Expand All @@ -60,6 +60,7 @@
outlined
text
class="flex-grow-1 mr-1"
:loading="pending"
@click="refreshData"
>
<v-icon left>
Expand All @@ -70,14 +71,26 @@

<SettingsDialog />
</v-row>
<v-row
justify="center"
class="mt-2"
>
<v-expand-transition>
<div
v-if="lowData"
class="text-center overline"
>
{{ $t('settings.optimization.lowData.active') }}
</div>
</v-expand-transition>
</v-row>
</v-container>
</v-list>
</v-navigation-drawer>
<v-app-bar
app
dark
:color="primaryColor"
style="min-height: calc(56px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top)"
:style="{'filter': isInSpecialUI ? 'grayscale(1)' : ''}"
class="x--safe-area toolbar--safe-area flex-column"
>
Expand Down Expand Up @@ -112,7 +125,7 @@
<RandomBackground />
<v-content
:style="{'filter': isInSpecialUI ? 'grayscale(1)' : ''}"
style="padding-top: calc(env(safe-area-inset-top) + 56px) !important;"
class="safe-area--v-content"
>
<transition
name="slide-fade"
Expand All @@ -138,23 +151,25 @@
import GlobalEntry from "@/mixins/hooks/GlobalEntry";
import './styles/global.css'
import PWAPopups from "@/components/global/PWAPopups";
import './styles/fonts.css'
import Footer from "@/components/global/Footer";
import CDN from "@/mixins/CDN";
import Mirror from "@/mixins/Mirror";
import SpecialUI from "@/mixins/SpecialUI";
import SettingsDialog from "@/components/drawer/SettingsDialog";
import MirrorSelector from "@/components/global/MirrorSelector";
import Logo from "@/components/drawer/Logo";
import {mapGetters} from "vuex";
import UpgradeNotifier from "@/components/global/UpgradeNotifier";
export default {
name: 'App',
components: {
UpgradeNotifier,
Logo,
MirrorSelector,
SettingsDialog,
Footer,
PWAPopups,
Navigation,
GlobalSnackbar,
NetworkStateIndicator,
Expand All @@ -169,6 +184,10 @@ export default {
showLicenseDialog: false
}
},
computed: {
...mapGetters("settings", ["lowData"]),
...mapGetters("ajax", ["pending"]),
},
created () {
this.routes = this.$router.options.routes.filter(el => !el.meta.hide);
this.$store.dispatch("data/fetch", false);
Expand Down
2 changes: 1 addition & 1 deletion src/apis/external.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import service from '@/utils/service'

export default {
geoip () {
return service.get("https://ipapi.co/json/", {
return service.get("https://api.ip.sb/geoip", {
withCredentials: false
})
}
Expand Down
Loading

0 comments on commit a975fde

Please sign in to comment.