You've already forked onecmonitor
mirror of
https://github.com/akpaevj/onecmonitor.git
synced 2025-11-25 22:22:15 +02:00
Добавлен слой интеграции с OScript
This commit is contained in:
29
oneswiss-oscript-integration/Oscript/CrServerWrapper.cs
Normal file
29
oneswiss-oscript-integration/Oscript/CrServerWrapper.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using OneScript.Contexts;
|
||||
using OneScript.StandardLibrary.Collections;
|
||||
using OneScript.Values;
|
||||
using OneSwiss.V8.Platform.Services;
|
||||
using ScriptEngine.Machine.Contexts;
|
||||
|
||||
namespace OneSwiss.OneScript.Oscript;
|
||||
|
||||
[ContextClass("СлужбаCrServer", "CrServerService")]
|
||||
public class CrServerWrapper(CrServer service) : AutoContext<CrServerWrapper>
|
||||
{
|
||||
[ContextProperty("Имя", "Name", CanWrite = false)]
|
||||
public string Name => service.Name;
|
||||
|
||||
[ContextProperty("Запущена", "IsActive", CanWrite = false)]
|
||||
public bool IsActive => service.IsActive;
|
||||
|
||||
[ContextProperty("Порт", "Port", CanWrite = false)]
|
||||
public int Port { get; set; }
|
||||
|
||||
[ContextProperty("Каталог", "Directory", CanWrite = false)]
|
||||
public string Directory { get; set; } = null!;
|
||||
|
||||
[ContextProperty("Платформа", "Platform", CanWrite = false)]
|
||||
public V8PlatformWrapper Platform { get; } = new(service.Platform);
|
||||
|
||||
[ContextProperty("Хранилища", "Repositories", CanWrite = false)]
|
||||
public ArrayImpl Repositories { get; } = new(service.Repositories.Select(BslStringValue.Create));
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using OneScript.Contexts;
|
||||
using OneSwiss.V8.Edt;
|
||||
using ScriptEngine.Machine.Contexts;
|
||||
|
||||
namespace OneSwiss.OneScript.Oscript;
|
||||
|
||||
[ContextClass("ИнсталляцияEDT", "EdtInstallation")]
|
||||
public class EdtInstallationWrapper(EdtInstallation item) : AutoContext<EdtInstallationWrapper>
|
||||
{
|
||||
[ContextProperty("Версия", "Version", CanWrite = false)]
|
||||
public string Version => item.Version;
|
||||
[ContextProperty("Путь", "Path", CanWrite = false)]
|
||||
public string Path => item.Path;
|
||||
[ContextProperty("СуществуетEdtCli", "ExistsEdtCli", CanWrite = false)]
|
||||
public bool HasEdtCli => item.HasEdtCli;
|
||||
[ContextProperty("ПутьEdtCli", "PathEdtCli", CanWrite = false)]
|
||||
public string EdtCliPath => item.EdtCliPath;
|
||||
[ContextProperty("ИзСтартера", "FromStarter", CanWrite = false)]
|
||||
public bool FromStarter => item.FromStarter;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using OneScript.Contexts.Enums;
|
||||
|
||||
namespace OneSwiss.OneScript.Oscript;
|
||||
|
||||
[EnumerationType("ТипОтладкиRagent", "RagentDebugType")]
|
||||
public enum RagentDebugTypeWrapper
|
||||
{
|
||||
[EnumValue("Отключена", "Disabled")]
|
||||
None,
|
||||
[EnumValue("TCP")]
|
||||
Tcp,
|
||||
[EnumValue("HTTP")]
|
||||
Http
|
||||
}
|
||||
32
oneswiss-oscript-integration/Oscript/RagentServiceWrapper.cs
Normal file
32
oneswiss-oscript-integration/Oscript/RagentServiceWrapper.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using OneScript.Contexts;
|
||||
using OneSwiss.V8.Platform.Services;
|
||||
using ScriptEngine.Machine.Contexts;
|
||||
|
||||
namespace OneSwiss.OneScript.Oscript;
|
||||
|
||||
[ContextClass("СервисRagent", "RagentService")]
|
||||
public class RagentServiceWrapper(RagentService service) : AutoContext<RagentServiceWrapper>
|
||||
{
|
||||
public readonly RagentService Service = service;
|
||||
|
||||
[ContextProperty("Имя", "Name", CanWrite = false)]
|
||||
public string Name => Service.Name;
|
||||
|
||||
[ContextProperty("Запущена", "IsActive", CanWrite = false)]
|
||||
public bool IsActive => Service.IsActive;
|
||||
|
||||
[ContextProperty("Порт", "Port", CanWrite = false)]
|
||||
public int Port => Service.Port;
|
||||
|
||||
[ContextProperty("ПортReg", "RegPort", CanWrite = false)]
|
||||
public int RegPort => Service.RegPort;
|
||||
|
||||
[ContextProperty("КаталогКластера", "ClusterCatalog", CanWrite = false)]
|
||||
public string ClusterCatalog => Service.ClusterCatalog;
|
||||
|
||||
[ContextProperty("Платформа", "Platform", CanWrite = false)]
|
||||
public V8PlatformWrapper Platform { get; } = new(service.Platform);
|
||||
|
||||
[ContextProperty("ТипОтладки", "DebugType", CanWrite = false)]
|
||||
public RagentDebugTypeWrapper DebugType { get; } = (RagentDebugTypeWrapper)service.DebugType;
|
||||
}
|
||||
30
oneswiss-oscript-integration/Oscript/RasServiceWrapper.cs
Normal file
30
oneswiss-oscript-integration/Oscript/RasServiceWrapper.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OneScript.Contexts;
|
||||
using OneSwiss.V8.Platform;
|
||||
using OneSwiss.V8.Platform.Services;
|
||||
using ScriptEngine.Machine.Contexts;
|
||||
|
||||
namespace OneSwiss.OneScript.Oscript;
|
||||
|
||||
[ContextClass("СервисRas", "RasService")]
|
||||
public class RasServiceWrapper(RasService service) : AutoContext<RasServiceWrapper>
|
||||
{
|
||||
[ContextProperty("Имя", "Name", CanWrite = false)]
|
||||
public string Name => service.Name;
|
||||
|
||||
[ContextProperty("Запущена", "IsActive", CanWrite = false)]
|
||||
public bool IsActive => service.IsActive;
|
||||
|
||||
[ContextProperty("ХостRagent", "RagentHost", CanWrite = false)]
|
||||
public string RagentHost => service.RagentHost;
|
||||
|
||||
[ContextProperty("ПортRagent", "RagentPort", CanWrite = false)]
|
||||
public int RagentPort => service.Port;
|
||||
|
||||
[ContextProperty("Порт", "Port", CanWrite = false)]
|
||||
public int Port => service.Port;
|
||||
|
||||
[ContextProperty("Платформа", "Platform", CanWrite = false)]
|
||||
public V8PlatformWrapper Platform { get; } = new V8PlatformWrapper(service.Platform);
|
||||
}
|
||||
32
oneswiss-oscript-integration/Oscript/V8PlatformWrapper.cs
Normal file
32
oneswiss-oscript-integration/Oscript/V8PlatformWrapper.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OneScript.Contexts;
|
||||
using OneSwiss.V8.Platform;
|
||||
using ScriptEngine.Machine.Contexts;
|
||||
|
||||
namespace OneSwiss.OneScript.Oscript;
|
||||
|
||||
[ContextClass("ПлатформаV8", "V8Platform")]
|
||||
public class V8PlatformWrapper(V8Platform platform) : AutoContext<V8PlatformWrapper>
|
||||
{
|
||||
[ContextProperty("Путь", "Path", CanWrite = false)]
|
||||
public string PlatformPath => platform.PlatformPath;
|
||||
[ContextProperty("Существует1CV8", "Exists1CV8", CanWrite = false)]
|
||||
public bool HasOnecV8 => platform.HasOnecV8;
|
||||
[ContextProperty("Путь1CV8", "Path1CV8", CanWrite = false)]
|
||||
public string OnecV8Path => platform.OnecV8Path;
|
||||
[ContextProperty("СуществуетRac", "ExistsRac", CanWrite = false)]
|
||||
public bool HasRac => platform.HasRac;
|
||||
[ContextProperty("ПутьRac", "PathRac", CanWrite = false)]
|
||||
public string RacPath => platform.RacPath;
|
||||
[ContextProperty("СуществуетRas", "ExistsRas", CanWrite = false)]
|
||||
public bool HasRas => platform.HasRas;
|
||||
[ContextProperty("ПутьRas", "PathRas", CanWrite = false)]
|
||||
public string RasPath => platform.RasPath;
|
||||
[ContextProperty("СуществуетIbcmd", "ExistsIbcmd", CanWrite = false)]
|
||||
public bool HasIbcmd => platform.HasIbcmd;
|
||||
[ContextProperty("ПутьIbcmd", "PathIbcmd", CanWrite = false)]
|
||||
public string IbcmdPath => platform.IbcmdPath;
|
||||
[ContextProperty("Версия", "Version", CanWrite = false)]
|
||||
public string Version => platform.Version;
|
||||
}
|
||||
14
oneswiss-oscript-integration/Oscript/V8ServiceWrapper.cs
Normal file
14
oneswiss-oscript-integration/Oscript/V8ServiceWrapper.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using OneScript.Contexts;
|
||||
using OneSwiss.V8.Platform.Services;
|
||||
using ScriptEngine.Machine.Contexts;
|
||||
|
||||
namespace OneSwiss.OneScript.Oscript;
|
||||
|
||||
[ContextClass("СлужбаV8", "V8Service")]
|
||||
public class V8ServiceWrapper(V8Service item) : AutoContext<V8ServiceWrapper>
|
||||
{
|
||||
[ContextProperty("Имя", "Name", CanWrite = false)]
|
||||
public string Name => item.Name;
|
||||
[ContextProperty("Запущена", "IsActive", CanWrite = false)]
|
||||
public bool IsActive => item.IsActive;
|
||||
}
|
||||
Reference in New Issue
Block a user