Skip to content

Commit 272c907

Browse files
AI Assistant Status admin page (#7827)
## Rationale For troubleshooting asistance ## Related Pull Requests - <!-- list of links to related pull requests (replace this comment) --> ## Changes - <!-- list of descriptions of changes that are worth noting (replace this comment) --> <!-- list of standard tasks (remove this comment to enable) ## Tasks 📍 - [ ] Claude Code Review - [ ] Manual Testing - [ ] Test Automation - [ ] Verify Fix --> Co-authored-by: Adam Rauch <[email protected]>
1 parent 7042900 commit 272c907

2 files changed

Lines changed: 31 additions & 3 deletions

File tree

api/src/org/labkey/api/mcp/McpService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import org.labkey.api.settings.OptionalFeatureService;
2626
import org.labkey.api.util.HtmlString;
2727
import org.labkey.api.util.logging.LogHelper;
28+
import org.labkey.api.view.HtmlView;
29+
import org.labkey.api.view.HttpView;
2830
import org.labkey.api.writer.ContainerUser;
2931
import org.springframework.ai.chat.client.ChatClient;
3032
import org.springframework.ai.chat.model.ToolContext;
@@ -232,4 +234,9 @@ default List<MessageResponse> sendMessageEx(ChatClient chat, String message)
232234

233235
/** Drop and recreate the vector store table. Use when the embedding model has changed and dimensions no longer match. */
234236
void resetVectorStore();
237+
238+
default HttpView<Object> getAssistantStatusView()
239+
{
240+
return new HtmlView(HtmlString.of("AI Assistant features are not available."));
241+
}
235242
}

core/src/org/labkey/core/admin/AdminController.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
import org.labkey.api.exp.api.StorageProvisioner;
147147
import org.labkey.api.exp.property.Lookup;
148148
import org.labkey.api.files.FileContentService;
149+
import org.labkey.api.mcp.McpService;
149150
import org.labkey.api.message.settings.AbstractConfigTypeProvider.EmailConfigFormImpl;
150151
import org.labkey.api.message.settings.MessageConfigService;
151152
import org.labkey.api.message.settings.MessageConfigService.ConfigTypeProvider;
@@ -3525,6 +3526,25 @@ public void addNavTrail(NavTree root)
35253526
}
35263527
}
35273528

3529+
// NOTE let the Professional Module register this action (there is no ProfessionalController)
3530+
3531+
@RequiresPermission(TroubleshooterPermission.class)
3532+
public class AssistantStatusAction extends SimpleViewAction<Object>
3533+
{
3534+
@Override
3535+
public ModelAndView getView(Object o, BindException errors) throws Exception
3536+
{
3537+
return McpService.get().getAssistantStatusView();
3538+
}
3539+
3540+
@Override
3541+
public void addNavTrail(NavTree root)
3542+
{
3543+
addAdminNavTrail(root, "AI Assistant Status", this.getClass());
3544+
}
3545+
}
3546+
3547+
35283548

35293549
public static class ConfigureSystemMaintenanceForm
35303550
{
@@ -11142,9 +11162,10 @@ private JSONObject getConfigurationJson()
1114211162
res.put("server", AdminBean.getPropertyMap());
1114311163

1114411164
final Map<String,Map<String,Object>> sets = new TreeMap<>();
11145-
new SqlSelector(CoreSchema.getInstance().getScope(),
11146-
new SQLFragment("SELECT category, name, value FROM prop.propertysets PS inner join prop.properties P on PS.\"set\" = P.\"set\"\n" +
11147-
"WHERE objectid = ? AND category IN ('SiteConfig') AND encryption='None' AND LOWER(name) NOT LIKE '%password%'", ContainerManager.getRoot())).forEachMap(m ->
11165+
var sql = new SQLFragment("SELECT category, name, value FROM prop.propertysets PS inner join prop.properties P on PS.\"set\" = P.\"set\"\n")
11166+
.append("WHERE objectid = ").appendValue(ContainerManager.getRoot()).append(" AND category IN ('SiteConfig') AND encryption='None' AND LOWER(name) NOT LIKE '%password%'");
11167+
new SqlSelector(CoreSchema.getInstance().getScope(), sql)
11168+
.forEachMap(m ->
1114811169
{
1114911170
String category = (String)m.get("category");
1115011171
String name = (String)m.get("name");

0 commit comments

Comments
 (0)