Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit f10c685

Browse files
committed
Feat: i18n & offline daemon chart
1 parent 55395a6 commit f10c685

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

src/app/views/Services.vue

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,16 @@
162162
size="mini"
163163
v-model="node.ip"
164164
:placeholder="$t('overview.addr')"
165-
style="max-width: 120px"
165+
style="max-width: 120px; margin-right: 4px"
166166
></el-input>
167-
&nbsp;
167+
168168
<el-input
169169
size="mini"
170170
v-model="node.port"
171171
:placeholder="$t('overview.port')"
172-
style="max-width: 70px"
172+
style="max-width: 70px; margin-right: 4px"
173173
></el-input>
174-
&nbsp;
174+
175175
<el-button size="mini" @click="linkService(node, true)">{{
176176
node.available ? $t("services.update") : $t("services.connect")
177177
}}</el-button>
@@ -425,13 +425,13 @@ export default {
425425
this.$nextTick(() => {
426426
for (let i = 0; i < this.services.length; i++) {
427427
const element = this.services[i];
428+
const echartCpuDom = echarts.init(
429+
document.querySelector("#echart-wrapper-daemon-cpu-" + i)
430+
);
431+
const echartMemDom = echarts.init(
432+
document.querySelector("#echart-wrapper-daemon-mem-" + i)
433+
);
428434
if (element.available && element.cpuMemChart) {
429-
const echartCpuDom = echarts.init(
430-
document.querySelector("#echart-wrapper-daemon-cpu-" + i)
431-
);
432-
const echartMemDom = echarts.init(
433-
document.querySelector("#echart-wrapper-daemon-mem-" + i)
434-
);
435435
const cpuChartData = element?.cpuMemChart.map((v) => v.cpu);
436436
const memChartData = element?.cpuMemChart.map((v) => v.mem);
437437
echartCpuDom.setOption(getDaemonMemChartOption(cpuChartData));
@@ -442,6 +442,15 @@ export default {
442442
cpuChartInstance: echartCpuDom,
443443
memChartInstance: echartMemDom
444444
};
445+
} else {
446+
echartCpuDom.setOption(getDaemonMemChartOption(null));
447+
echartMemDom.setOption(getDaemonMemChartOption(null));
448+
this.daemonCharts[element.uuid] = {
449+
cpu: [],
450+
mem: [],
451+
cpuChartInstance: echartCpuDom,
452+
memChartInstance: echartMemDom
453+
};
445454
}
446455
}
447456
});

src/language/en_us.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,10 @@
783783
"inputNewKey": "Please provide new token, the panel will automatically attempt to connect with new token later.",
784784
"key": "Token",
785785
"keySub2": "Linux, the token is usually in /opt/mcsmanager/daemon/data/Config/global.json",
786-
"copyId": "(available for API calls)"
786+
"copyId": "(available for API calls)",
787+
"toDocker": "Docker",
788+
"toFileManager": "Files",
789+
"toTerminal": "Terminal"
787790
},
788791
"container": {
789792
"remoteList": "Select daemon",

0 commit comments

Comments
 (0)