diff --git a/src/locales/en.json b/src/locales/en.json index 6108f2d..12ed0e2 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -3081,6 +3081,7 @@ "lastConnection": "Last connection", "firstConnection": "First connection", "online": "Online", + "noVpnData": "No connection data available", "requestHistory": "Subscription request history", "requestHistoryTotal": "Total requests", "requestAt": "Date", diff --git a/src/locales/ru.json b/src/locales/ru.json index 16a5261..6d34673 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -3488,6 +3488,7 @@ "lastConnection": "Последнее подключение", "firstConnection": "Первое подключение", "online": "Онлайн", + "noVpnData": "Нет данных о подключении", "requestHistory": "История запросов подписки", "requestHistoryTotal": "Всего запросов", "requestAt": "Дата", diff --git a/src/pages/AdminUserDetail.tsx b/src/pages/AdminUserDetail.tsx index e4baf70..92a4b4c 100644 --- a/src/pages/AdminUserDetail.tsx +++ b/src/pages/AdminUserDetail.tsx @@ -1376,83 +1376,108 @@ export default function AdminUserDetail() { {/* VPN Connection Info */} - {panelInfo && panelInfo.found && ( + {(panelInfo || userSubscriptions.length > 0) && (
-
- {t('admin.users.detail.vpnConnection')} -
-
-
-
- {t('admin.users.detail.lastConnection')} -
-
- {panelInfo.online_at && - (() => { - const onlineDate = new Date(panelInfo.online_at); - const isRecent = Date.now() - onlineDate.getTime() < 5 * 60 * 1000; - return ( - <> - - - {isRecent - ? t('admin.users.detail.online') - : formatDate(panelInfo.online_at)} - - - ); - })()} - {!panelInfo.online_at && -} -
-
-
-
- {t('admin.users.detail.firstConnection')} -
-
- {panelInfo.first_connected_at - ? new Date(panelInfo.first_connected_at).toLocaleDateString(locale, { - day: '2-digit', - month: '2-digit', - year: 'numeric', - }) - : '-'} -
-
- {panelInfo.last_connected_node_name && ( -
-
- {t('admin.users.detail.lastNode')} -
-
- - - - {panelInfo.last_connected_node_name} -
-
+
+ + {t('admin.users.detail.vpnConnection')} + + {userSubscriptions.length > 1 && ( + )}
-
- )} - {panelInfoLoading && !panelInfo && ( -
-
+ {panelInfoLoading && !panelInfo?.found && ( +
+
+
+ )} + {panelInfo?.found && ( +
+
+
+ {t('admin.users.detail.lastConnection')} +
+
+ {panelInfo.online_at && + (() => { + const onlineDate = new Date(panelInfo.online_at); + const isRecent = Date.now() - onlineDate.getTime() < 5 * 60 * 1000; + return ( + <> + + + {isRecent + ? t('admin.users.detail.online') + : formatDate(panelInfo.online_at)} + + + ); + })()} + {!panelInfo.online_at && -} +
+
+
+
+ {t('admin.users.detail.firstConnection')} +
+
+ {panelInfo.first_connected_at + ? new Date(panelInfo.first_connected_at).toLocaleDateString(locale, { + day: '2-digit', + month: '2-digit', + year: 'numeric', + }) + : '-'} +
+
+ {panelInfo.last_connected_node_name && ( +
+
+ {t('admin.users.detail.lastNode')} +
+
+ + + + {panelInfo.last_connected_node_name} +
+
+ )} +
+ )} + {!panelInfoLoading && !panelInfo?.found && userSubscriptions.length > 0 && ( +
+ {t('admin.users.detail.noVpnData')} +
+ )}
)}