diff --git a/nezha-fronted/src/assets/css/components/common/table/asset/assetTable.scss b/nezha-fronted/src/assets/css/components/common/table/asset/assetTable.scss index 7e422f7ab..e7e7ee046 100644 --- a/nezha-fronted/src/assets/css/components/common/table/asset/assetTable.scss +++ b/nezha-fronted/src/assets/css/components/common/table/asset/assetTable.scss @@ -4,56 +4,6 @@ position: relative; } } - .active-icon-content { - display: none; - position: absolute; - background: $--background-color-empty; - min-width: 150px; - border: 1px solid $--border-color-light; - padding: 12px; - z-index: 2000; - color: $--color-text-regular; - line-height: 1.4; - text-align: justify; - font-size: 14px; - box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); - left: 100%; - top: 50%; - width: auto; - white-space: nowrap; - transform: translateY(-50%); - } - - .ping-info:hover { - .active-icon-content { - display: block; - } - } - - .ip-info{ - .ip-icon{ - font-size: 16px; - margin-right: 4px; - } - .gray-color{ - color: $--color-suspended !important; - } - .red-color { - color: $--color-danger !important; - } - .green-color { - color: $--color-success !important; - } - .document-copy-text{ - display: flex; - } - } - .ip-info:hover { - .active-icon-content { - display: block; - } - } - } .licenseStatus{ @@ -70,4 +20,55 @@ color: $--color-primary; } } +} + +.active-icon-content { + display: none; + position: absolute; + background: $--background-color-empty; + min-width: 150px; + border: 1px solid $--border-color-light; + padding: 12px; + z-index: 2000; + color: $--color-text-regular; + line-height: 1.4; + text-align: justify; + font-size: 14px; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); + left: 100%; + top: 50%; + width: auto; + white-space: nowrap; + transform: translateY(-50%); +} + +.ip-info{ + .ip-icon{ + font-size: 16px; + margin-right: 4px; + } + .gray-color{ + color: $--color-suspended !important; + } + .red-color { + color: $--color-danger !important; + } + .green-color { + color: $--color-success !important; + } + .document-copy-text{ + display: flex; + align-items: center; + } +} + +.ip-info:hover { + .active-icon-content { + display: block; + } +} +.ping-info:hover { + .active-icon-content { + display: block; + } } \ No newline at end of file diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index a7df61193..ece185181 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -7,50 +7,73 @@ @mouseenter="tipHover(true)" @mouseleave="tipHover(false)" > - -
-
{{$t('overall.name')}}
-
{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}
- -
+
{{ $t("overall.name") }}
+
+ {{ + alertLabelData && alertLabelData.name ? alertLabelData.name : "--" + }} +
+ +
- -
-
{{ $t("asset.manageIp") }}
-
+
{{ $t("config.operationlog.ip") }}
+ +
+
+ + + +
+

+ {{$t('asset.rtt') +' '+ (getPingInfo(alertLabelData, 'mgt').rtt + 'ms')}} +

+

+ {{$t('asset.assetStatPre') +' '+ (getPingInfo(alertLabelData, 'mgt').lastUpdate ? utcTimeToTimezoneStr(getPingInfo(alertLabelData, 'mgt').lastUpdate) : $t('asset.assetStatDown'))}} +

+
+
+
+ + + +
+

+ {{$t('asset.rtt') +' '+ (getPingInfo(alertLabelData, 'ipmi').rtt + 'ms')}} +

+

+ {{$t('asset.assetStatPre') +' '+ (getPingInfo(alertLabelData, 'ipmi').lastUpdate ? utcTimeToTimezoneStr(getPingInfo(alertLabelData, 'ipmi').lastUpdate) : $t('asset.assetStatDown'))}} +

+
+
+
{{ $t("overall.type") }}
@@ -108,32 +197,6 @@ }}
-
-
Ping
-
-
- {{ - alertLabelData && - alertLabelData.pingInfo && - alertLabelData.pingInfo.rtt - ? alertLabelData.pingInfo.rtt + "ms" - : "" - }} -
-
{{ $t("overall.dc") }}
@@ -229,16 +292,31 @@
-
-
{{$t('overall.name')}}
-
- {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} -
- -
+
+
{{ $t("overall.name") }}
+
+ {{ + alertLabelData && alertLabelData.name ? alertLabelData.name : "--" + }} +
+ +
-
{{ $t("project.project.projectName") }}
+
+ {{ $t("project.project.projectName") }} +
{{ alertLabelData && @@ -324,21 +402,32 @@ {{ alertLabelData && alertLabelData ? alertLabelData.id : "--" }}
-
+
-
{{$t('overall.name')}}
-
- {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} -
- -
+
{{ $t("overall.name") }}
+
+ {{ + alertLabelData && alertLabelData.name ? alertLabelData.name : "--" + }} +
+ +
{{ $t("overall.module") }}
-   +   {{ alertLabelData && alertLabelData.moduleNum ? alertLabelData.moduleNum @@ -347,7 +436,7 @@
-
{{$t('asset.endpoint')}}
+
{{ $t("asset.endpoint") }}
  {{ @@ -422,16 +511,31 @@
-
-
{{$t('overall.name')}}
-
- {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} +
+
{{ $t("overall.name") }}
+
+ {{ + alertLabelData && alertLabelData.name ? alertLabelData.name : "--" + }} +
+
- -
-
{{ $t("project.project.projectName") }}
+
+ {{ $t("project.project.projectName") }} +
{{ alertLabelData && @@ -445,9 +549,7 @@
{{ $t("overall.module") }}
-   +   {{ alertLabelData && alertLabelData.module && @@ -508,16 +610,30 @@ {{ $t("overall.metric") }} - + @@ -527,16 +643,30 @@ {{ $t("overall.logs") }} - + @@ -551,14 +681,27 @@ {{ alertLabelData && alertLabelData.id ? alertLabelData.id : "--" }}
-
-
-
{{$t('overall.name')}}
-
- {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} -
- -
+
+
+
{{ $t("overall.name") }}
+
+ {{ + alertLabelData && alertLabelData.name ? alertLabelData.name : "--" + }} +
+ +
{{ $t("asset.location") }}
@@ -660,35 +803,65 @@
-
{{$t('overall.name')}}
+
{{ $t("overall.name") }}
- {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} + {{ + alertLabelData && alertLabelData.name ? alertLabelData.name : "--" + }}
- +
{{ $t("profile.username") }}
- {{ alertLabelData && alertLabelData.username ? alertLabelData.username : "--" }} + {{ + alertLabelData && alertLabelData.username + ? alertLabelData.username + : "--" + }}
- +
{{ $t("profile.role") }}
- {{ alertLabelData && alertLabelData.roles ? alertLabelData.roles[0].name : "--" }} + {{ + alertLabelData && alertLabelData.roles + ? alertLabelData.roles[0].name + : "--" + }}
-
{{ $t("config.system.email.email") }}
+
+ {{ $t("config.system.email.email") }} +
- {{ alertLabelData && alertLabelData.email ? alertLabelData.email : "--" }} + {{ + alertLabelData && alertLabelData.email ? alertLabelData.email : "--" + }}
{{ $t("profile.source") }}
- {{ alertLabelData && alertLabelData.source ? alertLabelData.source : "--" }} + {{ + alertLabelData && alertLabelData.source + ? alertLabelData.source + : "--" + }}
@@ -696,37 +869,61 @@
- {{ alertLabelData && alertLabelData.status === "1" ? $t("overall.enabled") : "--" }} + {{ + alertLabelData && alertLabelData.status === "1" + ? $t("overall.enabled") + : "--" + }}
{{ $t("config.user.language") }}
- {{alertLabelData.lang === "en" ? $t("overall.english") : $t("overall.chinese") }} + {{ + alertLabelData.lang === "en" + ? $t("overall.english") + : $t("overall.chinese") + }}
- {{"--" }} + {{ "--" }}
{{ $t("profile.lastLoginIp") }}
- {{ alertLabelData && alertLabelData.lastLoginIp ? alertLabelData.lastLoginIp : "--" }} + {{ + alertLabelData && alertLabelData.lastLoginIp + ? alertLabelData.lastLoginIp + : "--" + }}
{{ $t("profile.lastLoginTime") }}
- {{ alertLabelData && alertLabelData.lastLoginTime ? alertLabelData.lastLoginTime : "--" }} + {{ + alertLabelData && alertLabelData.lastLoginTime + ? alertLabelData.lastLoginTime + : "--" + }}
-
+
ID
@@ -734,22 +931,38 @@
-
{{$t('overall.name')}}
+
{{ $t("overall.name") }}
- {{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }} + {{ + alertLabelData && alertLabelData.name ? alertLabelData.name : "--" + }}
- +
-
{{$t('notebook.author')}}
+
{{ $t("notebook.author") }}
- {{ alertLabelData && alertLabelData.createUser ? alertLabelData.createUser.name : "--" }} + {{ + alertLabelData && alertLabelData.createUser + ? alertLabelData.createUser.name + : "--" + }}
-
{{$t('notebook.modifiedTime')}}
+
{{ $t("notebook.modifiedTime") }}
- {{ alertLabelData && alertLabelData.uts ? momentTz(alertLabelData.uts) : "--" }} + {{ + alertLabelData && alertLabelData.uts + ? momentTz(alertLabelData.uts) + : "--" + }}
@@ -758,10 +971,13 @@ - + diff --git a/nezha-fronted/src/components/common/table/asset/assetTable.vue b/nezha-fronted/src/components/common/table/asset/assetTable.vue index 13ce08195..91c02f3a1 100644 --- a/nezha-fronted/src/components/common/table/asset/assetTable.vue +++ b/nezha-fronted/src/components/common/table/asset/assetTable.vue @@ -458,7 +458,7 @@ export default { }, getPingInfo (row, type) { - if (!row.pingInfo || !row.pingInfo.length) { + if (!(row && row.pingInfo && row.pingInfo.length)) { return false } const info = row.pingInfo.find(item => item.type == type)