diff --git a/src/assets/images/login-banner.png b/src/assets/images/login-banner.png index a3b3776..9f407a7 100644 Binary files a/src/assets/images/login-banner.png and b/src/assets/images/login-banner.png differ diff --git a/src/views/login/components/banner.vue b/src/views/login/components/banner.vue index ca1e8f0..26217b4 100644 --- a/src/views/login/components/banner.vue +++ b/src/views/login/components/banner.vue @@ -24,7 +24,7 @@ const carouselItem = computed(() => [ { // slogan: t('login.banner.slogan1'), // subSlogan: t('login.banner.subSlogan1'), - image: 'https://ops.apinb.com/assets/login-image-CPDtwfmL.png', + image: bannerImage, }, // { // slogan: t('login.banner.slogan2'), diff --git a/src/views/ops/pages/dc/server/config/columns.ts b/src/views/ops/pages/dc/server/config/columns.ts index 4973c3e..2790191 100644 --- a/src/views/ops/pages/dc/server/config/columns.ts +++ b/src/views/ops/pages/dc/server/config/columns.ts @@ -15,11 +15,6 @@ export const columns = [ title: '名称', width: 150, }, - { - dataIndex: 'host', - title: '主机地址', - width: 150, - }, { dataIndex: 'ip_address', title: 'IP 地址', @@ -30,11 +25,6 @@ export const columns = [ title: '操作系统', width: 120, }, - { - dataIndex: 'os_version', - title: '系统版本', - width: 120, - }, { dataIndex: 'server_type', title: '类型', @@ -63,6 +53,24 @@ export const columns = [ width: 100, slotName: 'data_collection', }, + { + dataIndex: 'cpu_state', + title: 'CPU使用率', + width: 150, + slotName: 'cpu', + }, + { + dataIndex: 'memory_state', + title: '内存使用率', + width: 150, + slotName: 'memory', + }, + { + dataIndex: 'disk_state', + title: '硬盘使用率', + width: 150, + slotName: 'disk', + }, { dataIndex: 'status', title: '状态', diff --git a/src/views/ops/pages/dc/server/index.vue b/src/views/ops/pages/dc/server/index.vue index 09926ce..5d5b695 100644 --- a/src/views/ops/pages/dc/server/index.vue +++ b/src/views/ops/pages/dc/server/index.vue @@ -445,9 +445,9 @@ const getAllMetrics = async () => { } catch (urlError) { console.warn(`服务器 ${record.name} 的 agent_config 不是合法的 URL:`, metricsUrl) // 设置默认值 0 - record.cpu_info = { value: 0, total: '', used: '' } - record.memory_info = { value: 0, total: '', used: '' } - record.disk_info = { value: 0, total: '', used: '' } + record.cpu_state = { value: 0, total: '', used: '' } + record.memory_state = { value: 0, total: '', used: '' } + record.disk_state = { value: 0, total: '', used: '' } return } @@ -458,19 +458,19 @@ const getAllMetrics = async () => { if (response.data) { // 更新记录的监控数据 - record.cpu_info = { + record.cpu_state = { value: response.data.cpu_usage || 0, total: response.data.cpu?.[0]?.cores ? `${response.data.cpu[0].cores}核` : '', used: '', } - record.memory_info = { + record.memory_state = { value: response.data.mem_usage?.used_percent || 0, total: response.data.mem_usage?.total ? `${(response.data.mem_usage.total / 1024 / 1024 / 1024).toFixed(1)}GB` : '', used: response.data.mem_usage?.used ? `${(response.data.mem_usage.used / 1024 / 1024 / 1024).toFixed(1)}GB` : '', } - record.disk_info = { + record.disk_state = { value: response.data.disk_usage?.used_percent || 0, total: response.data.disk_usage?.total ? `${(response.data.disk_usage.total / 1024 / 1024 / 1024).toFixed(0)}GB` : '', used: response.data.disk_usage?.used ? `${(response.data.disk_usage.used / 1024 / 1024 / 1024).toFixed(0)}GB` : '', @@ -479,15 +479,15 @@ const getAllMetrics = async () => { } catch (error) { console.warn(`获取服务器 ${record.name} 的监控指标失败:`, error) // 初始化默认值 - record.cpu_info = { value: 0, total: '', used: '' } - record.memory_info = { value: 0, total: '', used: '' } - record.disk_info = { value: 0, total: '', used: '' } + record.cpu_state = { value: 0, total: '', used: '' } + record.memory_state = { value: 0, total: '', used: '' } + record.disk_state = { value: 0, total: '', used: '' } } } else { // 没有配置 agent,设置默认值 - record.cpu_info = { value: 0, total: '', used: '' } - record.memory_info = { value: 0, total: '', used: '' } - record.disk_info = { value: 0, total: '', used: '' } + record.cpu_state = { value: 0, total: '', used: '' } + record.memory_state = { value: 0, total: '', used: '' } + record.disk_state = { value: 0, total: '', used: '' } } })