Skip to content

Commit

Permalink
Pause/Unpause All Nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
HaveAGitGat committed May 9, 2024
1 parent 0d54452 commit bc1c6bd
Showing 1 changed file with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import {
IpluginDetails,
IpluginInputArgs,
IpluginOutputArgs,
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';

/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
const details = (): IpluginDetails => ({
name: 'Pause/Unpause All Nodes',
description: `
Pause/Unpause All Nodes
`,
style: {
borderColor: 'yellow',
},
tags: '',
isStartPlugin: false,
pType: '',
requiresVersion: '2.11.01',
sidebarPosition: -1,
icon: 'faHand',
inputs: [
{
label: 'Pause?',
name: 'pause',
type: 'boolean',
defaultValue: 'false',
inputUI: {
type: 'switch',
},
tooltip: 'Specify whether to pause or unpause all nodes',
},
],
outputs: [
{
number: 1,
tooltip: 'Continue to next plugin',
},
],
});

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
const lib = require('../../../../../methods/lib')();
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
args.inputs = lib.loadDefaultValues(args.inputs, details);

const { pause } = args.inputs;

await args.deps.crudTransDBN('SettingsGlobalJSONDB', 'update', 'globalsettings', {
pauseAllNodes: pause,
});

return {
outputFileObj: args.inputFileObj,
outputNumber: 1,
variables: args.variables,
};
};
export {
details,
plugin,
};

0 comments on commit bc1c6bd

Please sign in to comment.