add restart controller to context menu

This commit is contained in:
sawka 2024-08-30 14:01:48 -07:00
parent 74f551b212
commit 8aa4025907

View File

@ -36,7 +36,7 @@ function handleHeaderContextMenu(
e.stopPropagation(); e.stopPropagation();
let menu: ContextMenuItem[] = [ let menu: ContextMenuItem[] = [
{ {
label: magnified ? "Un-magnify Block" : "Magnify Block", label: magnified ? "Un-Magnify Block" : "Magnify Block",
click: () => { click: () => {
onMagnifyToggle(); onMagnifyToggle();
}, },
@ -60,6 +60,14 @@ function handleHeaderContextMenu(
}, },
}, },
]; ];
const blockController = blockData?.meta?.controller;
if (!util.isBlank(blockController)) {
menu.push({ type: "separator" });
menu.push({
label: "Restart Controller",
click: () => WshServer.ControllerRestartCommand({ blockid: blockData.oid }),
});
}
const extraItems = viewModel?.getSettingsMenuItems?.(); const extraItems = viewModel?.getSettingsMenuItems?.();
if (extraItems && extraItems.length > 0) menu.push({ type: "separator" }, ...extraItems); if (extraItems && extraItems.length > 0) menu.push({ type: "separator" }, ...extraItems);
menu.push( menu.push(