feat: Instance Activity Chart (#1141)

* feat: Instance Activity Chart

* fix: chart data handling
This commit is contained in:
pa
2025-02-18 14:32:47 +09:00
committed by GitHub
parent 42d623c932
commit 4002e944b9
21 changed files with 1145 additions and 87 deletions

View File

@@ -89,7 +89,8 @@ export default class extends baseClass {
link: {
type: Boolean,
default: true
}
},
isOpenPreviousInstanceInfoDialog: Boolean
},
data() {
return {
@@ -177,7 +178,14 @@ export default class extends baseClass {
API.$emit('SHOW_WORLD_DIALOG_SHORTNAME', this.hint);
return;
}
API.$emit('SHOW_WORLD_DIALOG', instanceId);
if (this.isOpenPreviousInstanceInfoDialog) {
this.$emit(
'open-previous-instance-info-dialog',
instanceId
);
} else {
API.$emit('SHOW_WORLD_DIALOG', instanceId);
}
}
},
showGroupDialog() {

View File

@@ -40,13 +40,13 @@ export default {
return obj;
},
timeToText(sec) {
var n = Number(sec);
timeToText(sec, isNeedSeconds = false) {
let n = Number(sec);
if (isNaN(n)) {
return this.escapeTag(sec);
}
n = Math.floor(n / 1000);
var arr = [];
const arr = [];
if (n < 0) {
n = -n;
}
@@ -62,7 +62,7 @@ export default {
arr.push(`${Math.floor(n / 60)}m`);
n %= 60;
}
if (arr.length === 0 && n < 60) {
if (isNeedSeconds || (arr.length === 0 && n < 60)) {
arr.push(`${n}s`);
}
return arr.join(' ');