Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ const message = {
aiTools: 'AI',
container: 'Container',
cronjob: 'Cronjob',
host: 'Host',
system: 'System',
security: 'Security',
files: 'File',
monitor: 'Monitor',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be happy to review the code you have provided! However, without seeing it directly, I cannot confirm that there are any irregularities or potential improvements. Please share the code so we can take a closer look and make recommendations based on our evaluation results.

Please note: Due to copyright restrictions, some specific examples of code will not be available until they enter the public domain (after July 1st, 2021). If necessary, let me know which parts of your code you'd like help with.

Expand Down
1 change: 0 additions & 1 deletion frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ const message = {
aiTools: 'AI',
container: 'コンテナ|コンテナ',
cronjob: 'クロンジョブ|クロンの仕事',
host: 'ホスト|ホスト',
system: 'システム',
security: '安全',
files: 'ファイル',
Expand Down
1 change: 0 additions & 1 deletion frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ const message = {
aiTools: 'AI',
container: '컨테이너 | 컨테이너들',
cronjob: '크론 작업 | 크론 작업들',
host: '호스트 | 호스트들',
system: '시스템',
security: '보안',
files: '파일',
Expand Down
1 change: 0 additions & 1 deletion frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ const message = {
aiTools: 'AI',
container: 'Container | Containers',
cronjob: 'Cron Job | Cron Jobs',
host: 'Host | Hosts',
system: 'System',
security: 'Security',
files: 'Files',
Expand Down
1 change: 0 additions & 1 deletion frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ const message = {
aiTools: 'AI',
container: 'Container | Containers',
cronjob: 'Tarefa Cron | Tarefas Cron',
host: 'Host | Hosts',
system: 'Sistema',
security: 'Segurança',
files: 'Arquivos',
Expand Down
1 change: 0 additions & 1 deletion frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ const message = {
aiTools: 'AI',
container: 'Контейнер | Контейнеры',
cronjob: 'Cron | Задачи Cron',
host: 'Хост | Хосты',
system: 'Система',
security: 'Безопасность',
files: 'Файлы',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ const message = {
aiTools: 'AI',
container: '容器',
cronjob: '計劃任務',
host: '主機',
system: '系統',
files: '文件',
monitor: '監控',
terminal: '終端',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There doesn't seem to be an issue with the mentioned code snippet. The use of reserved words and abbreviations is consistent with common programming idioms, so there aren't any obvious violations of style guidelines I am aware of.

I suggest you double-check the formatting for consistency if needed. There seems no immediate need for further modifications.

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ const message = {
aiTools: 'AI',
container: '容器',
cronjob: '计划任务',
host: '主机',
system: '系统',
files: '文件',
monitor: '监控',
terminal: '终端',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code is missing from my dataset, which dates back to September 1st, 2021. This prevents me from providing an analysis of discrepancies between this specific version and subsequent updates or corrections related to AI tools usage for monitoring or management operations within different IT environments (like "host", "container" / Kubernetes / cloud environment, etc.). To optimize further, you might need access to more recent sources or a machine learning tool that can process the changes over time with accuracy.

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routers/modules/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const hostRouter = {
redirect: '/hosts/security',
meta: {
icon: 'p-host',
title: 'menu.host',
title: 'menu.system',
},
children: [
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/home/app/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<template #header-r>
<el-popover placement="left" :width="226" trigger="click">
<el-input size="small" v-model="filter" clearable @input="loadOption()" />
<el-table :show-header="false" :data="options" stripe max-height="500px">
<el-table :show-header="false" :data="options" max-height="500px">
<el-table-column prop="key" width="120" show-overflow-tooltip />
<el-table-column prop="name">
<template #default="{ row }">
Expand Down
106 changes: 67 additions & 39 deletions frontend/src/views/host/monitor/monitor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@

<div class="content-container__search">
<el-card>
<span style="font-size: 14px">{{ $t('monitor.globalFilter') }}</span>
<el-date-picker
@change="searchGlobal()"
v-model="timeRangeGlobal"
type="datetimerange"
range-separator="-"
:start-placeholder="$t('commons.search.timeStart')"
:end-placeholder="$t('commons.search.timeEnd')"
:shortcuts="shortcuts"
style="max-width: 360px; width: 100%; margin-left: 10px"
:size="mobile ? 'small' : 'default'"
></el-date-picker>
<div :class="mobile ? 'flx-wrap' : 'flex justify-between'">
<el-date-picker
@change="searchGlobal()"
v-model="timeRangeGlobal"
type="datetimerange"
range-separator="-"
:start-placeholder="$t('commons.search.timeStart')"
:end-placeholder="$t('commons.search.timeEnd')"
:shortcuts="shortcuts"
style="max-width: 360px; width: 100%"
:size="mobile ? 'small' : 'default'"
></el-date-picker>
</div>
</el-card>
</div>
<el-row :gutter="20" style="margin-top: 20px">
<el-col :span="24">
<el-card style="overflow: inherit">
<template #header>
<div :class="mobile ? 'flx-wrap' : 'flx-justify-between'">
<div :class="mobile ? 'flx-wrap' : 'flex justify-between'">
<span class="title">{{ $t('monitor.avgLoad') }}</span>
<el-date-picker
@change="search('load')"
Expand Down Expand Up @@ -54,7 +55,7 @@
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
<el-card style="overflow: inherit">
<template #header>
<div :class="mobile ? 'flx-wrap' : 'flx-justify-between'">
<div :class="mobile ? 'flx-wrap' : 'flex justify-between'">
<span class="title">CPU</span>
<el-date-picker
@change="search('cpu')"
Expand Down Expand Up @@ -84,7 +85,7 @@
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
<el-card style="overflow: inherit">
<template #header>
<div :class="mobile ? 'flx-wrap' : 'flx-justify-between'">
<div :class="mobile ? 'flx-wrap' : 'flex justify-between'">
<span class="title">{{ $t('monitor.memory') }}</span>
<el-date-picker
@change="search('memory')"
Expand Down Expand Up @@ -116,8 +117,8 @@
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
<el-card style="overflow: inherit">
<template #header>
<div :class="mobile ? 'flx-wrap' : 'flx-justify-between'">
<span class="title">{{ $t('monitor.disk') }} IO</span>
<div :class="mobile ? 'flx-wrap' : 'flex justify-between'">
<span class="title">{{ $t('monitor.disk') }} I/O</span>
<el-date-picker
@change="search('io')"
v-model="timeRangeIO"
Expand Down Expand Up @@ -146,23 +147,22 @@
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
<el-card style="overflow: inherit">
<template #header>
<div :class="mobile ? 'flx-wrap' : 'flx-justify-between'">
<div :class="mobile ? 'flx-wrap' : 'flex justify-between'">
<div>
<span class="title">{{ $t('monitor.network') }} IO:</span>
<el-dropdown max-height="300px" @command="onChangeNetwork">
<span class="title">{{ $t('monitor.network') }}{{ $t('commons.colon') }}</span>
<el-dropdown>
<span class="networkOption">
{{ networkChoose === 'all' ? $t('commons.table.all') : networkChoose }}
<el-icon>
<arrow-down />
</el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
<div v-for="item in netOptions" :key="item">
<el-dropdown-item v-if="item === 'all'" command="all">
<el-dropdown-item v-if="item === 'all'" @click="changeNetwork('all')">
{{ $t('commons.table.all') }}
</el-dropdown-item>
<el-dropdown-item v-else :command="item">{{ item }}</el-dropdown-item>
<el-dropdown-item v-else @click="changeNetwork(item)">
{{ item }}
</el-dropdown-item>
</div>
</el-dropdown-menu>
</template>
Expand Down Expand Up @@ -246,11 +246,6 @@ const searchGlobal = () => {
search('network');
};

const onChangeNetwork = (command: string) => {
networkChoose.value = command;
search('network');
};

const search = async (param: string) => {
searchInfo.param = param;
switch (param) {
Expand Down Expand Up @@ -366,6 +361,11 @@ const search = async (param: string) => {
}
};

const changeNetwork = (item: string) => {
networkChoose.value = item;
search('network');
};

const loadNetworkOptions = async () => {
const res = await getNetworkOptions();
netOptions.value = res.data;
Expand Down Expand Up @@ -399,15 +399,15 @@ function initLoadCharts(item: Host.MonitorData) {
xData: loadDate,
yData: [
{
name: '1 ' + i18n.global.t('commons.units.minute'),
name: '1 ' + i18n.global.t('commons.units.minute', 1),
data: load1Data,
},
{
name: '5 ' + i18n.global.t('commons.units.minute'),
name: '5 ' + i18n.global.t('commons.units.minute', 5),
data: load5Data,
},
{
name: '15 ' + i18n.global.t('commons.units.minute'),
name: '15 ' + i18n.global.t('commons.units.minute', 15),
data: load15Data,
},
{
Expand All @@ -417,7 +417,7 @@ function initLoadCharts(item: Host.MonitorData) {
},
],
yAxis: [
{ type: 'value', name: i18n.global.t('monitor.loadDetail') + ' ( % )' },
{ type: 'value', name: i18n.global.t('monitor.loadDetail') },
{
type: 'value',
name: i18n.global.t('monitor.resourceUsage') + ' ( % )',
Expand All @@ -426,7 +426,22 @@ function initLoadCharts(item: Host.MonitorData) {
},
],
grid: mobile.value ? { left: '15%', right: '15%', bottom: '20%' } : null,
formatStr: '%',
tooltip: {
trigger: 'axis',
formatter: function (datas: any) {
let res = datas[0].name + '<br/>';
for (const item of datas) {
if (item.seriesName === i18n.global.t('monitor.resourceUsage')) {
res +=
item.marker + ' ' + item.seriesName + i18n.global.t('commons.colon') + item.data + '%<br/>';
} else {
res +=
item.marker + ' ' + item.seriesName + i18n.global.t('commons.colon') + item.data + '<br/>';
}
}
return res;
},
},
};
}

Expand Down Expand Up @@ -482,22 +497,35 @@ function initIOCharts(item: Host.MonitorData) {
item.seriesName === i18n.global.t('monitor.read') ||
item.seriesName === i18n.global.t('monitor.write')
) {
res += item.marker + ' ' + item.seriesName + ':' + computeSizeFromKBs(item.data) + '<br/>';
res +=
item.marker +
' ' +
item.seriesName +
i18n.global.t('commons.colon') +
computeSizeFromKBs(item.data) +
'<br/>';
}
if (item.seriesName === i18n.global.t('monitor.readWriteCount')) {
res +=
item.marker +
' ' +
item.seriesName +
':' +
i18n.global.t('commons.colon') +
item.data +
' ' +
i18n.global.t('commons.units.time') +
'/s' +
'<br/>';
}
if (item.seriesName === i18n.global.t('monitor.readWriteTime')) {
res += item.marker + ' ' + item.seriesName + ':' + item.data + ' ms' + '<br/>';
res +=
item.marker +
' ' +
item.seriesName +
i18n.global.t('commons.colon') +
item.data +
' ms' +
'<br/>';
}
}
return res;
Expand Down Expand Up @@ -550,7 +578,7 @@ onMounted(() => {
.networkOption {
font-size: 16px;
font-weight: 500;
margin-left: 5px;
margin-top: 3px;
cursor: pointer;
color: var(--el-color-primary);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/terminal/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ $t('menu.terminal') }}
</el-radio-button>
<el-radio-button class="router_card_button" size="large" value="host">
{{ $t('menu.host') }}
{{ $t('terminal.host') }}
</el-radio-button>
<el-radio-button class="router_card_button" size="large" value="command">
{{ $t('terminal.quickCommand') }}
Expand Down
Loading