mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 06:36:00 +00:00
reset settings command
This commit is contained in:
@@ -41,6 +41,8 @@ import { disconnectServerConnection } from '../appobj/ConnectionAppObject.svelte
|
||||
import UploadErrorModal from '../modals/UploadErrorModal.svelte';
|
||||
import ErrorMessageModal from '../modals/ErrorMessageModal.svelte';
|
||||
import NewCollectionModal from '../modals/NewCollectionModal.svelte';
|
||||
import ConfirmModal from '../modals/ConfirmModal.svelte';
|
||||
import localforage from 'localforage';
|
||||
|
||||
// function themeCommand(theme: ThemeDefinition) {
|
||||
// return {
|
||||
@@ -451,6 +453,28 @@ registerCommand({
|
||||
onClick: () => electron.showItemInFolder(getCurrentConfig().connectionsFilePath),
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'app.resetSettings',
|
||||
category: 'File',
|
||||
name: 'Reset layout data & settings',
|
||||
testEnabled: () => true,
|
||||
onClick: () => {
|
||||
showModal(ConfirmModal, {
|
||||
message: `Really reset layout data? All opened tabs, settings and layout data will be lost. Connections and saved files will be preserved. After this, restart DbGate for applying changes.`,
|
||||
onConfirm: async () => {
|
||||
await apiCall('config/delete-settings');
|
||||
localStorage.clear();
|
||||
await localforage.clear();
|
||||
if (getElectron()) {
|
||||
getElectron().send('reset-settings');
|
||||
} else {
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'file.import',
|
||||
category: 'File',
|
||||
|
||||
Reference in New Issue
Block a user