Implemented frontend Assets update button

This commit is contained in:
2025-10-10 19:52:28 +02:00
parent fd20b2ae2d
commit dd865b99be
5 changed files with 312 additions and 11 deletions

View File

@@ -186,9 +186,18 @@ public partial class LdapService : IDisposable
{
IEnumerable<Dictionary<string, string>> devices = await ListObjectBy(AssetsBaseDn, "(objectClass=device)", AssetsAttributes);
List<AssetModel> models = [];
devices.ToList().ForEach(x => models.Add(new AssetModel(x) {Cn = x["cn"]}));
devices.ToList().ForEach(x => models.Add(new AssetModel(x) { Cn = x["cn"] }));
return models;
}
public async Task<AssetModel> ListDeviceAsync(string Cn)
{
IEnumerable<Dictionary<string, string>> devices = await ListObjectBy(AssetsBaseDn, $"(objectClass=device)", AssetsAttributes);
Dictionary<string, string> entry = devices.ToList().First(x => x.GetValueOrDefault("cn") != null && x["cn"] == Cn);
AssetModel model = new(entry) { Cn = entry["cn"] };
return model;
}
public async Task CreateUser(string uid, LdapAttributeSet attributeSet)
{