added is os flow elements

This commit is contained in:
John Andrews
2024-07-06 11:04:13 +12:00
parent 98c194b462
commit 59b4959a86
7 changed files with 141 additions and 0 deletions

View 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;
}

View 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;
}

View 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;
}

View 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;
}

View File

@@ -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.