-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d54452
commit bc1c6bd
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
FlowPluginsTs/CommunityFlowPlugins/tools/pauseUnpauseAllNodes/1.0.0/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}; |