You've already forked onecmonitor
mirror of
https://github.com/akpaevj/onecmonitor.git
synced 2025-11-27 22:28:17 +02:00
29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
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));
|
|
} |