summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-08-24 08:57:54 +0900
committerGitHub <noreply@github.com>2018-08-24 08:57:54 +0900
commit91f8adc138b8d7bcba16ddb8df4d4b4270a442ba (patch)
tree0f61feb5cd665f856f6314a67499a802e2b58856 /src
parentMerge pull request #2444 from syuilo/develop (diff)
parent8.6.0 (diff)
downloadsharkey-91f8adc138b8d7bcba16ddb8df4d4b4270a442ba.tar.gz
sharkey-91f8adc138b8d7bcba16ddb8df4d4b4270a442ba.tar.bz2
sharkey-91f8adc138b8d7bcba16ddb8df4d4b4270a442ba.zip
Merge pull request #2445 from syuilo/develop
8.6.0
Diffstat (limited to 'src')
-rw-r--r--src/client/app/common/views/filters/bytes.ts8
-rw-r--r--src/client/app/desktop/views/pages/admin/admin.chart.chart.ts3
-rw-r--r--src/client/app/desktop/views/pages/admin/admin.chart.vue24
3 files changed, 28 insertions, 7 deletions
diff --git a/src/client/app/common/views/filters/bytes.ts b/src/client/app/common/views/filters/bytes.ts
index 3afb11e9ae..f7a1b2690f 100644
--- a/src/client/app/common/views/filters/bytes.ts
+++ b/src/client/app/common/views/filters/bytes.ts
@@ -1,8 +1,10 @@
import Vue from 'vue';
Vue.filter('bytes', (v, digits = 0) => {
- const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
- if (v == 0) return '0Byte';
+ const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
+ if (v == 0) return '0';
+ const isMinus = v < 0;
+ if (isMinus) v = -v;
const i = Math.floor(Math.log(v) / Math.log(1024));
- return (v / Math.pow(1024, i)).toFixed(digits).replace(/\.0+$/, '') + sizes[i];
+ return (isMinus ? '-' : '') + (v / Math.pow(1024, i)).toFixed(digits).replace(/\.0+$/, '') + sizes[i];
});
diff --git a/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts b/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts
index 4ba348fb0f..9fb18fd039 100644
--- a/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts
+++ b/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts
@@ -30,6 +30,9 @@ export default Vue.extend({
type: 'time',
distribution: 'series'
}]
+ },
+ tooltips: {
+ intersect: false
}
}, this.opts || {}));
}
diff --git a/src/client/app/desktop/views/pages/admin/admin.chart.vue b/src/client/app/desktop/views/pages/admin/admin.chart.vue
index b02f6c31b7..caaeeaeda1 100644
--- a/src/client/app/desktop/views/pages/admin/admin.chart.vue
+++ b/src/client/app/desktop/views/pages/admin/admin.chart.vue
@@ -107,7 +107,8 @@ export default Vue.extend({
data: data.map(x => ({ t: x.date, y: x.all }))
}, {
label: 'Normal',
- fill: false,
+ fill: true,
+ backgroundColor: 'rgba(65, 221, 222, 0.1)',
borderColor: '#41ddde',
borderWidth: 2,
pointBackgroundColor: '#fff',
@@ -115,7 +116,8 @@ export default Vue.extend({
data: data.map(x => ({ t: x.date, y: x.normal }))
}, {
label: 'Replies',
- fill: false,
+ fill: true,
+ backgroundColor: 'rgba(247, 121, 108, 0.1)',
borderColor: '#f7796c',
borderWidth: 2,
pointBackgroundColor: '#fff',
@@ -123,7 +125,8 @@ export default Vue.extend({
data: data.map(x => ({ t: x.date, y: x.reply }))
}, {
label: 'Renotes',
- fill: false,
+ fill: true,
+ backgroundColor: 'rgba(161, 222, 65, 0.1)',
borderColor: '#a1de41',
borderWidth: 2,
pointBackgroundColor: '#fff',
@@ -143,6 +146,7 @@ export default Vue.extend({
datasets: [{
label: local ? 'Local Notes' : 'Remote Notes',
fill: true,
+ backgroundColor: 'rgba(246, 88, 79, 0.1)',
borderColor: '#f6584f',
borderWidth: 2,
pointBackgroundColor: '#fff',
@@ -164,6 +168,7 @@ export default Vue.extend({
datasets: [{
label: local ? 'Local Users' : 'Remote Users',
fill: true,
+ backgroundColor: 'rgba(246, 88, 79, 0.1)',
borderColor: '#f6584f',
borderWidth: 2,
pointBackgroundColor: '#fff',
@@ -185,6 +190,7 @@ export default Vue.extend({
datasets: [{
label: local ? 'Local Drive Usage' : 'Remote Drive Usage',
fill: true,
+ backgroundColor: 'rgba(246, 88, 79, 0.1)',
borderColor: '#f6584f',
borderWidth: 2,
pointBackgroundColor: '#fff',
@@ -195,11 +201,18 @@ export default Vue.extend({
scales: {
yAxes: [{
ticks: {
- callback: (value) => {
+ callback: value => {
return Vue.filter('bytes')(value);
}
}
}]
+ },
+ tooltips: {
+ callbacks: {
+ label: tooltipItem => {
+ return Vue.filter('bytes')(tooltipItem.yLabel);
+ }
+ }
}
}];
},
@@ -232,6 +245,9 @@ export default Vue.extend({
@import '~const.styl'
.gkgckalzgidaygcxnugepioremxvxvpt
+ *
+ user-select none
+
> header
display flex