Browse Source

change color

yb 3 days ago
parent
commit
05aef8ecbb
1 changed files with 12 additions and 11 deletions
  1. 12 11
      src/views/lss/index.vue

+ 12 - 11
src/views/lss/index.vue

@@ -56,17 +56,18 @@
         <el-table-column prop="ip" :label="t('IP')" min-width="180" sortable="custom" show-overflow-tooltip />
         <el-table-column :label="t('心跳')" width="220" align="center">
           <template #default="{ row }">
-            {{
-              row.status === 'active'
-                ? t('活跃')
-                : row.status === 'hold'
-                ? t('待机')
-                : row.status === 'dead'
-                ? t('离线')
-                : '-'
-            }}
-            |
-            {{ formatTime(row.lastHeartbeatAt) }}
+            <span :class="getHeartbeatClass(row.status)">
+              {{
+                row.status === 'active'
+                  ? t('活跃')
+                  : row.status === 'hold'
+                  ? t('待机')
+                  : row.status === 'dead'
+                  ? t('离线')
+                  : '-'
+              }}
+            </span>
+            | {{ formatTime(row.lastHeartbeatAt) }}
           </template>
         </el-table-column>
         <el-table-column :label="t('设备列表')" align="center">