Skip to content

Commit c522a30

Browse files
authored
Refine English translation and UI style (#7399)
1 parent dde686d commit c522a30

File tree

3 files changed

+45
-76
lines changed

3 files changed

+45
-76
lines changed

frontend/src/lang/modules/en.ts

+6-11
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ const message = {
349349
restart_system: 'Restart server',
350350
operationSuccess: 'Operation succeeded, rebooting, please refresh the browser manually later!',
351351
overview: 'Overview',
352-
entranceHelper: `Security entrance isn't enabled. You can enable it in "Setting -> Security" to improve system security.`,
352+
entranceHelper: `Security entrance isn't enabled. You can enable it in "Settings -> Security" to improve system security.`,
353353
appInstalled: 'Applications',
354354
systemInfo: 'System infomation',
355355
hostname: 'Hostname',
@@ -1007,7 +1007,6 @@ const message = {
10071007
fold: 'All contract',
10081008
batchInput: 'Batch processing',
10091009
quickCommand: 'Quick command | Quick commands',
1010-
// quickCommandHelper: 'Frequently used command list for quick selection at the bottom of the terminal interface.',
10111010
quickCommandHelper: 'You can use the quick commands at the bottom of the "Terminals -> Terminals".',
10121011
groupDeleteHelper:
10131012
'After the group is removed, all connections in the group will be migrated to the default group. Do you want to continue?',
@@ -1857,13 +1856,13 @@ const message = {
18571856
updateWarn: 'Update parameters need to rebuild the application, Do you want to continue? ',
18581857
busPort: 'Port',
18591858
syncStart: 'Start syncing! Please refresh the app store later',
1860-
advanced: 'Advanced Settings',
1859+
advanced: 'Advanced settings',
18611860
cpuCore: 'core(s)',
18621861
containerName: 'Container name',
18631862
containerNameHelper: 'The container name will be automatically generated when not set',
18641863
allowPort: 'External access',
18651864
allowPortHelper: 'Allowing external port access will release the firewall port',
1866-
appInstallWarn: `The application dosn't expose the external access port by default. Click "Advanced Settings" to expose it.`,
1865+
appInstallWarn: `The application dosn't expose the external access port by default. Click "Advanced settings" to expose it.`,
18671866
upgradeStart: 'Start upgrading! Please refresh the page later',
18681867
toFolder: 'Open the installation directory',
18691868
editCompose: 'Edit compose file',
@@ -1873,7 +1872,7 @@ const message = {
18731872
allReadyInstalled: 'Installed',
18741873
installHelper: 'If you have image pull issues, configure image acceleration.',
18751874
upgradeHelper:
1876-
'Bring abnormal applications back to normal status before upgrading. If the upgrade fails, go to "Log" > "System Logs" to check the failure reason.',
1875+
'Bring abnormal applications back to normal status before upgrading. If the upgrade fails, go to "Logs > System Logs" to check the failure reason.',
18771876
installWarn: `External access has not been enabled, which prevents the application from being accessible via external networks. Do you want to continue?`,
18781877
showIgnore: 'View ignored applications',
18791878
cancelIgnore: 'Cancel ignore',
@@ -2345,12 +2344,11 @@ const message = {
23452344
accept: 'Accept',
23462345
drop: 'Drop',
23472346
source: 'Source',
2348-
anyWhere: 'AnyWhere',
2349-
address: 'Specified IP',
2347+
anyWhere: 'Any',
2348+
address: 'Specified IPs',
23502349
addressHelper: 'Support IP address or IP segment',
23512350
allow: 'Allow',
23522351
deny: 'Deny',
2353-
// addressFormatError: 'Please enter a valid IP address!',
23542352
addressFormatError: 'This field must be a valid IP address.',
23552353
addressHelper1: 'Support IP address or IP range. For example, "172.16.10.11" or "172.16.10.0/24".',
23562354
addressHelper2: 'For multiple IP addresses, separate with comma. For example, "172.16.10.11, 172.16.0.0/24".',
@@ -2484,9 +2482,6 @@ const message = {
24842482
uptime: 'Running time',
24852483
notStartWarn: `Supervisor isn't started. Start it first.`,
24862484
serviceName: 'Service name',
2487-
// initHelper:
2488-
// 'The initialization process will modify the configuration file, causing all existing daemon processes to stop, please confirm the risk in advance',
2489-
// initHelper: '尚未初始化 Supervisor ,请先初始化',
24902485
initHelper: `Supervisor service isn't initialized. Click "Initialize" to initialize.`,
24912486
serviceNameHelper: 'Supervisor service name managed by systemctl, usually supervisor or supervisord',
24922487
restartHelper:

frontend/src/views/home/index.vue

+38-64
Original file line numberDiff line numberDiff line change
@@ -170,78 +170,64 @@
170170
<CardWithHeader :header="$t('home.systemInfo')">
171171
<template #body>
172172
<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">
175175
<template #label>
176-
<span class="system-label">
177-
{{ $t('home.hostname') }}
178-
</span>
176+
<span>{{ $t('home.hostname') }}</span>
179177
</template>
180178
{{ baseInfo.hostname }}
181179
</el-descriptions-item>
182-
<el-descriptions-item class-name="system-content">
180+
<el-descriptions-item class-name="system-content" label-class-name="system-label">
183181
<template #label>
184-
<span class="system-label">
185-
{{ $t('home.platformVersion') }}
186-
</span>
182+
<span>{{ $t('home.platformVersion') }}</span>
187183
</template>
188184
{{
189185
baseInfo.platformVersion
190186
? baseInfo.platform
191187
: baseInfo.platform + '-' + baseInfo.platformVersion
192188
}}
193189
</el-descriptions-item>
194-
<el-descriptions-item class-name="system-content">
190+
<el-descriptions-item class-name="system-content" label-class-name="system-label">
195191
<template #label>
196-
<span class="system-label">
197-
{{ $t('home.kernelVersion') }}
198-
</span>
192+
<span>{{ $t('home.kernelVersion') }}</span>
199193
</template>
200194
{{ baseInfo.kernelVersion }}
201195
</el-descriptions-item>
202-
<el-descriptions-item class-name="system-content">
196+
<el-descriptions-item class-name="system-content" label-class-name="system-label">
203197
<template #label>
204-
<span class="system-label">
205-
{{ $t('home.kernelArch') }}
206-
</span>
198+
<span>{{ $t('home.kernelArch') }}</span>
207199
</template>
208200
{{ baseInfo.kernelArch }}
209201
</el-descriptions-item>
210202
<el-descriptions-item
211203
v-if="baseInfo.ipv4Addr && baseInfo.ipv4Addr !== 'IPNotFound'"
212204
class-name="system-content"
205+
label-class-name="system-label"
213206
>
214207
<template #label>
215-
<span class="system-label">
216-
{{ $t('home.ip') }}
217-
</span>
208+
<span>{{ $t('home.ip') }}</span>
218209
</template>
219210
{{ baseInfo.ipv4Addr }}
220211
</el-descriptions-item>
221212
<el-descriptions-item
222213
v-if="baseInfo.systemProxy && baseInfo.systemProxy !== 'noProxy'"
223214
class-name="system-content"
215+
label-class-name="system-label"
224216
>
225217
<template #label>
226-
<span class="system-label">
227-
{{ $t('home.proxy') }}
228-
</span>
218+
<span>{{ $t('home.proxy') }}</span>
229219
</template>
230220
{{ baseInfo.systemProxy }}
231221
</el-descriptions-item>
232-
<el-descriptions-item class-name="system-content">
222+
<el-descriptions-item class-name="system-content" label-class-name="system-label">
233223
<template #label>
234-
<span class="system-label">
235-
{{ $t('home.uptime') }}
236-
</span>
224+
<span>{{ $t('home.uptime') }}</span>
237225
</template>
238226
{{ currentInfo.timeSinceUptime }}
239227
</el-descriptions-item>
240-
<el-descriptions-item class-name="system-content">
228+
<el-descriptions-item class-name="system-content" label-class-name="system-label">
241229
<template #label>
242-
<span class="system-label">
243-
{{ $t('home.runningTime') }}
244-
</span>
230+
<span>{{ $t('home.runningTime') }}</span>
245231
</template>
246232
{{ loadUpTime(currentInfo.uptime) }}
247233
</el-descriptions-item>
@@ -563,43 +549,25 @@ function loadUpTime(uptime: number) {
563549
let hours = Math.floor((uptime % 86400) / 3600);
564550
let minutes = Math.floor((uptime % 3600) / 60);
565551
let seconds = uptime % 60;
552+
let uptimeParts = [];
553+
let lead = false;
566554
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;
580561
}
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;
592565
}
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;
601569
}
602-
return seconds + i18n.global.t('commons.units.second');
570+
return lead ? uptimeParts.join(' ') : '-';
603571
}
604572
605573
const loadData = async () => {
@@ -725,10 +693,16 @@ onBeforeUnmount(() => {
725693
font-weight: 400 !important;
726694
font-size: 14px !important;
727695
color: var(--panel-text-color);
696+
border: none !important;
697+
background: none !important;
698+
width: fit-content !important;
699+
white-space: nowrap !important;
728700
}
729701
730702
.system-content {
731703
font-size: 13px !important;
704+
border: none !important;
705+
width: 100% !important;
732706
}
733707
734708
.monitor-tags {

frontend/src/views/host/firewall/port/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<span>{{ $t('firewall.firewallNotStart') }}</span>
1818
</el-card>
1919

20-
<LayoutContent :title="$t('firewall.portRule')" :class="{ mask: fireStatus != 'running' }">
20+
<LayoutContent :title="$t('firewall.portRule', 2)" :class="{ mask: fireStatus != 'running' }">
2121
<template #prompt>
2222
<el-alert type="info" :closable="false">
2323
<template #default>

0 commit comments

Comments
 (0)