JSFiddle - React, Tailwind, and code Playground
by ktabarez
JavaScript
/*AppMon
WinSerMon
Write an api that keeps track of when things should run code named appmon
-keep track of
-app name
-app instanceid
-app OS and OS version
-where the app is running (ip, machine name)
-the first time the app ran
-the last time the app ran
-the next run date
-the first time the app was installed on the machine
-if the app is alive
-if the app is executing business logic
-the date the app started executing business logic
-the date the app finished executing business logic
-the app schedule
-when should the app run?
-the time the app should wait untill app executes business logic. The interval will be in minutes
-create a .appmon json config file containin application id and instanceid
*/
public sealed class AppMon
{
private static readonly Lazy<AppMon> lazy =
new Lazy<AppMon>(() => new AppMon());
public static AppMon Instance { get { return lazy.Value; } }
private Os _OperatingSystem {get; set;}
private Machine _Machine {get;set;}
public ApplicationSchedule AppSchedule {get; private set;}
private Application _Application {get;set;}
private ApplicationInstance _AppInstance {get;set;}
public ApplicationSchedule _AppSchedule {get;set;}
private AppMon()
{
}
public RegisterApp()
{
//webclient post OperatingSystem
_OperatingSystem = new Os
{
Name = OSInfo.Name,
Edition = OSInfo.Edition,
ServicePack = OSInfo.ServicePack
Version = OSInfo.VersionString,
Bits = OSInfo.Bits
KeyId = String.Format("{0};{1};{2};{3};{4},", OSInfo.Name, OSInfo.Edition, OSInfo.Servicepack, OSInfo.Version, OSInfo.Bits)
};
_Machine = new Machine
{
Owner = _OperatingSystem.Owner,
Name = Environment.MachineName,
//http://stackoverflow.com/questions/4778886/how-can-i-get-computer-name-and-ip-address-of-local-computer
IpV4 = Dns.GetHostAddresses(Environment.MachineName)[0].ToString(),
};
//_Application = use the api to get...