feat: verbose toggle, info tab, many misc fixes
This commit is contained in:
@ -193,8 +193,17 @@ export const usePkgStore = defineStore('pkg', {
|
||||
pkg.js.busy = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//if (rv === 'Deferred') { /* download progress */ }
|
||||
async installFromKey(key: string) {
|
||||
try {
|
||||
await invoke('install_package', {
|
||||
key,
|
||||
force: true,
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
},
|
||||
|
||||
async updateAll() {
|
||||
@ -346,6 +355,7 @@ export const useClientStore = defineStore('client', () => {
|
||||
|
||||
const offlineMode = ref(false);
|
||||
const enableAutoupdates = ref(true);
|
||||
const verbose = ref(false);
|
||||
|
||||
const scaleValue = (value: ScaleType) =>
|
||||
value === 's' ? 1 : value === 'm' ? 1.25 : value === 'l' ? 1.5 : 2;
|
||||
@ -401,11 +411,15 @@ export const useClientStore = defineStore('client', () => {
|
||||
}
|
||||
|
||||
offlineMode.value = await invoke('get_global_config', {
|
||||
field: 'OfflineMode',
|
||||
field: 'offline_mode',
|
||||
});
|
||||
|
||||
enableAutoupdates.value = await invoke('get_global_config', {
|
||||
field: 'EnableAutoupdates',
|
||||
field: 'enable_autoupdates',
|
||||
});
|
||||
|
||||
verbose.value = await invoke('get_global_config', {
|
||||
field: 'verbose',
|
||||
});
|
||||
};
|
||||
|
||||
@ -438,17 +452,22 @@ export const useClientStore = defineStore('client', () => {
|
||||
|
||||
const setOfflineMode = async (value: boolean) => {
|
||||
offlineMode.value = value;
|
||||
await invoke('set_global_config', { field: 'OfflineMode', value });
|
||||
await invoke('set_global_config', { field: 'offline_mode', value });
|
||||
};
|
||||
|
||||
const setAutoupdates = async (value: boolean) => {
|
||||
enableAutoupdates.value = value;
|
||||
await invoke('set_global_config', {
|
||||
field: 'EnableAutoupdates',
|
||||
field: 'enable_autoupdates',
|
||||
value,
|
||||
});
|
||||
};
|
||||
|
||||
const setVerbose = async (value: boolean) => {
|
||||
verbose.value = value;
|
||||
await invoke('set_global_config', { field: 'verbose', value });
|
||||
};
|
||||
|
||||
getCurrentWindow().onResized(async ({ payload }) => {
|
||||
// For whatever reason this is 0 when minimized
|
||||
if (payload.width > 0) {
|
||||
@ -460,6 +479,7 @@ export const useClientStore = defineStore('client', () => {
|
||||
scaleFactor,
|
||||
offlineMode,
|
||||
enableAutoupdates,
|
||||
verbose,
|
||||
timeout,
|
||||
scaleModel,
|
||||
load,
|
||||
@ -467,5 +487,6 @@ export const useClientStore = defineStore('client', () => {
|
||||
queueSave,
|
||||
setOfflineMode,
|
||||
setAutoupdates,
|
||||
setVerbose,
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user