feat: integrate real administration retry and approved feature destinations
This commit is contained in:
1 parent
fef3cb35a8
commit
2be5725fbd
4 files changed
+36
-7
No files matched your search
+14
-1
@@ -56,7 +56,20 @@
|
||||
const row = document.createElement('tr');
|
||||
row.append(cell(`${account.display_name || account.username} (@${account.username})`), cell(account.role), cell(account.status), cell(account.container_name), cell(account.error));
|
||||
const actions = cell(''); actions.textContent = ''; actions.className = 'user-actions';
|
||||
actions.append(action('Reset password', () => openDialog(account, 'password')), action('Delete', () => openDialog(account, 'delete'))); row.append(actions); el('usersBody').append(row);
|
||||
if (account.status === 'error') {
|
||||
let retrying = false;
|
||||
const retry = action('Retry provisioning', async () => {
|
||||
if (retrying || user?.role !== 'admin') return;
|
||||
retrying = true; retry.disabled = true; const retryEpoch = epoch;
|
||||
try { await request(`/api/admin/users/${encodeURIComponent(account.id)}/retry`, {method: 'POST'}); if (retryEpoch === epoch) await refreshUsers(); }
|
||||
catch (error) { if (retryEpoch === epoch) say('adminMessage', error.message); }
|
||||
finally { retrying = false; retry.disabled = false; }
|
||||
});
|
||||
actions.append(retry);
|
||||
}
|
||||
actions.append(action('Reset password', () => openDialog(account, 'password')), action('Delete', () => openDialog(account, 'delete')));
|
||||
Array.from(row.children).forEach((td, index) => td.dataset.label = ['Account', 'Role', 'Status', 'Private assistant', 'Error'][index]);
|
||||
actions.dataset.label = 'Actions'; row.append(actions); el('usersBody').append(row);
|
||||
}
|
||||
say('adminMessage', 'Account and container status refresh automatically.');
|
||||
} catch (error) { say('adminMessage', error.message); } finally { refreshing = false; }
|
||||
|
||||
Reference in new issue
Block a user