private _buildCommands()

in desktop/src/app/components/node/action/node-commands.ts [42:115]


    private _buildCommands() {
        this.connect = this.simpleCommand({
            name: "connect",
            ...COMMAND_LABEL_ICON.ConnectToNode,
            action: (node) => this._connect(node),
            multiple: false,
            confirm: false,
            notify: false,
            permission: Permission.Write,
        });

        this.delete = this.simpleCommand({
            name: "delete",
            ...COMMAND_LABEL_ICON.Delete,
            action: (node: Node) => this._delete(node),
            permission: Permission.Write,
            multiple: (nodes: Node[]) => this._deleteMultiple(nodes),
        });

        this.reboot = this.simpleCommand({
            name: "reboot",
            ...COMMAND_LABEL_ICON.RebootNode,
            action: (node: Node) => this._reboot(node),
            permission: Permission.Write,
        });

        this.reimage = this.simpleCommand({
            name: "reimage",
            icon: "fa fa-hdd-o",
            label: "Reimage",
            action: (node: Node) => this._reimage(node),
            permission: Permission.Write,
        });

        this.disableScheduling = this.simpleCommand({
            name: "disableScheduling",
            label: "Disable scheduling",
            icon: "fa fa-stop",
            visible: (node: Node) => node.schedulingState === NodeSchedulingState.Enabled,
            enabled: (node: Node) => node.schedulingState === NodeSchedulingState.Enabled,
            action: (node: Node) => this._disableScheduling(node),
            permission: Permission.Write,
        });

        this.enableScheduling = this.simpleCommand({
            name: "enableScheduling",
            label: "Re-enable scheduling",
            icon: "fa fa-play",
            visible: (node: Node) => node.schedulingState === NodeSchedulingState.Disabled,
            enabled: (node: Node) => node.schedulingState === NodeSchedulingState.Disabled,
            action: (node: Node) => this._enableScheduling(node),
            permission: Permission.Write,
        });

        this.editStartTask = this.simpleCommand({
            name: "editStartTask",
            ...COMMAND_LABEL_ICON.EditStartTask,
            action: (node) => this._editStartTask(node),
            multiple: false,
            confirm: false,
            notify: false,
            permission: Permission.Write,
        });

        this.commands = [
            this.connect,
            this.delete,
            this.reboot,
            this.reimage,
            this.disableScheduling,
            this.enableScheduling,
            this.editStartTask,
        ];
    }