From 902c1f79447ccd469af8663ddfa53967e271e290 Mon Sep 17 00:00:00 2001 From: jelveh Date: Wed, 10 Dec 2025 20:10:01 -0800 Subject: [PATCH] Add save account warning for temporary users --- src/gui/src/UI/Dashboard/TabHome.js | 30 ++++++++++++++++++++++++++- src/gui/src/css/style.css | 32 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/src/gui/src/UI/Dashboard/TabHome.js b/src/gui/src/UI/Dashboard/TabHome.js index 3813f478c..7b7eb413c 100644 --- a/src/gui/src/UI/Dashboard/TabHome.js +++ b/src/gui/src/UI/Dashboard/TabHome.js @@ -17,6 +17,8 @@ * along with this program. If not, see . */ +import UIWindowSaveAccount from '../UIWindowSaveAccount.js'; + function getTimeGreeting () { const hour = new Date().getHours(); if ( hour < 12 ) return 'Good morning'; @@ -132,8 +134,15 @@ const TabHome = { h += `
`; h += `
`; h += `${greeting},`; - h += `

${html_encode(username)}

`; + h += `

${html_encode(username)}

`; h += '

Your personal cloud computer

'; + // Show warning if account is temporary/unsaved + if ( window.user?.is_temp ) { + h += ''; + } h += '
'; h += ''; h += ''; @@ -207,6 +216,25 @@ const TabHome = { $el_window.find(`.dashboard-sidebar-item[data-section="${targetTab}"]`).click(); } }); + + // Handle "Save Account" warning click + $el_window.on('click', '.bento-save-account-warning', function (e) { + e.preventDefault(); + e.stopPropagation(); + UIWindowSaveAccount({ + window_options: { + backdrop: true, + close_on_backdrop_click: true, + parent_center: true, + stay_on_top: true, + has_head: false, + }, + }).then(function (is_saved) { + if ( is_saved ) { + $el_window.find('.bento-save-account-warning').hide(); + } + }); + }); }, async loadRecentApps ($el_window) { diff --git a/src/gui/src/css/style.css b/src/gui/src/css/style.css index 98d1c1d72..090cbd210 100644 --- a/src/gui/src/css/style.css +++ b/src/gui/src/css/style.css @@ -5952,6 +5952,38 @@ html.dark-mode .usage-table-show-less:hover { font-weight: 400; } +.bento-save-account-warning { + display: inline-flex; + align-items: center; + gap: 6px; + margin-top: 12px; + padding: 8px 14px; + background-color: #fef3c7; + border: 1px solid #f59e0b; + border-radius: 8px; + color: #92400e; + font-size: 13px; + font-weight: 500; + cursor: pointer; + text-decoration: none; + transition: all 0.15s ease; +} + +.bento-save-account-warning:hover { + background-color: #fde68a; + border-color: #d97706; + color: #78350f; +} + +.bento-save-account-warning svg { + flex-shrink: 0; + color: #f59e0b; +} + +.bento-save-account-warning:hover svg { + color: #d97706; +} + /* Recent Apps Card - Rectangle */ .bento-recent { min-height: 310px;