Browse Source

refactor(lss): enhance LssNodeDTO structure and improve input formatting

- Updated LssNodeDTO interface to include new properties: ably, loadRate, ablyConnected, and lastAblyHeartbeat for better data representation.
- Changed machineId and ip to required fields for improved data integrity.
- Streamlined input formatting in the LSS view for better readability and consistency.
yb 1 week ago
parent
commit
3d5129cb56
2 changed files with 9 additions and 7 deletions
  1. 7 5
      src/types/index.ts
  2. 2 2
      src/views/lss/index.vue

+ 7 - 5
src/types/index.ts

@@ -377,19 +377,21 @@ export interface IAbly {
 }
 
 export interface LssNodeDTO {
+  ably?: IAbly
   id: number
   lssId: string
   lssName: string
-  machineId?: string
+  machineId: string
   address: string
-  publicIp?: string
+  ip: string
   maxTasks: number
   currentTasks: number
+  loadRate: number
   status: LssNodeStatus
-  heartbeat?: LssHeartbeatStatus
-  heartbeatTime?: string
-  ably?: IAbly
   ablyClientId?: string
+  ablyConnected?: boolean
+  lastAblyHeartbeat?: string
+  lastHeartbeatAt?: string
   ffmpegVersion?: string
   systemInfo?: string
   enabled: boolean

+ 2 - 2
src/views/lss/index.vue

@@ -183,9 +183,9 @@
                 <span class="form-value">{{ currentLss?.ip }}</span>
               </el-form-item>
               <el-form-item :label="t('心跳') + ':'">
-                <span class="heartbeat-status" :class="getHeartbeatClass(currentLss?.heartbeat)">
+                <span class="heartbeat-status" :class="getHeartbeatClass(currentLss?.status)">
                   {{ formatHeartbeat(currentLss) }}
-                  <span class="heartbeat-dot" :class="getHeartbeatClass(currentLss?.heartbeat)"></span>
+                  <span class="heartbeat-dot" :class="getHeartbeatClass(currentLss?.status)"></span>
                 </span>
                 <el-tooltip placement="right" effect="light">
                   <template #content>