Fri, 01 Feb 2019 17:56:01 GMT
parent
8cbb4db367
commit
61febfe45c
File diff suppressed because one or more lines are too long
@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
|
||||
<title>Statistics</title>
|
||||
<link href="//cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container" id="app">
|
||||
<span>数据采集时间:{{new Date(result.version).toString()}}</span>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th @click="sortBy('uid')">ID</th>
|
||||
<th @click="sortBy('name')">姓名</th>
|
||||
<th @click="sortBy('total')">总计</th>
|
||||
<th @click="sortBy(oj)" v-for="oj in ojs">{{oj}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="user in result.users">
|
||||
<td>{{user.uid}}</td>
|
||||
<td>{{user.name}}</td>
|
||||
<td>{{user.total}}</td>
|
||||
<td v-for="oj in ojs">{{getLength(user.result[oj])}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<script src="//cdn.jsdelivr.net/npm/vue"></script>
|
||||
<!--suppress ES6ModulesDependencies, JSUnusedGlobalSymbols -->
|
||||
<script>
|
||||
const getLength = arr => arr ? arr.length : 0;
|
||||
let app = null;
|
||||
fetch("result.json").then(res => res.json()).then(data => {
|
||||
let ojList = ["poj", 'hdu', 'codeforces'];
|
||||
data['users'].forEach(user => {
|
||||
user['total'] = ojList.map(oj => getLength(user['result'][oj])).reduce((x, y) => x + y, 0)
|
||||
});
|
||||
app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
result: data,
|
||||
ojs: ojList,
|
||||
sortOrders: {}
|
||||
},
|
||||
methods: {
|
||||
cmp: (x, y) => {
|
||||
if (x < y) return -1;
|
||||
if (x > y) return 1;
|
||||
return 0;
|
||||
},
|
||||
sortBy: function (key) {
|
||||
let order = -(this.sortOrders[key] || 1);
|
||||
this.sortOrders[key] = order;
|
||||
switch (key) {
|
||||
case 'uid':
|
||||
case 'name':
|
||||
case 'total':
|
||||
this.result['users'].sort((x, y) => order * this.cmp(x[key], y[key]));
|
||||
break;
|
||||
default:
|
||||
this.result['users'].sort((x, y) => order * this.cmp(getLength(x['result'][key]), getLength(y['result'][key])));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
app.sortBy("total");
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,271 +1,11 @@
|
||||
{
|
||||
"name": "stat",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"@types/material-components-web": {
|
||||
"version": "0.43.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material-components-web/download/@types/material-components-web-0.43.0.tgz",
|
||||
"integrity": "sha1-WxJBv6SPQxpe81OQaHC1OhEnlms=",
|
||||
"requires": {
|
||||
"@types/material__auto-init": "*",
|
||||
"@types/material__base": "*",
|
||||
"@types/material__checkbox": "*",
|
||||
"@types/material__chips": "*",
|
||||
"@types/material__dialog": "*",
|
||||
"@types/material__dom": "*",
|
||||
"@types/material__drawer": "*",
|
||||
"@types/material__floating-label": "*",
|
||||
"@types/material__form-field": "*",
|
||||
"@types/material__grid-list": "*",
|
||||
"@types/material__icon-toggle": "*",
|
||||
"@types/material__line-ripple": "*",
|
||||
"@types/material__linear-progress": "*",
|
||||
"@types/material__list": "*",
|
||||
"@types/material__menu": "*",
|
||||
"@types/material__notched-outline": "*",
|
||||
"@types/material__radio": "*",
|
||||
"@types/material__ripple": "*",
|
||||
"@types/material__select": "*",
|
||||
"@types/material__selection-control": "*",
|
||||
"@types/material__slider": "*",
|
||||
"@types/material__snackbar": "*",
|
||||
"@types/material__tabs": "*",
|
||||
"@types/material__textfield": "*",
|
||||
"@types/material__toolbar": "*",
|
||||
"@types/material__top-app-bar": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__auto-init": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__auto-init/download/@types/material__auto-init-0.35.0.tgz",
|
||||
"integrity": "sha1-pCGucZktX8kAVXGFcgVblFFnMPk="
|
||||
},
|
||||
"@types/material__base": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__base/download/@types/material__base-0.35.0.tgz",
|
||||
"integrity": "sha1-rX7jRsUNzlQbTVrMIJpDEzmfaIA="
|
||||
},
|
||||
"@types/material__checkbox": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__checkbox/download/@types/material__checkbox-0.35.0.tgz",
|
||||
"integrity": "sha1-4oMgaao/7Lsk3lWIuW5J5S9mfcU=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__ripple": "*",
|
||||
"@types/material__selection-control": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__chips": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__chips/download/@types/material__chips-0.35.0.tgz",
|
||||
"integrity": "sha1-Z+E2mJRIEURGfRcShRrHg+k43uM=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__ripple": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__dialog": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__dialog/download/@types/material__dialog-0.35.0.tgz",
|
||||
"integrity": "sha1-K+Tf4+lw2cryfiw5QwHSZRW5g7g=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__dom": {
|
||||
"version": "0.43.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__dom/download/@types/material__dom-0.43.0.tgz",
|
||||
"integrity": "sha1-XGI+U6qcAw53apqVPlNapOHtjGk="
|
||||
},
|
||||
"@types/material__drawer": {
|
||||
"version": "0.43.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__drawer/download/@types/material__drawer-0.43.0.tgz",
|
||||
"integrity": "sha1-klTA+euT1+6QZVizFjKaX5fFb5s=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__list": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__floating-label": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__floating-label/download/@types/material__floating-label-0.35.0.tgz",
|
||||
"integrity": "sha1-+jQyuXk3fWRQM/5fAkiEYhQN12g=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__form-field": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__form-field/download/@types/material__form-field-0.35.0.tgz",
|
||||
"integrity": "sha1-0BO4j4xHlcZgao7oJdCSThvecdU=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__selection-control": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__grid-list": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__grid-list/download/@types/material__grid-list-0.35.0.tgz",
|
||||
"integrity": "sha1-A1W8DLrp4r6a6Jgn3EG+7+TmpOo=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__icon-toggle": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__icon-toggle/download/@types/material__icon-toggle-0.35.0.tgz",
|
||||
"integrity": "sha1-3IZiP4pr94P4m7y+2lVTmxDOesE=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__ripple": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__line-ripple": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__line-ripple/download/@types/material__line-ripple-0.35.0.tgz",
|
||||
"integrity": "sha1-WS2jjTKoYUY7li9a6E5tFoZLMQ4=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__linear-progress": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__linear-progress/download/@types/material__linear-progress-0.35.0.tgz",
|
||||
"integrity": "sha1-kK3Dj0zptzfo0O16rA+I5WdEvgI=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__list": {
|
||||
"version": "0.43.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__list/download/@types/material__list-0.43.0.tgz",
|
||||
"integrity": "sha1-T0FxqBojSFaoxJEyxst2lraWCZA=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__dom": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__menu": {
|
||||
"version": "0.35.2",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__menu/download/@types/material__menu-0.35.2.tgz",
|
||||
"integrity": "sha1-va1/HdByJjXH1xk3tO0SxJYg3Kk=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__notched-outline": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__notched-outline/download/@types/material__notched-outline-0.35.0.tgz",
|
||||
"integrity": "sha1-RdgLzpVyTbG33vReuizKAYPQDoo=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__radio": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__radio/download/@types/material__radio-0.35.0.tgz",
|
||||
"integrity": "sha1-dU+6ERfxYvOJGQ6VEqUpb6N8weU=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__ripple": "*",
|
||||
"@types/material__selection-control": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__ripple": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__ripple/download/@types/material__ripple-0.35.0.tgz",
|
||||
"integrity": "sha1-vmKj9eDFeQpIJliZmyVxK7nqGoM=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__select": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__select/download/@types/material__select-0.35.0.tgz",
|
||||
"integrity": "sha1-rgtj/CN5dUBPEpBQL7pyxgFu1O0=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__floating-label": "*",
|
||||
"@types/material__line-ripple": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__selection-control": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__selection-control/download/@types/material__selection-control-0.35.0.tgz",
|
||||
"integrity": "sha1-Pbb2AeM6Xk3ZazitTNx4mTxFJ08=",
|
||||
"requires": {
|
||||
"@types/material__ripple": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__slider": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__slider/download/@types/material__slider-0.35.0.tgz",
|
||||
"integrity": "sha1-LaqwLpfOAbkSEec3sgdjFVVzw/A=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__snackbar": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__snackbar/download/@types/material__snackbar-0.35.0.tgz",
|
||||
"integrity": "sha1-H7YcSsDw34hi1jDseSP9klYY3fY=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__tabs": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__tabs/download/@types/material__tabs-0.35.0.tgz",
|
||||
"integrity": "sha1-i4Wv56AT2hyXOgpU1vAWiBvHvH8=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__textfield": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__textfield/download/@types/material__textfield-0.35.0.tgz",
|
||||
"integrity": "sha1-pZYC0um1O67MunPURojIrHG/Hp8=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__floating-label": "*",
|
||||
"@types/material__line-ripple": "*",
|
||||
"@types/material__notched-outline": "*",
|
||||
"@types/material__ripple": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__toolbar": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__toolbar/download/@types/material__toolbar-0.35.0.tgz",
|
||||
"integrity": "sha1-PBAsat/U3IjDsrA2I6OD2tkx24c=",
|
||||
"requires": {
|
||||
"@types/material__base": "*"
|
||||
}
|
||||
},
|
||||
"@types/material__top-app-bar": {
|
||||
"version": "0.35.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/material__top-app-bar/download/@types/material__top-app-bar-0.35.0.tgz",
|
||||
"integrity": "sha1-/BIr3XqDIGljNbSUQ+4XNx4IjYA=",
|
||||
"requires": {
|
||||
"@types/material__base": "*",
|
||||
"@types/material__ripple": "*"
|
||||
}
|
||||
},
|
||||
"@types/vue": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "http://registry.npm.taobao.org/@types/vue/download/@types/vue-2.0.0.tgz",
|
||||
"integrity": "sha1-7Hez2JWR3rnKXLBSNoqpwyvgiOc=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"vue": "*"
|
||||
}
|
||||
},
|
||||
"vue": {
|
||||
"version": "2.5.22",
|
||||
"resolved": "http://registry.npm.taobao.org/vue/download/vue-2.5.22.tgz",
|
||||
"integrity": "sha1-O/iAQa8IuFOcN7JotwynkkXpzDA=",
|
||||
"dev": true
|
||||
"integrity": "sha1-O/iAQa8IuFOcN7JotwynkkXpzDA="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "stat",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@types/vue": "^2.0.0",
|
||||
"vue": "^2.5.22"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/material-components-web": "^0.43.0"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -1,59 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
|
||||
<title>Statistics</title>
|
||||
<link href="//cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container" id="app">
|
||||
<span>数据采集时间:{{new Date(result.version).toString()}}</span>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>姓名</th>
|
||||
<th>总计</th>
|
||||
<th>POJ</th>
|
||||
<th>HDU</th>
|
||||
<th>Codeforces</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="user in result.users">
|
||||
<td>{{user.uid}}</td>
|
||||
<td>{{user.name}}</td>
|
||||
<td>
|
||||
{{
|
||||
getLength(user.result.poj)+
|
||||
getLength(user.result.hdu)+
|
||||
getLength(user.result.codeforces)
|
||||
}}
|
||||
</td>
|
||||
<td>{{getLength(user.result.poj)}}</td>
|
||||
<td>{{getLength(user.result.hdu)}}</td>
|
||||
<td>{{getLength(user.result.codeforces)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<script src="//cdn.jsdelivr.net/npm/vue"></script>
|
||||
<script>
|
||||
// noinspection JSUnusedLocalSymbols
|
||||
const getLength = arr => arr ? arr.length : 0;
|
||||
// noinspection ES6ModulesDependencies
|
||||
let app = null;
|
||||
fetch("result.json").then(res => res.json()).then(data => {
|
||||
app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
result: data
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in new issue