mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-21 09:30:03 -06:00
added is os flow elements
This commit is contained in:
28
BasicNodes/SystemElements/IsDocker.cs
Normal file
28
BasicNodes/SystemElements/IsDocker.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using FileFlows.Plugin;
|
||||
|
||||
namespace FileFlows.BasicNodes.SystemElements;
|
||||
|
||||
/// <summary>
|
||||
/// A flow to determine if this is running on Docker or not
|
||||
/// </summary>
|
||||
public class IsDocker : Node
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override int Inputs => 1;
|
||||
/// <inheritdoc />
|
||||
public override int Outputs => 2;
|
||||
/// <inheritdoc />
|
||||
public override FlowElementType Type => FlowElementType.Logic;
|
||||
/// <inheritdoc />
|
||||
public override string Group => "System";
|
||||
/// <inheritdoc />
|
||||
public override string Icon => "fab fa-docker";
|
||||
/// <inheritdoc />
|
||||
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/system/is-docker";
|
||||
/// <inheritdoc />
|
||||
public override string CustomColor => "#2481e4";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int Execute(NodeParameters args)
|
||||
=> args.IsDocker ? 1 : 2;
|
||||
}
|
||||
28
BasicNodes/SystemElements/IsLinux.cs
Normal file
28
BasicNodes/SystemElements/IsLinux.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using FileFlows.Plugin;
|
||||
|
||||
namespace FileFlows.BasicNodes.SystemElements;
|
||||
|
||||
/// <summary>
|
||||
/// A flow to determine if this is running on Linux or not
|
||||
/// </summary>
|
||||
public class IsLinux : Node
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override int Inputs => 1;
|
||||
/// <inheritdoc />
|
||||
public override int Outputs => 2;
|
||||
/// <inheritdoc />
|
||||
public override FlowElementType Type => FlowElementType.Logic;
|
||||
/// <inheritdoc />
|
||||
public override string Group => "System";
|
||||
/// <inheritdoc />
|
||||
public override string Icon => "fab fa-linux";
|
||||
/// <inheritdoc />
|
||||
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/system/is-linux";
|
||||
/// <inheritdoc />
|
||||
public override string CustomColor => "#2481e4";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int Execute(NodeParameters args)
|
||||
=> args.IsDocker == false && OperatingSystem.IsLinux() ? 1 : 2;
|
||||
}
|
||||
28
BasicNodes/SystemElements/IsMacOS.cs
Normal file
28
BasicNodes/SystemElements/IsMacOS.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using FileFlows.Plugin;
|
||||
|
||||
namespace FileFlows.BasicNodes.SystemElements;
|
||||
|
||||
/// <summary>
|
||||
/// A flow to determine if this is running on MacOS or not
|
||||
/// </summary>
|
||||
public class IsMacOS : Node
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override int Inputs => 1;
|
||||
/// <inheritdoc />
|
||||
public override int Outputs => 2;
|
||||
/// <inheritdoc />
|
||||
public override FlowElementType Type => FlowElementType.Logic;
|
||||
/// <inheritdoc />
|
||||
public override string Group => "System";
|
||||
/// <inheritdoc />
|
||||
public override string Icon => "fab fa-apple";
|
||||
/// <inheritdoc />
|
||||
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/system/is-mac-os";
|
||||
/// <inheritdoc />
|
||||
public override string CustomColor => "#2481e4";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int Execute(NodeParameters args)
|
||||
=> OperatingSystem.IsMacOS() ? 1 : 2;
|
||||
}
|
||||
28
BasicNodes/SystemElements/IsWindows.cs
Normal file
28
BasicNodes/SystemElements/IsWindows.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using FileFlows.Plugin;
|
||||
|
||||
namespace FileFlows.BasicNodes.SystemElements;
|
||||
|
||||
/// <summary>
|
||||
/// A flow to determine if this is running on windows or not
|
||||
/// </summary>
|
||||
public class IsWindows : Node
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override int Inputs => 1;
|
||||
/// <inheritdoc />
|
||||
public override int Outputs => 2;
|
||||
/// <inheritdoc />
|
||||
public override FlowElementType Type => FlowElementType.Logic;
|
||||
/// <inheritdoc />
|
||||
public override string Group => "System";
|
||||
/// <inheritdoc />
|
||||
public override string Icon => "fab fa-windows";
|
||||
/// <inheritdoc />
|
||||
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/system/is-windows";
|
||||
/// <inheritdoc />
|
||||
public override string CustomColor => "#2481e4";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int Execute(NodeParameters args)
|
||||
=> OperatingSystem.IsWindows() ? 1 : 2;
|
||||
}
|
||||
@@ -220,6 +220,35 @@
|
||||
"2": "Is not processing on node"
|
||||
}
|
||||
},
|
||||
"IsDocker": {
|
||||
"Description": "Determines if this flow is running on Docker",
|
||||
"Outputs": {
|
||||
"1": "Is running on Docker",
|
||||
"2": "Is not running on Docker"
|
||||
}
|
||||
},
|
||||
"IsLinux": {
|
||||
"Description": "Determines if this flow is running on Linux",
|
||||
"Outputs": {
|
||||
"1": "Is running on Linux",
|
||||
"2": "Is not running on Linux"
|
||||
}
|
||||
},
|
||||
"IsMacOS": {
|
||||
"Label": "Is MacOS",
|
||||
"Description": "Determines if this flow is running on MacOS",
|
||||
"Outputs": {
|
||||
"1": "Is running on MacOS",
|
||||
"2": "Is not running on MacOS"
|
||||
}
|
||||
},
|
||||
"IsWindows": {
|
||||
"Description": "Determines if this flow is running on Windows",
|
||||
"Outputs": {
|
||||
"1": "Is running on Windows",
|
||||
"2": "Is not running on Windows"
|
||||
}
|
||||
},
|
||||
"Log": {
|
||||
"Description": "Logs a message to the flow log",
|
||||
"Outputs": {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user