Provide Installed property to Agent.

This commit is contained in:
Haiping Chen 2024-01-13 16:06:21 -06:00
parent 40c800d1a4
commit 45a0ae383f
4 changed files with 9 additions and 2 deletions

View file

@ -63,6 +63,9 @@ public class Agent
[JsonIgnore]
public PluginDef Plugin { get; set; }
[JsonIgnore]
public bool Installed => Plugin.Enabled;
/// <summary>
/// Allow to be routed
/// </summary>

View file

@ -4,6 +4,7 @@ public class AgentFilter
{
public string? AgentName { get; set; }
public bool? Disabled { get; set; }
public bool? Installed { get; set; }
public bool? AllowRouting { get; set; }
public bool? IsPublic { get; set; }
public bool? IsRouter { get; set; }

View file

@ -21,7 +21,9 @@ public partial class AgentService
agent.Plugin = GetPlugin(agent.Id);
}
return await Task.FromResult(agents);
agents = agents.Where(x => x.Installed).ToList();
return agents;
}
#if !DEBUG

View file

@ -18,7 +18,8 @@ public partial class AgentService
agentId
},
Assembly = typeof(AgentService).Assembly.FullName.Split(',').First(),
Name = "BotSharp.Core"
Name = "BotSharp",
Enabled = true,
};
}
}