1
0
mirror of https://github.com/akpaevj/onecmonitor.git synced 2025-11-25 22:22:15 +02:00

Добавлен слой интеграции с OScript

This commit is contained in:
akpaev.e
2025-08-01 19:08:02 +03:00
parent d978237e3b
commit 9e70e32b79
27 changed files with 361 additions and 18 deletions

View File

@@ -0,0 +1,15 @@
using OneScript.Contexts;
using OneScript.StandardLibrary.Collections;
using OneSwiss.Agent.Services;
using OneSwiss.OneScript.Oscript;
using ScriptEngine.Machine.Contexts;
namespace OneSwiss.Agent.Oscript;
[ContextClass("ПровайдерИнсталляцийEDT", "EdtInstallationsProvider")]
public class EdtInstallationsProviderWrapper(EdtInstallationsProvider provider) : AutoContext<EdtInstallationsProviderWrapper>
{
[ContextMethod("ПолучитьИнсталляции", "GetInstallations")]
public ArrayImpl GetInstallations()
=> new(provider.GetInstallations().Select(c => new EdtInstallationWrapper(c)));
}

View File

@@ -0,0 +1,25 @@
using OneScript.Contexts;
using OneSwiss.Agent.Services;
using ScriptEngine.Machine.Contexts;
namespace OneSwiss.Agent.Oscript;
[ContextClass("КонтекстИнтеграцииOneSwiss", "OneSwissIntegrationContext")]
public class OscriptIntegrationContext(
V8PlatformsProvider platformsProvider,
V8ServicesProvider servicesProvider,
RasHolder rasHolder,
EdtInstallationsProvider edtInstallationsProvider) : AutoContext<OscriptIntegrationContext>
{
[ContextProperty("ПровайдерПлатформ", "PlatformsProvider", CanWrite = false)]
public V8PlatformsProviderWrapper PlatformsProvider { get; } = new(platformsProvider);
[ContextProperty("ПровайдерСлужб", "ServicesProvider", CanWrite = false)]
public V8ServicesProviderWrapper ServicesProvider { get; } = new(servicesProvider);
[ContextProperty("МенеджерRas", "RasManager", CanWrite = false)]
public RasHolderWrapper RasHolder { get; } = new(rasHolder);
[ContextProperty("ПровайдерИнсталляцийEdt", "EdtInstallationsProvider", CanWrite = false)]
public EdtInstallationsProviderWrapper EdtInstallationsProvider { get; } = new(edtInstallationsProvider);
}

View File

@@ -0,0 +1,11 @@
using OneScript.Contexts;
using ScriptEngine.Machine.Contexts;
namespace OneSwiss.Agent.Oscript;
[GlobalContext(Category = "Методы интеграции с OneSwiss", ManualRegistration = true)]
public class OscriptIntegrationGlobalContext(OscriptIntegrationContext context) : GlobalContextBase<OscriptIntegrationGlobalContext>
{
[ContextMethod("ПолучитьКонтекстИнтеграцииOneSwiss", "GetOneSwissIntegrationContext")]
public OscriptIntegrationContext GetContext() => context;
}

View File

@@ -0,0 +1,19 @@
using OneScript.Contexts;
using OneScript.StandardLibrary.Collections;
using OneSwiss.Agent.Services;
using OneSwiss.OneScript.Oscript;
using ScriptEngine.Machine.Contexts;
namespace OneSwiss.Agent.Oscript;
[ContextClass("МенеджерRas", "RasManager")]
public class RasHolderWrapper(RasHolder holder) : AutoContext<RasHolderWrapper>
{
[ContextMethod("ПолучитьСлужбыRas", "GetRasServices")]
public ArrayImpl GetRasServices()
=> new (holder.GetRasServices().Select(c => new RasServiceWrapper(c)));
[ContextMethod("ПолучитьЗапущеннуюСлужбуRasДляRagent", "GetActiveRasForRagent")]
public RasServiceWrapper GetActiveRasForRagent(RagentServiceWrapper ragent)
=> new(holder.GetActiveRasForRagent(ragent.Service));
}

View File

@@ -0,0 +1,15 @@
using OneScript.Contexts;
using OneScript.StandardLibrary.Collections;
using OneSwiss.Agent.Services;
using OneSwiss.OneScript.Oscript;
using ScriptEngine.Machine.Contexts;
namespace OneSwiss.Agent.Oscript;
[ContextClass("ПровайдерПлатформV8", "V8PlatformsProvider")]
public class V8PlatformsProviderWrapper(V8PlatformsProvider provider) : AutoContext<V8PlatformsProviderWrapper>
{
[ContextMethod("ПолучитьУстановленныеПлатформы", "GetInstalledPlatforms")]
public ArrayImpl GetInstalledPlatforms()
=> new (provider.GetInstalledPlatforms().Select(c => new V8PlatformWrapper(c)));
}

View File

@@ -0,0 +1,39 @@
using OneScript.Contexts;
using OneScript.StandardLibrary.Collections;
using OneSwiss.Agent.Services;
using OneSwiss.OneScript.Oscript;
using ScriptEngine.Machine.Contexts;
namespace OneSwiss.Agent.Oscript;
[ContextClass("ПровайдерСлужб", "ServicesProvider")]
public class V8ServicesProviderWrapper(V8ServicesProvider provider) : AutoContext<V8ServicesProviderWrapper>
{
[ContextMethod("ПолучитьСлужбыRas", "GetRasServices")]
public ArrayImpl GetRasServices()
=> new(provider.GetRasServices().Select(c => new RasServiceWrapper(c)));
[ContextMethod("ПолучитьЗапущеннуюСлужбуRagentДляПортаКластера", "GetActiveRagentForClusterPort")]
public RagentServiceWrapper GetActiveRagentForClusterPort(int port)
=> new(provider.GetActiveRagentForClusterPort(port));
[ContextMethod("ПолучитьЗапущенныеСлужбыRas", "GetActiveRagentServices")]
public ArrayImpl GetActiveRagentServices()
=> new(provider.GetActiveRagentServices().Select(c => new RagentServiceWrapper(c)));
[ContextMethod("ПолучитьСлужбыRagent", "GetRagentServices")]
public ArrayImpl GetRagentServices()
=> new(provider.GetRagentServices().Select(c => new RagentServiceWrapper(c)));
[ContextMethod("ПолучитьСлужбуCrServerДляПорта", "GetCrServerForPort")]
public CrServerWrapper GetCrServerForPort(int port)
=> new(provider.GetCrServerForPort(port));
[ContextMethod("ПолучитьЗапущенныеСлужбыCrServer", "GetActiveCrServerServices")]
public ArrayImpl GetActiveCrServerServices()
=> new(provider.GetActiveCrServerServices().Select(c => new CrServerWrapper(c)));
[ContextMethod("ПолучитьСлужбыCrServer", "GetCrServerServices")]
public ArrayImpl GetCrServerServices()
=> new(provider.GetCrServerServices().Select(c => new CrServerWrapper(c)));
}

View File

@@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using OneSwiss.Agent;
using OneSwiss.Agent.Models;
using OneSwiss.Agent.Oscript;
using OneSwiss.Agent.Services;
using OneSwiss.Agent.Services.EventLog;
using OneSwiss.Agent.Services.MaintenanceTasks;
@@ -43,6 +44,9 @@ var host = Host.CreateDefaultBuilder(args)
services.AddSingleton<TechLogManager>();
services.AddSingleton<CommandsWatcher>();
services.AddSingleton<OscriptIntegrationContext>();
services.AddSingleton<OscriptIntegrationGlobalContext>();
})
.Build();

View File

@@ -8,10 +8,8 @@ using OneSwiss.V8.Platform.RemoteAdministration;
namespace OneSwiss.Agent.Services.MaintenanceTasks;
[ContextClass("КонтекстШагаОбслуживания", "MaintenanceStepContext")]
public class MaintenanceStepContext
{
[ContextProperty("ЗадачаОбслуживания", "MaintenanceTask")]
public MaintenanceTaskDto Task { get; set; } = null!;
public InfoBaseDto InfoBase { get; set; } = null!;
public MaintenanceStepDto Step { get; set; } = null!;
@@ -22,7 +20,6 @@ public class MaintenanceStepContext
public V8Platform Platform { get; set; } = null!;
public bool UseDesignerAgent { get; set; }
public DesignerAgentClient? DesignerAgentClient { get; set; }
public CancellationToken CancellationToken { get; set; }
public OnecV8BatchMode GetBatchDesigner()
=> OnecV8BatchMode.CreateDesignerBatch(Platform, $"{InfoBase.Cluster.Host}:{InfoBase.Cluster.Port}", InfoBase.InfoBaseName);

View File

@@ -1,6 +1,7 @@
using System.CommandLine.Parsing;
using System.Text.RegularExpressions;
using OneSwiss.Agent.Extensions;
using OneSwiss.Agent.Oscript;
using OneSwiss.Common.DTO;
using OneSwiss.Common.DTO.MaintenanceTasks;
using OneSwiss.Common.Extensions;
@@ -9,6 +10,7 @@ using OneSwiss.OneScript;
using OneSwiss.V8.Designer.Agent;
using OneSwiss.V8.Designer.Batch;
using OneSwiss.V8.Platform.RemoteAdministration;
using ScriptEngine.Hosting;
namespace OneSwiss.Agent.Services.MaintenanceTasks;
@@ -20,6 +22,7 @@ public class MaintenanceTaskExecutor : BackgroundService
private readonly IServiceProvider _serviceProvider;
private readonly RasHolder _rasHolder;
private readonly V8ServicesProvider _v8ServicesProvider;
private OscriptIntegrationGlobalContext _oscriptIntegrationGlobalContext;
private readonly ILogger<MaintenanceTaskExecutor> _logger;
private readonly ILogger<Rac> _racLogger;
@@ -28,10 +31,12 @@ public class MaintenanceTaskExecutor : BackgroundService
MonitorQueue<MaintenanceTaskDto> queue,
RasHolder rasHolder,
V8ServicesProvider v8ServicesProvider,
OscriptIntegrationGlobalContext oscriptIntegrationGlobalContext,
ILogger<MaintenanceTaskExecutor> logger,
ILogger<Rac> racLogger)
{
_racLogger = racLogger;
_oscriptIntegrationGlobalContext = oscriptIntegrationGlobalContext;
_serviceProvider = serviceProvider;
_scope = serviceProvider.CreateAsyncScope();
_queue = queue;
@@ -219,7 +224,7 @@ public class MaintenanceTaskExecutor : BackgroundService
return result;
}
private static async Task HandleTaskStepNode(MaintenanceStepContext context)
private async Task HandleTaskStepNode(MaintenanceStepContext context)
{
AddStepLogItem(context, $"Обработка шага \"{context.Step.Kind.GetDisplay()}\"");
@@ -478,7 +483,7 @@ public class MaintenanceTaskExecutor : BackgroundService
}
}
private static void ExecuteOneScript(MaintenanceStepContext context)
private void ExecuteOneScript(MaintenanceStepContext context)
{
var scriptPath = Directory.CreateTempSubdirectory().FullName;
@@ -498,7 +503,11 @@ public class MaintenanceTaskExecutor : BackgroundService
var cmdParser = new Parser();
var parsingResult = cmdParser.Parse(context.Step.CommandLineArguments);
scriptHost.ExecutePackageScript(scriptPath, opmMetadata!, []);
scriptHost.ExecutePackageScript(scriptPath, opmMetadata!, [], e =>
{
e.AddAssembly(typeof(OscriptIntegrationGlobalContext).Assembly);
e.AddGlobalContext(_oscriptIntegrationGlobalContext);
});
Directory.Delete(scriptPath, true);
}

View File

@@ -1,3 +1,4 @@
using OneScript.Contexts;
using OneSwiss.V8.Platform.Services;
namespace OneSwiss.Agent.Services;

View File

@@ -1,10 +1,12 @@
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using OneScript.Sources;
using OneScript.StandardLibrary;
using OneSwiss.OneScript.Oscript;
using OneSwiss.V8.Platform;
using ScriptEngine;
using ScriptEngine.HostedScript;
using ScriptEngine.Hosting;
using ExecutionContext = ScriptEngine.Machine.ExecutionContext;
namespace OneSwiss.OneScript;
@@ -14,13 +16,13 @@ public class OneScriptExecutor : IHostApplication
public EventHandler<Exception>? OnError = null;
private string[] _args;
public void ExecutePackageScript(string path, OpmMetadata metadata, string[] args)
public void ExecutePackageScript(string path, OpmMetadata metadata, string[] args, Action<ExecutionContext> engineBuilder)
{
_args = args;
var executablePath = Path.Combine(path, metadata.Executable);
var librariesPath = Path.Combine(path, "oscript_modules");
using var engine = CreateEngine(librariesPath);
using var engine = CreateEngine(librariesPath, engineBuilder);
engine.Initialize();
var source = SourceCodeBuilder
@@ -35,7 +37,7 @@ public class OneScriptExecutor : IHostApplication
throw new Exception("Ошибка выполнения скрипта");
}
private static HostedScriptEngine CreateEngine(string librariesPath)
private static HostedScriptEngine CreateEngine(string librariesPath, Action<ExecutionContext> engineBuilder)
{
var builder = DefaultEngineBuilder
.Create()
@@ -44,6 +46,8 @@ public class OneScriptExecutor : IHostApplication
.SetupEnvironment(e =>
{
e.AddStandardLibrary();
e.AddAssembly(typeof(OneScriptExecutor).Assembly);
engineBuilder.Invoke(e);
});
builder.Services.RegisterSingleton<IDependencyResolver>(new FileSystemDependencyResolver

View File

@@ -1,6 +1,5 @@
using System.IO.Compression;
using System.Xml.Serialization;
using OneSwiss.OneScript.Oscript;
namespace OneSwiss.OneScript;

View File

@@ -1,6 +1,6 @@
using System.Xml.Serialization;
namespace OneSwiss.OneScript.Oscript;
namespace OneSwiss.OneScript;
public class OpmMetadataRoot
{

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

View File

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

View File

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

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

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

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

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

View File

@@ -23,7 +23,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Oscript\" />
<ProjectReference Include="..\oneswiss-v8\oneswiss-v8.csproj" />
</ItemGroup>
</Project>

View File

@@ -38,14 +38,19 @@ public static class EdtDiscoverer
var version = kv[1].Trim();
var edtCliPath = Path.Join(binPath, "1cedtcli" + (Environment.OSVersion.Platform == PlatformID.Win32NT ? ".exe" : ""));
items.Add(new EdtInstallation
var edtItem = new EdtInstallation
{
Version = version,
HasEdtCli = File.Exists(edtCliPath),
Path = binPath,
FromStarter = item.IsStarter
});
};
if (edtItem.HasEdtCli)
edtItem.EdtCliPath = edtCliPath;
items.Add(edtItem);
break;
}

View File

@@ -12,5 +12,7 @@ public class EdtInstallation
[Key(2)]
public bool HasEdtCli { get; set; }
[Key(3)]
public string EdtCliPath { get; set; }
[Key(4)]
public bool FromStarter { get; set; }
}

View File

@@ -19,6 +19,7 @@ public class RagentService : V8Service
[Key(5)]
[DisplayName("Платформа")]
public V8Platform Platform { get; set; } = null!;
[Key(6)] [DisplayName("Тип отладки")]
[Key(6)]
[DisplayName("Тип отладки")]
public RagentDebugType DebugType { get; set; } = RagentDebugType.None;
}

View File

@@ -1,22 +1,28 @@
using System.ComponentModel;
using MessagePack;
using OneScript.Contexts;
namespace OneSwiss.V8.Platform.Services;
[DisplayName("Служба сервера удаленного администрирования 1С")]
[MessagePackObject]
[ContextClass("СервисRas", "RasService")]
public class RasService : V8Service
{
[Key(2)]
[DisplayName("Хост агента кластера")]
[DisplayName("Хост агента кластера")]
[ContextProperty("ХостRagent", "RagentHost", CanWrite = false)]
public string RagentHost { get; set; } = string.Empty;
[Key(3)]
[DisplayName("Порт агента кластера")]
[ContextProperty("ПортRagent", "RagentPort", CanWrite = false)]
public int RagentPort { get; set; }
[Key(4)]
[DisplayName("Порт")]
[ContextProperty("Порт", "Port", CanWrite = false)]
public int Port { get; set; }
[Key(5)]
[DisplayName("Платформа")]
[ContextProperty("Платформа", "Platform", CanWrite = false)]
public V8Platform Platform { get; set; } = null!;
}

View File

@@ -1,5 +1,6 @@
using System.ComponentModel;
using MessagePack;
using OneScript.Contexts;
namespace OneSwiss.V8.Platform;
@@ -11,31 +12,44 @@ public class V8Platform
public string PlatformPath { get; init; } = string.Empty;
[DisplayName("1Cv8 установлена")]
[Key(1)]
[ContextProperty("Существует1CV8", "Exists1CV8", CanWrite = false)]
public bool HasOnecV8 { get; init; }
[DisplayName("Путь к 1Cv8")]
[Key(2)]
[ContextProperty("Путь1CV8", "Path1CV8", CanWrite = false)]
public string OnecV8Path { get; init; } = string.Empty;
[DisplayName("RAC установлен")]
[Key(3)]
[ContextProperty("СуществуетRac", "ExistsRac", CanWrite = false)]
public bool HasRac { get; init; }
[DisplayName("Путь к RAC")]
[Key(4)]
[ContextProperty("ПутьRac", "PathRac", CanWrite = false)]
public string RacPath { get; init; } = string.Empty;
[DisplayName("RAS установлен")]
[Key(5)]
[ContextProperty("СуществуетRas", "ExistsRas", CanWrite = false)]
public bool HasRas { get; init; }
[DisplayName("Путь к RAS")]
[Key(6)]
[ContextProperty("ПутьRas", "PathRas", CanWrite = false)]
public string RasPath { get; init; } = string.Empty;
[Key(7)]
[ContextProperty("СуществуетIbcmd", "ExistsIbcmd", CanWrite = false)]
public bool HasIbcmd { get; init; }
[DisplayName("Путь к ibcmd")]
[Key(8)]
[ContextProperty("ПутьIbcmd", "PathIbcmd", CanWrite = false)]
public string IbcmdPath { get; init; } = string.Empty;
[DisplayName("Версия")]
[Key(9)]
[ContextProperty("Версия", "Version", CanWrite = false)]
public string Version { get; init; } = string.Empty;
[ScriptConstructor]
public static V8Platform Constructor()
=> new V8Platform();
public override bool Equals(object? obj)
=> obj is V8Platform platform &&
PlatformPath.ToUpper().Equals(platform.PlatformPath.ToUpper());

View File

@@ -16,6 +16,12 @@
<Reference Include="MessagePack.Annotations">
<HintPath>..\..\..\.nuget\packages\messagepack.annotations\3.1.2\lib\netstandard2.0\MessagePack.Annotations.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Configuration.Abstractions">
<HintPath>..\..\..\.nuget\packages\microsoft.extensions.configuration.abstractions\9.0.7\lib\net9.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
</Reference>
<Reference Include="OneScript.Core">
<HintPath>..\..\..\.nuget\packages\onescript.corelib\2.0.0-rc.7\lib\net6.0\OneScript.Core.dll</HintPath>
</Reference>
<Reference Include="System.ServiceProcess.ServiceController">
<HintPath>..\..\..\.nuget\packages\system.serviceprocess.servicecontroller\9.0.1\lib\net8.0\System.ServiceProcess.ServiceController.dll</HintPath>
</Reference>