parent
0d54452726
commit
bc1c6bd317
@ -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,
|
||||||
|
};
|
||||||
Loading…
Reference in new issue