|
170 | 170 | <CardWithHeader :header="$t('home.systemInfo')">
|
171 | 171 | <template #body>
|
172 | 172 | <el-scrollbar>
|
173 |
| - <el-descriptions :column="1" class="h-systemInfo"> |
174 |
| - <el-descriptions-item class-name="system-content"> |
| 173 | + <el-descriptions :column="1" class="h-systemInfo" border> |
| 174 | + <el-descriptions-item class-name="system-content" label-class-name="system-label"> |
175 | 175 | <template #label>
|
176 |
| - <span class="system-label"> |
177 |
| - {{ $t('home.hostname') }} |
178 |
| - </span> |
| 176 | + <span>{{ $t('home.hostname') }}</span> |
179 | 177 | </template>
|
180 | 178 | {{ baseInfo.hostname }}
|
181 | 179 | </el-descriptions-item>
|
182 |
| - <el-descriptions-item class-name="system-content"> |
| 180 | + <el-descriptions-item class-name="system-content" label-class-name="system-label"> |
183 | 181 | <template #label>
|
184 |
| - <span class="system-label"> |
185 |
| - {{ $t('home.platformVersion') }} |
186 |
| - </span> |
| 182 | + <span>{{ $t('home.platformVersion') }}</span> |
187 | 183 | </template>
|
188 | 184 | {{
|
189 | 185 | baseInfo.platformVersion
|
190 | 186 | ? baseInfo.platform
|
191 | 187 | : baseInfo.platform + '-' + baseInfo.platformVersion
|
192 | 188 | }}
|
193 | 189 | </el-descriptions-item>
|
194 |
| - <el-descriptions-item class-name="system-content"> |
| 190 | + <el-descriptions-item class-name="system-content" label-class-name="system-label"> |
195 | 191 | <template #label>
|
196 |
| - <span class="system-label"> |
197 |
| - {{ $t('home.kernelVersion') }} |
198 |
| - </span> |
| 192 | + <span>{{ $t('home.kernelVersion') }}</span> |
199 | 193 | </template>
|
200 | 194 | {{ baseInfo.kernelVersion }}
|
201 | 195 | </el-descriptions-item>
|
202 |
| - <el-descriptions-item class-name="system-content"> |
| 196 | + <el-descriptions-item class-name="system-content" label-class-name="system-label"> |
203 | 197 | <template #label>
|
204 |
| - <span class="system-label"> |
205 |
| - {{ $t('home.kernelArch') }} |
206 |
| - </span> |
| 198 | + <span>{{ $t('home.kernelArch') }}</span> |
207 | 199 | </template>
|
208 | 200 | {{ baseInfo.kernelArch }}
|
209 | 201 | </el-descriptions-item>
|
210 | 202 | <el-descriptions-item
|
211 | 203 | v-if="baseInfo.ipv4Addr && baseInfo.ipv4Addr !== 'IPNotFound'"
|
212 | 204 | class-name="system-content"
|
| 205 | + label-class-name="system-label" |
213 | 206 | >
|
214 | 207 | <template #label>
|
215 |
| - <span class="system-label"> |
216 |
| - {{ $t('home.ip') }} |
217 |
| - </span> |
| 208 | + <span>{{ $t('home.ip') }}</span> |
218 | 209 | </template>
|
219 | 210 | {{ baseInfo.ipv4Addr }}
|
220 | 211 | </el-descriptions-item>
|
221 | 212 | <el-descriptions-item
|
222 | 213 | v-if="baseInfo.systemProxy && baseInfo.systemProxy !== 'noProxy'"
|
223 | 214 | class-name="system-content"
|
| 215 | + label-class-name="system-label" |
224 | 216 | >
|
225 | 217 | <template #label>
|
226 |
| - <span class="system-label"> |
227 |
| - {{ $t('home.proxy') }} |
228 |
| - </span> |
| 218 | + <span>{{ $t('home.proxy') }}</span> |
229 | 219 | </template>
|
230 | 220 | {{ baseInfo.systemProxy }}
|
231 | 221 | </el-descriptions-item>
|
232 |
| - <el-descriptions-item class-name="system-content"> |
| 222 | + <el-descriptions-item class-name="system-content" label-class-name="system-label"> |
233 | 223 | <template #label>
|
234 |
| - <span class="system-label"> |
235 |
| - {{ $t('home.uptime') }} |
236 |
| - </span> |
| 224 | + <span>{{ $t('home.uptime') }}</span> |
237 | 225 | </template>
|
238 | 226 | {{ currentInfo.timeSinceUptime }}
|
239 | 227 | </el-descriptions-item>
|
240 |
| - <el-descriptions-item class-name="system-content"> |
| 228 | + <el-descriptions-item class-name="system-content" label-class-name="system-label"> |
241 | 229 | <template #label>
|
242 |
| - <span class="system-label"> |
243 |
| - {{ $t('home.runningTime') }} |
244 |
| - </span> |
| 230 | + <span>{{ $t('home.runningTime') }}</span> |
245 | 231 | </template>
|
246 | 232 | {{ loadUpTime(currentInfo.uptime) }}
|
247 | 233 | </el-descriptions-item>
|
@@ -563,43 +549,25 @@ function loadUpTime(uptime: number) {
|
563 | 549 | let hours = Math.floor((uptime % 86400) / 3600);
|
564 | 550 | let minutes = Math.floor((uptime % 3600) / 60);
|
565 | 551 | let seconds = uptime % 60;
|
| 552 | + let uptimeParts = []; |
| 553 | + let lead = false; |
566 | 554 | if (days !== 0) {
|
567 |
| - return ( |
568 |
| - days + |
569 |
| - i18n.global.t('commons.units.day', days) + |
570 |
| - ' ' + |
571 |
| - hours + |
572 |
| - i18n.global.t('commons.units.hour', hours) + |
573 |
| - ' ' + |
574 |
| - minutes + |
575 |
| - i18n.global.t('commons.units.minute', minutes) + |
576 |
| - ' ' + |
577 |
| - seconds + |
578 |
| - i18n.global.t('commons.units.second', seconds) |
579 |
| - ); |
| 555 | + uptimeParts.push(days + i18n.global.t('commons.units.dayUnit', days)); |
| 556 | + lead = true; |
| 557 | + } |
| 558 | + if (lead || hours !== 0) { |
| 559 | + uptimeParts.push(hours + i18n.global.t('commons.units.hourUnit', hours)); |
| 560 | + lead = true; |
580 | 561 | }
|
581 |
| - if (hours !== 0) { |
582 |
| - return ( |
583 |
| - hours + |
584 |
| - i18n.global.t('commons.units.hour', hours) + |
585 |
| - ' ' + |
586 |
| - minutes + |
587 |
| - i18n.global.t('commons.units.minute', minutes) + |
588 |
| - ' ' + |
589 |
| - seconds + |
590 |
| - i18n.global.t('commons.units.second', seconds) |
591 |
| - ); |
| 562 | + if (lead || minutes !== 0) { |
| 563 | + uptimeParts.push(minutes + i18n.global.t('commons.units.minuteUnit', minutes)); |
| 564 | + lead = true; |
592 | 565 | }
|
593 |
| - if (minutes !== 0) { |
594 |
| - return ( |
595 |
| - minutes + |
596 |
| - i18n.global.t('commons.units.minute', minutes) + |
597 |
| - ' ' + |
598 |
| - seconds + |
599 |
| - i18n.global.t('commons.units.second', seconds) |
600 |
| - ); |
| 566 | + if (lead || seconds !== 0) { |
| 567 | + uptimeParts.push(seconds + i18n.global.t('commons.units.secondUnit', seconds)); |
| 568 | + lead = true; |
601 | 569 | }
|
602 |
| - return seconds + i18n.global.t('commons.units.second'); |
| 570 | + return lead ? uptimeParts.join(' ') : '-'; |
603 | 571 | }
|
604 | 572 |
|
605 | 573 | const loadData = async () => {
|
@@ -725,10 +693,16 @@ onBeforeUnmount(() => {
|
725 | 693 | font-weight: 400 !important;
|
726 | 694 | font-size: 14px !important;
|
727 | 695 | color: var(--panel-text-color);
|
| 696 | + border: none !important; |
| 697 | + background: none !important; |
| 698 | + width: fit-content !important; |
| 699 | + white-space: nowrap !important; |
728 | 700 | }
|
729 | 701 |
|
730 | 702 | .system-content {
|
731 | 703 | font-size: 13px !important;
|
| 704 | + border: none !important; |
| 705 | + width: 100% !important; |
732 | 706 | }
|
733 | 707 |
|
734 | 708 | .monitor-tags {
|
|
0 commit comments