feat(uns): tag + virtual-tag modals wired into the tree
This commit is contained in:
@@ -178,6 +178,50 @@ public sealed class UnsTreeService(IDbContextFactory<OtOpcUaConfigDbContext> dbF
|
||||
.FirstOrDefaultAsync(ct);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<TagEditDto?> LoadTagAsync(string tagId, CancellationToken ct = default)
|
||||
{
|
||||
await using var db = await dbFactory.CreateDbContextAsync(ct);
|
||||
|
||||
return await db.Tags
|
||||
.AsNoTracking()
|
||||
.Where(t => t.TagId == tagId)
|
||||
.Select(t => new TagEditDto(
|
||||
t.TagId,
|
||||
t.EquipmentId!,
|
||||
t.Name,
|
||||
t.DriverInstanceId,
|
||||
t.DataType,
|
||||
t.AccessLevel,
|
||||
t.WriteIdempotent,
|
||||
t.PollGroupId,
|
||||
t.TagConfig,
|
||||
t.RowVersion))
|
||||
.FirstOrDefaultAsync(ct);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<VirtualTagEditDto?> LoadVirtualTagAsync(string virtualTagId, CancellationToken ct = default)
|
||||
{
|
||||
await using var db = await dbFactory.CreateDbContextAsync(ct);
|
||||
|
||||
return await db.VirtualTags
|
||||
.AsNoTracking()
|
||||
.Where(v => v.VirtualTagId == virtualTagId)
|
||||
.Select(v => new VirtualTagEditDto(
|
||||
v.VirtualTagId,
|
||||
v.EquipmentId,
|
||||
v.Name,
|
||||
v.DataType,
|
||||
v.ScriptId,
|
||||
v.ChangeTriggered,
|
||||
v.TimerIntervalMs,
|
||||
v.Historize,
|
||||
v.Enabled,
|
||||
v.RowVersion))
|
||||
.FirstOrDefaultAsync(ct);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<(string DriverInstanceId, string Display)>> LoadDriversForClusterAsync(
|
||||
string clusterId,
|
||||
|
||||
Reference in New Issue
Block a user