SHA256
UI: нормальное закрытие сессий и сортировка устройств
This commit is contained in:
@@ -55,11 +55,12 @@ export function render({ navigate, route }) {
|
||||
|
||||
const details = document.createElement('div');
|
||||
details.className = 'card stack';
|
||||
const onlineStatusClass = session.onlineOnThisServer ? 'session-status session-status--online' : 'session-status';
|
||||
details.innerHTML = `
|
||||
<div><p class="meta-muted">sessionId</p><p>${session.sessionId}</p></div>
|
||||
<div><p class="meta-muted">sessionType</p><p>${formatSessionType(session.sessionType)}</p></div>
|
||||
<div><p class="meta-muted">clientPlatform</p><p>${session.clientPlatform || '-'}</p></div>
|
||||
<div><p class="meta-muted">onlineOnThisServer</p><p>${formatOnlineStatus(!!session.onlineOnThisServer)}</p></div>
|
||||
<div><p class="meta-muted">onlineOnThisServer</p><p class="${onlineStatusClass}">${formatOnlineStatus(!!session.onlineOnThisServer)}</p></div>
|
||||
<div><p class="meta-muted">clientInfoFromClient</p><p>${session.clientInfoFromClient || '-'}</p></div>
|
||||
<div><p class="meta-muted">clientInfoFromRequest</p><p>${session.clientInfoFromRequest || '-'}</p></div>
|
||||
<div><p class="meta-muted">geo</p><p>${session.geo || 'unknown'}</p></div>
|
||||
@@ -79,6 +80,14 @@ export function render({ navigate, route }) {
|
||||
if (!confirmed) return;
|
||||
|
||||
try {
|
||||
if (isCurrentSession) {
|
||||
await terminateCurrentSession({
|
||||
infoMessage: 'Текущая сессия завершена, данные на устройстве очищены.',
|
||||
closeServerSession: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await authService.closeSession(session.sessionId);
|
||||
} catch (error) {
|
||||
if (!isSessionInvalidError(error)) {
|
||||
@@ -86,13 +95,12 @@ export function render({ navigate, route }) {
|
||||
window.alert(error.message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (isCurrentSession) {
|
||||
await terminateCurrentSession({
|
||||
infoMessage: 'Текущая сессия завершена, данные на устройстве очищены.',
|
||||
});
|
||||
return;
|
||||
if (isCurrentSession) {
|
||||
await terminateCurrentSession({
|
||||
infoMessage: 'Текущая сессия завершена, данные на устройстве очищены.',
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user