group commands

This commit is contained in:
Jan Prochazka
2021-03-15 21:06:15 +01:00
parent d4a35fb414
commit 321d5d71de
9 changed files with 49 additions and 28 deletions

View File

@@ -90,15 +90,3 @@ commands.subscribe(value => {
}
});
export const getCommands = () => commandsValue;
export function runCommand(id) {
const command = commandsValue[id];
if (command) {
if (command.isGroupCommand) {
const values = Object.values(commandsValue) as GlobalCommand[];
const real = values.find(x => x.group == command.group && !x.isGroupCommand && x.enabled);
if (real && real.onClick) real.onClick();
}
command.onClick();
}
}
window['dbgate_runCommand'] = runCommand;