mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 19:36:00 +00:00
app commands works
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
import _ from 'lodash';
|
||||
import { filterName } from 'dbgate-tools';
|
||||
|
||||
import { currentApplication } from '../stores';
|
||||
import { currentApplication, currentDatabase } from '../stores';
|
||||
|
||||
import AppObjectCore from './AppObjectCore.svelte';
|
||||
import { showModal } from '../modals/modalTools';
|
||||
@@ -45,10 +45,25 @@
|
||||
});
|
||||
};
|
||||
|
||||
function setOnCurrentDb(value) {
|
||||
apiCall('connections/update-database', {
|
||||
conid: $currentDatabase?.connection?._id,
|
||||
database: $currentDatabase?.name,
|
||||
values: {
|
||||
[`useApp:${data.name}`]: value,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function createMenu() {
|
||||
return [
|
||||
{ text: 'Delete', onClick: handleDelete },
|
||||
{ text: 'Rename', onClick: handleRename },
|
||||
|
||||
$currentDatabase && [
|
||||
{ text: 'Enable on current database', onClick: () => setOnCurrentDb(true) },
|
||||
{ text: 'Disable on current database', onClick: () => setOnCurrentDb(false) },
|
||||
],
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user