1
0
mirror of https://github.com/akpaevj/onecmonitor.git synced 2025-11-27 22:28:17 +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,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));
}