Skip to content

Commit

Permalink
Merge pull request #372 from penguin-statistics/dev
Browse files Browse the repository at this point in the history
Release v3.3.0
  • Loading branch information
AlvISsReimu authored Jul 18, 2020
2 parents 1cdecf1 + cc61a71 commit 5ac87d2
Show file tree
Hide file tree
Showing 55 changed files with 4,186 additions and 4,796 deletions.
6 changes: 3 additions & 3 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
host = https://www.transifex.com

[penguin-statistics-website.main]
file_filter = src/locales/<lang>.json
file_filter = src/locales/<lang>.yml
minimum_perc = 0
source_file = src/locales/zh.json
source_file = src/locales/zh.yml
source_lang = zh
type = KEYVALUEJSON
type = YAML_GENERIC

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<img src="https://penguin.upyun.galvincdn.com/logos/penguin_stats_logo.png"
alt="Penguin Statistics - Logo"
width="96px" />

# Penguin Statistics!
# Penguin Statistics - Frontend
[![License](https://img.shields.io/github/license/penguin-statistics/frontend-v2)](https://github.com/penguin-statistics/frontend-v2/blob/dev/LICENSE)
[![Build Status](https://img.shields.io/travis/penguin-statistics/frontend-v2?logo=travis)](https://travis-ci.org/penguin-statistics/frontend-v2)
[![Last Commit](https://img.shields.io/github/last-commit/penguin-statistics/frontend-v2)](https://github.com/penguin-statistics/frontend-v2/commits/dev)
[![Docs](https://img.shields.io/badge/docs-GitBook-blue)](https://developer.penguin-stats.io)

This is the **frontend** project repository for the [Penguin Statistics](https://penguin-stats.io/?utm_source=github) website.

<img src="https://penguin.upyun.galvincdn.com/preview.jpg"
alt="Penguin Statistics - Preview Screenshot"
width="100%" />

## Maintainers
This frontend project has mainly being maintained by the following contributors (in alphabetical order):
- [AlvISsReimu](https://github.com/AlvISsReimu)
Expand Down
4 changes: 3 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = {
presets: [
'@vue/app'
['@vue/app', {
useBuiltIns: "entry"
}]
],
plugins: [
"@babel/plugin-transform-modules-commonjs"
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "penguin-stats-frontend",
"version": "3.2.2",
"version": "3.3.0",
"private": true,
"author": "Penguin Statistics Contributors <contributors@penguin-stats.io> (https://github.com/orgs/penguin-statistics/people)",
"scripts": {
Expand All @@ -22,6 +22,7 @@
"@sentry/integrations": "^5.6.1",
"animejs": "^3.1.0",
"clipboard-polyfill": "^2.8.6",
"core-js": "^3.6.5",
"dayjs": "1.8.27",
"extract-domain": "^2.2.1",
"highcharts": "^8.1.0",
Expand All @@ -30,6 +31,8 @@
"js-cookie": "^2.2.1",
"marked": "^1.0.0",
"pinyin-engine": "^1.1.0",
"regenerator-runtime": "^0.13.5",
"uuid": "^8.2.0",
"vue": "^2.6.10",
"vue-analytics": "^5.22.1",
"vue-i18n": "^8.0.0",
Expand All @@ -53,13 +56,13 @@
"eslint-plugin-vue": "^5.0.0",
"eslint-plugin-vuetify": "^1.0.0-beta.5",
"husky": "^4.2.5",
"js-yaml-loader": "^1.2.2",
"sass": "^1.25.0",
"sass-loader": "^8.0.2",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"vue-cli-plugin-i18n": "^1.0.1",
"vue-cli-plugin-vuetify": "^2.0.5",
"vue-svg-inline-loader": "^1.5.0",
"vue-template-compiler": "^2.6.10",
"vuetify-loader": "^1.4.3",
"webpack": "^4.42.1",
Expand All @@ -74,6 +77,7 @@
"> 0.1% in my stats",
"> 1% in CN",
"last 5 versions",
"since 2010",
"defaults"
],
"bugs": {
Expand Down
9 changes: 8 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@
</main>
<!--<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">function _slicedToArray(a,c){return _arrayWithHoles(a)||_iterableToArrayLimit(a,c)||_unsupportedIterableToArray(a,c)||_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(a,c){if(a){if("string"===typeof a)return _arrayLikeToArray(a,c);var b=Object.prototype.toString.call(a).slice(8,-1);"Object"===b&&a.constructor&&(b=a.constructor.name);if("Map"===b||"Set"===b)return Array.from(a);if("Arguments"===b||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b))return _arrayLikeToArray(a,c)}}function _arrayLikeToArray(a,c){if(null==c||c>a.length)c=a.length;for(var b=0,d=Array(c);b<c;b++)d[b]=a[b];return d}
function _iterableToArrayLimit(a,c){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(a)){var b=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done)&&(b.push(h.value),!c||b.length!==c);d=!0);}catch(k){e=!0,f=k}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f;}}return b}}function _arrayWithHoles(a){if(Array.isArray(a))return a}
Object.entries||(Object.entries=function(a){for(var c=Object.keys(a),b=c.length,d=Array(b);b--;)d[b]=[c[b],a[c[b]]];return d});
var _i18n={getFirstBrowserLanguageWithRegionCode:function(){var a=window.navigator,c=["language","browserLanguage","systemLanguage","userLanguage"],b,d=null;if(Array.isArray(a.languages))for(b=0;b<a.languages.length;b++){var e=a.languages[b];var f=e.length;!d&&f&&(d=e);if(e&&2<f)return e}for(b=0;b<c.length;b++)if(e=a[c[b]],null!=e&&(f=e.length,!d&&f&&(d=e),e&&2<f))return e;return d},getFirstBrowserLanguage:function(){var a=this.getFirstBrowserLanguageWithRegionCode().replace("_","-");if(!a)return"zh";
var c=a.split("-");return 1===c.length?a:2===c.length?c[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,c){document.querySelector("#"+a).innerHTML=c},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 c=0;for(a=Object.entries(this.data[a]);c<a.length;c++){var b=_slicedToArray(a[c],2);this.fill(b[0],b[1])}}}};try{_i18n.render()}catch(a){console.error(a)};</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
10 changes: 10 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
</v-list>
</v-navigation-drawer>
<v-app-bar
elevate-on-scroll
app
dark
:color="primaryColor"
Expand Down Expand Up @@ -99,6 +100,15 @@
<ServerSelector />

<AccountManager />

<!-- <v-progress-linear-->
<!-- :active="pending"-->
<!-- :indeterminate="pending"-->
<!-- absolute-->
<!-- bottom-->
<!-- class="width: 100%"-->
<!-- color="deep-purple accent-4"-->
<!-- />-->
</v-app-bar>
<RandomBackground />
<v-content
Expand Down
2 changes: 2 additions & 0 deletions src/apis/report.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import service from '@/utils/service'
import config from '@/config'
import store from '@/store'
// import { v4 as uuidv4 } from 'uuid'

// IdempotencyKey
export default {
async submitReport({stageId, drops}) {
return service.post("/report", {
Expand Down
Binary file added src/assets/advertising/preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/assets/preloader-i18n-inline.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
"use strict";

if (!Object.entries)
Object.entries = function( obj ){
var ownProps = Object.keys( obj ),
i = ownProps.length,
resArray = new Array(i); // preallocate the Array
while (i--)
resArray[i] = [ownProps[i], obj[ownProps[i]]];

return resArray;
};

let _i18n = {
getFirstBrowserLanguageWithRegionCode () {
let nav = window.navigator,
Expand Down
2 changes: 1 addition & 1 deletion src/components/global/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<v-tooltip
v-if="!disableTooltip"
transition="slide-y-transition"
:open-delay="20"
:open-delay="5"
:nudge-top="tooltipNudge"

bottom
Expand Down
1 change: 1 addition & 0 deletions src/components/global/ItemStepper.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<v-row
dense
align="center"
justify="center"
class="pr-1 pb-1"
Expand Down
15 changes: 7 additions & 8 deletions src/components/global/RandomBackground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import SpecialUI from "@/mixins/SpecialUI";
import CDN from "@/mixins/CDN";
import {mapGetters} from "vuex";
import randomUtils from "@/utils/randomUtils";
export default {
name: "RandomBackground",
Expand All @@ -19,6 +20,8 @@
interval: {
type: Number,
default () {
return 5 * 60
// eslint-disable-next-line no-unreachable
if ((typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1)) {
// is mobile device; reduce data usage, use ttl of 30 minutes
return 30 * 60
Expand Down Expand Up @@ -85,17 +88,11 @@
})
},
async getRandomBackgroundUrl() {
let current = this.last;
// avoid change to the same background than the last one
while (current === this.last) {
current = Math.floor(Math.random() * this.imageRange)
}
this.last = current;
// Console.log(current)
if (this.webpSupport === null) {
this.webpSupport = await this.testWebp();
}
return this.getImageUrl(current)
return this.getImageUrl(randomUtils.cachedRandom.get())
},
async updateBackgroundByRandom(ignoreUrl) {
// Console.log("check at random", this.isSpecialUrl(this.$route), this.$route)
Expand All @@ -107,7 +104,9 @@
async updateBackgroundByUrl(url) {
const background = this.$refs.background;
this.lastLoading = true;
window.fetch(url)
window.fetch(url, {
cache: "force-cache"
})
.then((response) => {
return response.blob();
})
Expand Down
45 changes: 45 additions & 0 deletions src/components/global/TitledRow.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<template>
<v-row
class="flex-row"
:class="{'my-3 mx-6': !dense}"
align="center"
>
<span :class="{'title': !dense, 'subtitle-2': dense}">
<slot name="header" />
</span>
<v-divider
vertical
class="mx-4"
/>
<div
class="d-flex flex-grow-1 flex-wrap"
:class="{'flex-column flex-sm-row flex-md-row flex-lg-row flex-xl-row': reactive}"
>
<slot name="content" />
</div>
</v-row>
</template>

<script>
export default {
name: "TitledRow",
props: {
dense: {
type: Boolean,
default () {
return false
}
},
reactive: {
type: Boolean,
default () {
return false
}
},
},
}
</script>

<style scoped>
</style>
80 changes: 40 additions & 40 deletions src/components/planner/PlannerIO.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,46 @@
<!-- 短链接-->
<!-- </Subheader>-->

<!-- <v-fade-transition leave-absolute>-->
<!-- <v-text-field-->
<!-- v-if="shortlink.content && !shortlink.generating"-->
<!-- id="copy-content"-->
<!-- label="分享短链接"-->
<!-- :value="shortlink.content"-->
<!-- dense-->
<!-- outlined-->
<!-- placeholder="https://exusi.ai/foobar"-->

<!-- readonly-->

<!-- append-icon="mdi-content-copy"-->
<!-- @click:append="copy(shortlink.content)"-->
<!-- />-->

<!-- <v-btn-->
<!-- v-else-->
<!-- block-->
<!-- :loading="shortlink.generating"-->
<!-- large-->
<!-- class="mb-5"-->
<!-- :class="{'primary': !shortlink.generating, 'slash-strip&#45;&#45;loading': shortlink.generating}"-->
<!-- @click="generateShortlink"-->
<!-- >-->
<!-- <template v-slot:loader>-->
<!-- <v-progress-circular-->
<!-- indeterminate-->
<!-- :size="16"-->
<!-- :width="2"-->
<!-- class="mr-2"-->
<!-- />-->
<!-- 正在生成...-->
<!-- </template>-->
<!-- <v-icon left>-->
<!-- mdi-link-box-->
<!-- </v-icon>-->
<!-- 生成短链接-->
<!-- </v-btn>-->
<!-- </v-fade-transition>-->
<!-- <v-fade-transition leave-absolute>-->
<!-- <v-text-field-->
<!-- v-if="shortlink.content && !shortlink.generating"-->
<!-- id="copy-content"-->
<!-- label="分享短链接"-->
<!-- :value="shortlink.content"-->
<!-- dense-->
<!-- outlined-->
<!-- placeholder="https://exusi.ai/foobar"-->

<!-- readonly-->

<!-- append-icon="mdi-content-copy"-->
<!-- @click:append="copy(shortlink.content)"-->
<!-- />-->

<!-- <v-btn-->
<!-- v-else-->
<!-- block-->
<!-- :loading="shortlink.generating"-->
<!-- large-->
<!-- class="mb-5"-->
<!-- :class="{'primary': !shortlink.generating, 'slash-strip&#45;&#45;loading': shortlink.generating}"-->
<!-- @click="generateShortlink"-->
<!-- >-->
<!-- <template v-slot:loader>-->
<!-- <v-progress-circular-->
<!-- indeterminate-->
<!-- :size="16"-->
<!-- :width="2"-->
<!-- class="mr-2"-->
<!-- />-->
<!-- 正在生成...-->
<!-- </template>-->
<!-- <v-icon left>-->
<!-- mdi-link-box-->
<!-- </v-icon>-->
<!-- 生成短链接-->
<!-- </v-btn>-->
<!-- </v-fade-transition>-->


<Subheader>
Expand Down
Loading

0 comments on commit 5ac87d2

Please sign in to comment.