This commit is contained in:
@@ -136,6 +136,31 @@ function wireVaultActions() {
|
||||
if (button) button.addEventListener('click', saveDemoVault);
|
||||
}
|
||||
|
||||
async function loadAppConfig() {
|
||||
return invokeOrFallback('load_app_config', { theme_id: 'rabby-light', restore_workspace: true, profiles: [], shortcuts: [] });
|
||||
}
|
||||
|
||||
async function saveSettings() {
|
||||
const theme = document.getElementById('theme-select').value;
|
||||
const output = document.getElementById('settings-status');
|
||||
output.textContent = 'Saving settings…';
|
||||
try {
|
||||
const tauri = window.__TAURI__?.core;
|
||||
if (!tauri) throw new Error('Tauri bridge unavailable in browser preview');
|
||||
const config = await loadAppConfig();
|
||||
config.theme_id = theme;
|
||||
const saved = await tauri.invoke('save_app_config', { config, path: null });
|
||||
output.textContent = `Saved ${saved.theme_id}`;
|
||||
} catch (error) {
|
||||
output.textContent = String(error);
|
||||
}
|
||||
}
|
||||
|
||||
function wireSettingsActions() {
|
||||
const button = document.getElementById('save-settings');
|
||||
if (button) button.addEventListener('click', saveSettings);
|
||||
}
|
||||
|
||||
async function runLocalTerminalCommand() {
|
||||
const command = document.getElementById('terminal-command').value;
|
||||
const output = document.getElementById('terminal-output');
|
||||
@@ -168,6 +193,7 @@ async function boot() {
|
||||
renderDashboard(dashboard);
|
||||
renderFeatures(features);
|
||||
wireVaultActions();
|
||||
wireSettingsActions();
|
||||
wireTerminalActions();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user