mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
chore(i18n): polish auth file health status fallback text
This commit is contained in:
@@ -117,9 +117,9 @@ export function AuthFileCard(props: AuthFileCardProps) {
|
||||
const isFileDisabled = file.disabled === true || rawStatus === 'disabled';
|
||||
const isUnavailable = file.unavailable === true || rawStatus === 'unavailable';
|
||||
const lastRefreshDate = parseDateFromUnknown(file['last_refresh'] ?? file.lastRefresh);
|
||||
const isRefreshStale =
|
||||
Boolean(lastRefreshDate) &&
|
||||
Date.now() - lastRefreshDate.getTime() > AUTH_FILE_REFRESH_WARNING_MS;
|
||||
const isRefreshStale = lastRefreshDate
|
||||
? Date.now() - lastRefreshDate.getTime() > AUTH_FILE_REFRESH_WARNING_MS
|
||||
: false;
|
||||
const hasStatusWarning =
|
||||
Boolean(rawStatusMessage) && !HEALTHY_STATUS_MESSAGES.has(normalizedStatusMessage);
|
||||
const hasStatusFailure = rawStatus === 'error' || rawStatus === 'failed' || rawStatus === 'warning';
|
||||
@@ -156,13 +156,16 @@ export function AuthFileCard(props: AuthFileCardProps) {
|
||||
];
|
||||
const matched = units.find(({ ms }) => absMs >= ms) || units[units.length - 1];
|
||||
const value = Math.round(diffMs / matched.ms);
|
||||
if (typeof Intl === 'undefined' || typeof Intl.RelativeTimeFormat !== 'function') {
|
||||
return lastRefreshDate.toLocaleString(i18n.language);
|
||||
}
|
||||
const formatter = new Intl.RelativeTimeFormat(i18n.language, { numeric: 'auto' });
|
||||
return formatter.format(value, matched.unit);
|
||||
})();
|
||||
const lastRefreshTitle = lastRefreshDate
|
||||
? lastRefreshDate.toLocaleString(i18n.language)
|
||||
: t('auth_files.refresh_not_available');
|
||||
const healthStatusTitle = rawStatusMessage || t('auth_files.refresh_not_available');
|
||||
const healthStatusTitle = rawStatusMessage || t('auth_files.health_status_no_message');
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -393,6 +393,7 @@
|
||||
"health_status_warning": "Warning",
|
||||
"health_status_disabled": "Disabled",
|
||||
"health_status_unknown": "Unknown",
|
||||
"health_status_no_message": "No status message",
|
||||
"last_refresh_label": "Last Refresh",
|
||||
"refresh_not_available": "N/A",
|
||||
"refresh_just_now": "Just now",
|
||||
|
||||
@@ -393,6 +393,7 @@
|
||||
"health_status_warning": "Предупреждение",
|
||||
"health_status_disabled": "Отключено",
|
||||
"health_status_unknown": "Неизвестно",
|
||||
"health_status_no_message": "Нет сообщения о статусе",
|
||||
"last_refresh_label": "Последнее обновление",
|
||||
"refresh_not_available": "Н/Д",
|
||||
"refresh_just_now": "Только что",
|
||||
|
||||
@@ -393,6 +393,7 @@
|
||||
"health_status_warning": "警告",
|
||||
"health_status_disabled": "已停用",
|
||||
"health_status_unknown": "未知",
|
||||
"health_status_no_message": "暂无状态说明",
|
||||
"last_refresh_label": "最近刷新",
|
||||
"refresh_not_available": "暂无",
|
||||
"refresh_just_now": "刚刚",
|
||||
|
||||
Reference in New Issue
Block a user