Skip to content

Commit

Permalink
Merge pull request #751 from skadefro/master
Browse files Browse the repository at this point in the history
minor updates as prep for 1.5
  • Loading branch information
skadefro authored Mar 1, 2023
2 parents 487d943 + 38554a9 commit eff9277
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 127 deletions.
60 changes: 30 additions & 30 deletions OpenRPA.PS/NodeRED/AddNoderedInstance.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenRPA.Interfaces;
using System.Management.Automation;
using Newtonsoft.Json.Linq;
using System.Collections.ObjectModel;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using OpenRPA.Interfaces;
//using System.Management.Automation;
//using Newtonsoft.Json.Linq;
//using System.Collections.ObjectModel;

namespace OpenRPA.PS
{
[Cmdlet(VerbsCommon.Add, "NoderedInstance")]
public class AddNoderedInstance : OpenRPACmdlet
{
[Parameter(Position = 0, ValueFromPipeline = true)] public string _id { get; set; }
protected override async Task ProcessRecordAsync()
{
try
{
string traceId = ""; string spanId = "";
if (string.IsNullOrEmpty(_id)) { _id = global.webSocketClient.user._id; }
await global.webSocketClient.EnsureNoderedInstance(_id, traceId, spanId);
}
catch (Exception ex)
{
WriteError(new ErrorRecord(ex, "", ErrorCategory.NotSpecified, null));
}
//namespace OpenRPA.PS
//{
// [Cmdlet(VerbsCommon.Add, "NoderedInstance")]
// public class AddNoderedInstance : OpenRPACmdlet
// {
// [Parameter(Position = 0, ValueFromPipeline = true)] public string _id { get; set; }
// protected override async Task ProcessRecordAsync()
// {
// try
// {
// string traceId = ""; string spanId = "";
// if (string.IsNullOrEmpty(_id)) { _id = global.webSocketClient.user._id; }
// await global.webSocketClient.EnsureNoderedInstance(_id, traceId, spanId);
// }
// catch (Exception ex)
// {
// WriteError(new ErrorRecord(ex, "", ErrorCategory.NotSpecified, null));
// }


}
}
}
// }
// }
//}
100 changes: 50 additions & 50 deletions OpenRPA.PS/NodeRED/GetNoderedInstance.cs
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenRPA.Interfaces;
using System.Management.Automation;
using Newtonsoft.Json.Linq;
using System.Collections.ObjectModel;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using OpenRPA.Interfaces;
//using System.Management.Automation;
//using Newtonsoft.Json.Linq;
//using System.Collections.ObjectModel;

namespace OpenRPA.PS
{
[Cmdlet(VerbsCommon.Get, "NoderedInstance")]
public class GetNoderedInstance : OpenRPACmdlet
{
[Parameter(Position = 0, ValueFromPipeline = true)] public string _id { get; set; }
[Parameter(Position = 1)] public int Minutes { get; set; }
protected override async Task ProcessRecordAsync()
{
try
{
if (Minutes < 1) Minutes = 1;
// string dt = DateTime.UtcNow.AddMinutes(Minutes).ToString("o", System.Globalization.CultureInfo.InvariantCulture);
string dt = DateTime.UtcNow.AddMinutes(-Minutes).ToString("yyyy-MM-dd'T'HH:mm:ss.fffK", System.Globalization.CultureInfo.InvariantCulture);
string json = "{\"_type\":\"user\", \"_noderedheartbeat\": { \"$gte\": \"" + dt + "\" } }";
if (!string.IsNullOrEmpty(_id)) { json = "{\"_type\":\"user\", \"_id\": \"" + _id + "\"}"; }
var entities = await global.webSocketClient.Query<JObject>("users", json, top: 100);
int index = 0;
foreach (var entity in entities)
{
if (entity.ContainsKey("name"))
{
WriteVerbose("Parsing " + entity.Value<string>("_id") + " " + entity.Value<string>("name"));
}
else
{
WriteVerbose("Parsing " + entity.Value<string>("_id"));
}
// results.Add(obj);
WriteObject(entity.toPSObjectWithTypeName("users"));
index++;
if (index % 10 == 9) await Task.Delay(1);
}
//namespace OpenRPA.PS
//{
// [Cmdlet(VerbsCommon.Get, "NoderedInstance")]
// public class GetNoderedInstance : OpenRPACmdlet
// {
// [Parameter(Position = 0, ValueFromPipeline = true)] public string _id { get; set; }
// [Parameter(Position = 1)] public int Minutes { get; set; }
// protected override async Task ProcessRecordAsync()
// {
// try
// {
// if (Minutes < 1) Minutes = 1;
// // string dt = DateTime.UtcNow.AddMinutes(Minutes).ToString("o", System.Globalization.CultureInfo.InvariantCulture);
// string dt = DateTime.UtcNow.AddMinutes(-Minutes).ToString("yyyy-MM-dd'T'HH:mm:ss.fffK", System.Globalization.CultureInfo.InvariantCulture);
// string json = "{\"_type\":\"user\", \"_noderedheartbeat\": { \"$gte\": \"" + dt + "\" } }";
// if (!string.IsNullOrEmpty(_id)) { json = "{\"_type\":\"user\", \"_id\": \"" + _id + "\"}"; }
// var entities = await global.webSocketClient.Query<JObject>("users", json, top: 100);
// int index = 0;
// foreach (var entity in entities)
// {
// if (entity.ContainsKey("name"))
// {
// WriteVerbose("Parsing " + entity.Value<string>("_id") + " " + entity.Value<string>("name"));
// }
// else
// {
// WriteVerbose("Parsing " + entity.Value<string>("_id"));
// }
// // results.Add(obj);
// WriteObject(entity.toPSObjectWithTypeName("users"));
// index++;
// if (index % 10 == 9) await Task.Delay(1);
// }

}
catch (Exception ex)
{
WriteError(new ErrorRecord(ex, "", ErrorCategory.NotSpecified, null));
}
// }
// catch (Exception ex)
// {
// WriteError(new ErrorRecord(ex, "", ErrorCategory.NotSpecified, null));
// }


}
}
}
// }
// }
//}
60 changes: 30 additions & 30 deletions OpenRPA.PS/NodeRED/RemoveNoderedInstance.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenRPA.Interfaces;
using System.Management.Automation;
using Newtonsoft.Json.Linq;
using System.Collections.ObjectModel;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using OpenRPA.Interfaces;
//using System.Management.Automation;
//using Newtonsoft.Json.Linq;
//using System.Collections.ObjectModel;

namespace OpenRPA.PS
{
[Cmdlet(VerbsCommon.Remove, "NoderedInstance")]
public class RemoveNoderedInstance : OpenRPACmdlet
{
[Parameter(Position = 0, ValueFromPipeline = true)] public string _id { get; set; }
protected override async Task ProcessRecordAsync()
{
try
{
string traceId = ""; string spanId = "";
if (string.IsNullOrEmpty(_id)) { _id = global.webSocketClient.user._id; }
await global.webSocketClient.DeleteNoderedInstance(_id, "", "");
}
catch (Exception ex)
{
WriteError(new ErrorRecord(ex, "", ErrorCategory.NotSpecified, null));
}
//namespace OpenRPA.PS
//{
// [Cmdlet(VerbsCommon.Remove, "NoderedInstance")]
// public class RemoveNoderedInstance : OpenRPACmdlet
// {
// [Parameter(Position = 0, ValueFromPipeline = true)] public string _id { get; set; }
// protected override async Task ProcessRecordAsync()
// {
// try
// {
// string traceId = ""; string spanId = "";
// if (string.IsNullOrEmpty(_id)) { _id = global.webSocketClient.user._id; }
// await global.webSocketClient.DeleteNoderedInstance(_id, "", "");
// }
// catch (Exception ex)
// {
// WriteError(new ErrorRecord(ex, "", ErrorCategory.NotSpecified, null));
// }


}
}
}
// }
// }
//}
4 changes: 0 additions & 4 deletions OpenRPA/LocallyCached.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ public async Task Save<T>(bool skipOnline = false) where T : apibase
var exists = collection.FindById(_id);
if (exists != null) { collection.Update(entity); Log.Verbose("Updated in local db as version " + entity._version + " " + entity._type + " " + entity.name); }
if (exists == null) { collection.Insert(entity); Log.Verbose("Inserted in local db as version " + entity._version + " " + entity._type + " " + entity.name); }
} else
{
// WHY ????
System.Diagnostics.Debugger.Break();
}
}
finally
Expand Down
5 changes: 0 additions & 5 deletions OpenRPA/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@
<TextBlock Text="{x:Static or:strings.openflow}" />
</Hyperlink>
</RibbonGalleryItem>
<RibbonGalleryItem>
<Hyperlink x:Name="linkNodeRED" Command="{Binding Data.LinkNodeREDCommand, Source={StaticResource proxy}}" CommandParameter="{Binding}" >
<TextBlock Text="{x:Static or:strings.nodered}" />
</Hyperlink>
</RibbonGalleryItem>
<RibbonGalleryItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Static or:strings.version}" />
Expand Down
27 changes: 24 additions & 3 deletions OpenRPA/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2975,15 +2975,36 @@ private bool CanAllways(object _item)
}
private void OnOpenChromePage(object _item)
{
System.Diagnostics.Process.Start("chrome.exe", "https://chrome.google.com/webstore/detail/openrpa/hpnihnhlcnfejboocnckgchjdofeaphe");
try
{
System.Diagnostics.Process.Start("chrome.exe", "https://chrome.google.com/webstore/detail/openrpa/hpnihnhlcnfejboocnckgchjdofeaphe");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void OnOpenFirefoxPageCommand(object _item)
{
System.Diagnostics.Process.Start("firefox.exe", "https://addons.mozilla.org/en-US/firefox/addon/openrpa/");
try
{
System.Diagnostics.Process.Start("firefox.exe", "https://addons.mozilla.org/en-US/firefox/addon/openrpa/");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void OnOpenEdgePageCommand(object _item)
{
System.Diagnostics.Process.Start("msedge.exe", "https://chrome.google.com/webstore/detail/openrpa/hpnihnhlcnfejboocnckgchjdofeaphe");
try
{
System.Diagnostics.Process.Start("msedge.exe", "https://chrome.google.com/webstore/detail/openrpa/hpnihnhlcnfejboocnckgchjdofeaphe");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

private int lastsapprocessid = -1;
Expand Down
2 changes: 1 addition & 1 deletion OpenRPA/OpenRPA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Description>Base UI of OpenRPA, used as part of OpenRPA robot</Description>
<PackageLicenseExpression>MPL-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/open-rpa/openrpa</PackageProjectUrl>
<Version>1.4.50</Version>
<Version>1.4.51</Version>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageIcon>openrpa.png</PackageIcon>
<Configurations>Debug;Release;ReleaseNuget;PrepInstaller</Configurations>
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ Open Source Robotic Process Automation Software

Download and try it out here [💾here](https://github.com/open-rpa/openrpa/releases/latest/download/OpenRPA.msi) and manage your [🔧OpenFlow account here](https://app.openiap.io)

Join our [🤷💻🤦 Community Forum](https://bb.openiap.io/) for for help or giving feedback
Join our [🤷💻🤦 Community Forum](discourse.openiap.io/) for for help or giving feedback

Join our [💬 community](https://rocket.openiap.io/) for for help or giving feedback

Click here for [💲🤷Commercial Support](https://openrpa.dk/)
Click here for [💲🤷Commercial Support](https://openiap.io/)

Check out the [📘documentation](https://docs.openiap.io/) or knows issue and updated documentation on our [❔wiki pages](https://github.com/open-rpa/openrpa/wiki)

Expand Down

0 comments on commit eff9277

Please sign in to comment.