refactor(user): remove topbar logout control

go
codex 1 week ago
parent f623a3fdbb
commit d7f87df4f7

@ -28,7 +28,6 @@
.panel-logout-link:hover { color: #ffc1c8 !important; background: rgba(208, 66, 80, .1) !important; }
.panel-topbar { position: sticky; top: 0; z-index: 25; }
.main-area > .content .template-catalog { isolation: isolate; }
.panel-topbar-logout { text-decoration: none; }
html.panel-user-dialog-open { overflow: hidden; overscroll-behavior: none; }
.panel-user-dialog { width: min(468px, calc(100% - 32px)); max-width: none; max-height: min(88vh, 680px); margin: auto; padding: 0; border: 0; border-radius: 16px; background: transparent; color: #25384e; box-shadow: 0 28px 80px rgba(13, 35, 53, .24); overflow: visible; }
.panel-user-dialog:not([open]) { display: none; }
@ -431,8 +430,6 @@ body.vu-embedded .dashboard > .main-area > .vu-main > .vu-topbar { margin: 0; }
.topbar-right { gap: 6px; }
.topbar-user > span:last-child,
.topbar-user #current-username { display: none; }
#logout-button,
.panel-topbar-logout { padding-inline: 9px; }
.cloud-order { padding: 19px 17px; }
.cloud-order-actions { width: 100%; }
.cloud-order-actions .row-button { flex: 1 1 145px; }

@ -2979,8 +2979,6 @@ export async function initialize() {
renderVmDetail(vm);
setVmDetailTab(state.detailTab);
if (state.detailTab === 'operations-log') void loadOperationLogs(vmId);
byId('logout-button')?.addEventListener('click', () => location.assign('/user/logout'));
byId('vm-detail-refresh-button')?.addEventListener('click', async () => {
await refreshMetadataAndStatus(vmId, true, true, true);
if (trafficDailyViewVisible()) await loadVmTrafficDaily(true);

@ -729,7 +729,6 @@ function hydrate() {
}
function bindEvents() {
byId('logout-button')?.addEventListener('click', () => location.assign('/user/logout'));
byId('refresh-button')?.addEventListener('click', () => {
void loadPage(state.pagination.page, false);
});

@ -18,8 +18,6 @@ export function initialize() {
try {
state.view = 'invoice-detail';
bindInvoiceDetailCleanup();
byId('logout-button')?.addEventListener('click', () => location.assign('/user/logout'));
const invoiceId = String(document.body.dataset.invoiceId || '');
if (!/^[1-9]\d*$/.test(invoiceId)) {
throw new Error(i18n.text('billing.error.invoice_invalid'));

@ -284,7 +284,6 @@ function filtersFromForm() {
export async function initialize() {
const hydrated = hydrate();
state.pollUntil = Date.now() + 5 * 60 * 1000;
byId('logout-button')?.addEventListener('click', () => location.assign('/user/logout'));
byId('invoices-refresh')?.addEventListener('click', () => { void loadInvoices(state.page, false, true); });
byId('invoices-filter-form')?.addEventListener('submit', event => {
event.preventDefault();

@ -2368,13 +2368,11 @@ async function initializeSession(view, bootstrapUser = null) {
if (bootstrapUser && typeof bootstrapUser === 'object') {
if (bootstrapUser.authenticated === false) { location.assign('/auth/login'); return false; }
applyCloudUser(bootstrapUser);
byId('logout-button')?.addEventListener('click', () => location.assign('/user/logout'));
return true;
}
const session = await api('/api/v1/session');
if (session.authenticated === false) { location.assign('/auth/login'); return false; }
applyCloudUser(session);
byId('logout-button')?.addEventListener('click', () => location.assign('/user/logout'));
return true;
}

@ -230,7 +230,6 @@ async function deleteKey(button) {
export function initialize() {
try {
readBootstrap();
byId('logout-button')?.addEventListener('click', () => location.assign('/user/logout'));
byId('ssh-key-form')?.addEventListener('submit', addKey);
byId('ssh-keys-list')?.addEventListener('click', event => {
const button = event.target instanceof Element

@ -170,7 +170,7 @@ tbody tr:hover{background:#fcfefe}
@media(max-width:510px){.topbar{padding:0 17px}.content{padding:25px 14px}.page-heading{padding:0 3px}.overview-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.stat-card{padding:13px 11px;min-height:112px}.stat-card>strong{font-size:23px}.stat-icon{display:none}.topbar-right{gap:4px}.topbar-user{font-size:11px}.breadcrumb{font-size:11px}.modal-backdrop{padding:10px}.modal-header,.modal-body{padding-left:19px;padding-right:19px}.modal-footer{padding:14px 19px}.form-grid{gap:15px 10px}.console-backdrop{padding:0}.console-modal{height:100vh;max-height:100vh;border-radius:0}.console-stage{flex:1;height:auto}.console-tools .button{display:none}.console-password{flex-wrap:wrap}.console-password input{flex:1;min-width:130px}}
@media(max-width:510px){.reinstall-confirm-row{flex-direction:row;align-items:stretch;gap:7px}.reinstall-confirm-row input{min-width:0}.reinstall-confirm-row .button{width:auto;min-width:88px;padding-inline:11px;white-space:nowrap}.field label .reinstall-confirm-current{display:flex;margin:7px 0 0}}
@media(max-width:510px){.reinstall-password-card{right:10px;bottom:10px;width:calc(100vw - 20px);padding:15px}.reinstall-password-card-value{grid-template-columns:1fr auto}.reinstall-password-card-value>span{grid-column:1/-1}.reinstall-password-card-value code{grid-column:1}.reinstall-password-card-value .button{grid-column:2;grid-row:2}.reinstall-password-card-actions{justify-content:stretch}.reinstall-password-card-actions .button{flex:1;text-align:center}}
@media(max-width:510px){.topbar-right{flex-wrap:nowrap;justify-content:flex-end;gap:5px;min-width:0}.topbar-user{min-width:0}.topbar-user #current-username{display:block;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar-user .avatar{display:none}.topbar-right #logout-button{font-size:10px;padding:5px;min-height:28px}.breadcrumb{white-space:nowrap}.breadcrumb span{padding:0 5px}.update-versions{grid-template-columns:1fr}}
@media(max-width:510px){.topbar-right{flex-wrap:nowrap;justify-content:flex-end;gap:5px;min-width:0}.topbar-user{min-width:0}.topbar-user #current-username{display:block;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.topbar-user .avatar{display:none}.breadcrumb{white-space:nowrap}.breadcrumb span{padding:0 5px}.update-versions{grid-template-columns:1fr}}
@media(max-width:510px){.create-source-picker,.cloud-fields>.form-grid{grid-template-columns:1fr}}
@media(max-width:510px){.template-catalog{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.template-family-selected-mark{top:8px;right:8px;width:20px;height:20px;font-size:11px}.template-family-summary{min-height:140px;padding:13px 8px 10px}.template-family-icon{width:50px;height:50px;font-size:25px}.template-family-footer{min-height:24px}.template-family-selection{max-width:calc(100% - 18px);font-size:10px}.template-versions{padding:8px}.template-version-option{padding:9px 8px}.template-admin-row{grid-template-columns:1fr}.template-admin-row .button{justify-self:start}}
@media(max-width:510px){.workspace-form-body{padding:22px 19px 25px}.workspace-form-actions{padding:15px 19px}.workspace-form-actions .button{flex:1 1 100%}.workspace-form-back{margin-bottom:10px}}

@ -1,2 +1,2 @@
{* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *}
{assign var=venix_asset_version value='2026110712' scope='global'}
{assign var=venix_asset_version value='2026110713' scope='global'}

@ -28,11 +28,6 @@
<button type="button" role="menuitem" data-account-drawer-open="promotion" data-drawer-title="{user_copy key='common.shell.account.promotion'}" data-drawer-description="{user_copy key='common.shell.account.promotion.description'}"><i class="mdi mdi-account-multiple-plus-outline" aria-hidden="true"></i><span{user_copy_binding key='common.shell.account.promotion'}>{user_copy key='common.shell.account.promotion'}</span></button>
</div>
</details>
{if $panel_cloud_mode}
<button id="logout-button" class="button button-ghost small" type="button"{user_copy_binding key='common.shell.nav.logout'}>{user_copy key='common.shell.nav.logout'}</button>
{else}
<a class="button button-ghost small panel-topbar-logout" href="/user/logout"{user_copy_binding key='common.shell.nav.logout'}>{user_copy key='common.shell.nav.logout'}</a>
{/if}
</div>
</header>
{include file='user/dialog.tpl'}

@ -15,7 +15,7 @@ $assert = static function (bool $condition, string $message): void {
};
$assert(is_string($assets)
&& str_contains($assets, "venix_asset_version value='2026110712'")
&& str_contains($assets, "venix_asset_version value='2026110713'")
&& is_string($cloudShell)
&& str_contains($cloudShell, '/cloud/app.js?v={$venix_asset_version}'),
'The cloud application entry must use the shared Venix asset version.');

@ -144,7 +144,12 @@ $assert(str_contains($userLayout, '/cloud/client.css'), 'Account pages must load
$assert(str_contains($sharedSidebar, 'mdi-server') && str_contains($sharedSidebar, 'mdi-lifebuoy'), 'Shared sidebar must retain Venix iconography');
$assert(str_contains($clientStyles, '.cloud-sidebar-nav .sidebar-link + .sidebar-link { margin-top: 6px; }'),
'Adjacent sidebar links must retain visual separation when active and hover states meet');
$assert(str_contains($sharedSidebar, '/user/logout') && !str_contains($clientScript, "location.assign('/auth/logout')"), 'Logged-in logout must use the authenticated user route');
$assert(str_contains($sharedSidebar, '/user/logout')
&& !str_contains($sharedTopbar, 'logout-button')
&& !str_contains($sharedTopbar, 'panel-topbar-logout')
&& !str_contains($clientScript, 'logout-button')
&& !str_contains($clientScript, "location.assign('/auth/logout')"),
'Logged-in logout must remain in the sidebar without a duplicate topbar control or dead listener');
$retiredUserPages = [
'/account' => 'index',
'/profile' => 'profile',

Loading…
Cancel
Save