From 680ade59759899bcc494c8391bf898a1f0aa022d Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Mon, 1 Jun 2026 22:44:13 +0100 Subject: [PATCH] Add instance filter to users page --- .../web_ui/src/components/InputInstance.tsx | 42 +++++++++++++++++++ packages/web_ui/src/components/UsersPage.tsx | 17 ++++++-- 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 packages/web_ui/src/components/InputInstance.tsx diff --git a/packages/web_ui/src/components/InputInstance.tsx b/packages/web_ui/src/components/InputInstance.tsx new file mode 100644 index 00000000..6564311c --- /dev/null +++ b/packages/web_ui/src/components/InputInstance.tsx @@ -0,0 +1,42 @@ +import { Select } from "antd"; + +import { InputComponentProps } from "../BaseWebPlugin"; +import { useInstances } from "../model/instance"; + +interface BaseInputInstanceProps extends InputComponentProps { + includeAll?: boolean; +} + +function BaseInputInstance(props: BaseInputInstanceProps) { + const [instances, synced] = useInstances(); + + const options = [ + ...(props.includeAll ? [{ label: "All instances", value: null }] : []), + ...[...instances.values()].map(instance => ({ + label: instance.name ?? `Instance ${instance.id}`, + value: instance.id, + })), + ]; + + return ( +