summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-08-19 00:42:09 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-08-19 00:42:09 +0900
commitf59c68022ff75f2e77dd804b21f57748fcf4fdce (patch)
tree2d86f7a7250c42817309e5a1773a89c98c475691 /src
parentwip (diff)
downloadsharkey-f59c68022ff75f2e77dd804b21f57748fcf4fdce.tar.gz
sharkey-f59c68022ff75f2e77dd804b21f57748fcf4fdce.tar.bz2
sharkey-f59c68022ff75f2e77dd804b21f57748fcf4fdce.zip
Fix bug
Diffstat (limited to 'src')
-rw-r--r--src/client/app/desktop/views/pages/admin/admin.notes-chart.chart.vue8
-rw-r--r--src/server/api/endpoints/admin/chart.ts10
2 files changed, 11 insertions, 7 deletions
diff --git a/src/client/app/desktop/views/pages/admin/admin.notes-chart.chart.vue b/src/client/app/desktop/views/pages/admin/admin.notes-chart.chart.vue
index 3e9462f035..83c61c1313 100644
--- a/src/client/app/desktop/views/pages/admin/admin.notes-chart.chart.vue
+++ b/src/client/app/desktop/views/pages/admin/admin.notes-chart.chart.vue
@@ -53,14 +53,14 @@ export default Vue.extend({
if (peak != 0) {
const data = this.chart.slice().reverse().map(x => ({
normal: this.type == 'local' ? x.notes.local.diffs.normal : x.notes.remote.diffs.normal,
- replies: this.type == 'local' ? x.notes.local.diffs.replies : x.notes.remote.diffs.replies,
- renotes: this.type == 'local' ? x.notes.local.diffs.renotes : x.notes.remote.diffs.renotes,
+ reply: this.type == 'local' ? x.notes.local.diffs.reply : x.notes.remote.diffs.reply,
+ renote: this.type == 'local' ? x.notes.local.diffs.renote : x.notes.remote.diffs.renote,
total: this.type == 'local' ? x.notes.local.diff : x.notes.remote.diff
}));
this.pointsNote = data.map((d, i) => `${i},${(1 - (d.normal / peak)) * this.viewBoxY}`).join(' ');
- this.pointsReply = data.map((d, i) => `${i},${(1 - (d.replies / peak)) * this.viewBoxY}`).join(' ');
- this.pointsRenote = data.map((d, i) => `${i},${(1 - (d.renotes / peak)) * this.viewBoxY}`).join(' ');
+ this.pointsReply = data.map((d, i) => `${i},${(1 - (d.reply / peak)) * this.viewBoxY}`).join(' ');
+ this.pointsRenote = data.map((d, i) => `${i},${(1 - (d.renote / peak)) * this.viewBoxY}`).join(' ');
this.pointsTotal = data.map((d, i) => `${i},${(1 - (d.total / peak)) * this.viewBoxY}`).join(' ');
}
}
diff --git a/src/server/api/endpoints/admin/chart.ts b/src/server/api/endpoints/admin/chart.ts
index 4ad29a7015..a0566b11f5 100644
--- a/src/server/api/endpoints/admin/chart.ts
+++ b/src/server/api/endpoints/admin/chart.ts
@@ -34,15 +34,15 @@ export default (params: any) => new Promise(async (res, rej) => {
const stat = stats.find(s => s.date.getTime() == day.getTime());
if (stat) {
- chart.push(stat);
+ chart.unshift(stat);
} else { // 隙間埋め
const mostRecent = stats.find(s => s.date.getTime() < day.getTime());
if (mostRecent) {
- chart.push(Object.assign({}, mostRecent, {
+ chart.unshift(Object.assign({}, mostRecent, {
date: day
}));
} else {
- chart.push({
+ chart.unshift({
date: day,
users: {
local: {
@@ -93,5 +93,9 @@ export default (params: any) => new Promise(async (res, rej) => {
}
}
+ chart.forEach(x => {
+ delete x.date;
+ });
+
res(chart);
});