mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix ratingHistory
This commit is contained in:
1 parent
e0b5700cfc
commit
93ff1957d8
2 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.8.17",
|
"version": "4.8.18",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const page = new NamedPage('user_detail', async () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
const data = await request.get('');
|
const data = await request.get('');
|
||||||
const history = data.udoc?.history || [];
|
const history = data.udoc?.ratingHistory || [];
|
||||||
while (history.length > 30) history.shift();
|
while (history.length > 30) history.shift();
|
||||||
while (history.length < 30) history.unshift(1500);
|
while (history.length < 30) history.unshift(1500);
|
||||||
const $dom = document.getElementById('rating-placeholder');
|
const $dom = document.getElementById('rating-placeholder');
|
||||||
@@ -38,7 +38,7 @@ const page = new NamedPage('user_detail', async () => {
|
|||||||
bottom: '10%',
|
bottom: '10%',
|
||||||
},
|
},
|
||||||
xAxis: { data: history.map((x, i) => moment().add(-30 + i, 'days').fromNow()) },
|
xAxis: { data: history.map((x, i) => moment().add(-30 + i, 'days').fromNow()) },
|
||||||
yAxis: {},
|
yAxis: { type: 'category' },
|
||||||
toolbox: {
|
toolbox: {
|
||||||
right: 10,
|
right: 10,
|
||||||
feature: {
|
feature: {
|
||||||
|
|||||||
Reference in new issue
Block a user