|
@@ -567,10 +567,14 @@
|
|
|
import { ref, reactive, onMounted, computed, watch } from 'vue'
|
|
import { ref, reactive, onMounted, computed, watch } from 'vue'
|
|
|
import { Search, RefreshRight, Delete, View, Edit, VideoCamera, Plus, QuestionFilled } from '@element-plus/icons-vue'
|
|
import { Search, RefreshRight, Delete, View, Edit, VideoCamera, Plus, QuestionFilled } from '@element-plus/icons-vue'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
+import { Icon } from '@iconify/vue'
|
|
|
|
|
+import type { FormInstance, FormRules } from 'element-plus'
|
|
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
|
+import { useI18n } from 'vue-i18n'
|
|
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
import { listLssNodes, deleteLssNode, setLssNodeEnabled, updateLssNode } from '@/api/lss'
|
|
import { listLssNodes, deleteLssNode, setLssNodeEnabled, updateLssNode } from '@/api/lss'
|
|
|
import { adminListCameras, adminAddCamera, adminUpdateCamera, adminDeleteCamera, adminGetCamera } from '@/api/camera'
|
|
import { adminListCameras, adminAddCamera, adminUpdateCamera, adminDeleteCamera, adminGetCamera } from '@/api/camera'
|
|
|
import { listCameraVendors } from '@/api/camera-vendor'
|
|
import { listCameraVendors } from '@/api/camera-vendor'
|
|
|
-import { Icon } from '@iconify/vue'
|
|
|
|
|
import CodeEditor from '@/components/CodeEditor.vue'
|
|
import CodeEditor from '@/components/CodeEditor.vue'
|
|
|
import type {
|
|
import type {
|
|
|
LssNodeDTO,
|
|
LssNodeDTO,
|
|
@@ -584,10 +588,7 @@ import type {
|
|
|
IAbly,
|
|
IAbly,
|
|
|
CameraHeartbeatStatus
|
|
CameraHeartbeatStatus
|
|
|
} from '@/types'
|
|
} from '@/types'
|
|
|
-import type { FormInstance, FormRules } from 'element-plus'
|
|
|
|
|
-import dayjs from 'dayjs'
|
|
|
|
|
-import { useI18n } from 'vue-i18n'
|
|
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
|
|
|
|
+
|
|
|
const { t } = useI18n({ useScope: 'global' })
|
|
const { t } = useI18n({ useScope: 'global' })
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -631,13 +632,13 @@ function formatCameraStatus(row: CameraInfoDTO): string {
|
|
|
if (row.status === 'active') {
|
|
if (row.status === 'active') {
|
|
|
// 大约5秒钟
|
|
// 大约5秒钟
|
|
|
return `active [${formatTime(row.updatedAt)}]`
|
|
return `active [${formatTime(row.updatedAt)}]`
|
|
|
- } else if (row.status === 'hold') {
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (row.status === 'hold') {
|
|
|
// 大约5分钟没有返回
|
|
// 大约5分钟没有返回
|
|
|
return `hold [${formatTime(row.updatedAt)}]`
|
|
return `hold [${formatTime(row.updatedAt)}]`
|
|
|
- } else {
|
|
|
|
|
- // 大约10分钟没有返回
|
|
|
|
|
- return `dead (离线)`
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ // 大约10分钟没有返回
|
|
|
|
|
+ return `dead (离线)`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 当前激活的摄像头 ID
|
|
// 当前激活的摄像头 ID
|
|
@@ -694,11 +695,11 @@ function formatHeartbeat(lss: LssNodeDTO | null | undefined): string {
|
|
|
const time = lss.heartbeatTime || lss.updatedAt
|
|
const time = lss.heartbeatTime || lss.updatedAt
|
|
|
if (status === 'active') {
|
|
if (status === 'active') {
|
|
|
return `active [${formatTime(time)}]`
|
|
return `active [${formatTime(time)}]`
|
|
|
- } else if (status === 'hold') {
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (status === 'hold') {
|
|
|
return `hold [${formatTime(time)}]`
|
|
return `hold [${formatTime(time)}]`
|
|
|
- } else {
|
|
|
|
|
- return `dead (离线)`
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ return `dead (离线)`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取心跳状态样式类
|
|
// 获取心跳状态样式类
|