Skip to content

feat: Show /status on instances table#1154

Open
dawsontoth wants to merge 2 commits intostagefrom
STUDIO-669_gtm
Open

feat: Show /status on instances table#1154
dawsontoth wants to merge 2 commits intostagefrom
STUDIO-669_gtm

Conversation

@dawsontoth
Copy link
Copy Markdown
Contributor

@dawsontoth dawsontoth commented Mar 23, 2026

We'll use the get_status and set_status operations to read and write the id: 'availability' to status: 'Unavailable' or status: 'Available' for individual instances.

https://harperdb.atlassian.net/browse/STUDIO-669

@dawsontoth dawsontoth force-pushed the STUDIO-669_gtm branch 2 times, most recently from b91ac96 to 62b6fc3 Compare March 23, 2026 16:02
@dawsontoth dawsontoth marked this pull request as ready for review March 23, 2026 16:02
@dawsontoth dawsontoth requested a review from a team as a code owner March 23, 2026 16:02
Copy link
Copy Markdown
Member

@kriszyp kriszyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be handled with get_status (which I thought was already displayed on the status page), and set_status. There shouldn't be any application port or CORS interaction involved.

@dawsontoth dawsontoth marked this pull request as draft March 30, 2026 16:11
@dawsontoth dawsontoth marked this pull request as ready for review April 7, 2026 19:52
Comment on lines +34 to +40
const { data: statusResponse, isLoading, isFetching } = useQuery(getStatusQueryOptions(instanceParams, ready));

const isAvailable = statusResponse?.systemStatus?.[0]?.status === 'Available';
const isUnavailable = statusResponse?.systemStatus?.[0]?.status === 'Unavailable';
const statusMessage = typeof statusResponse?.data === 'string'
? statusResponse.data
: (isAvailable ? DEFAULT_200_MSG : (isUnavailable ? DEFAULT_404_MSG : 'Unknown status'));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how we check if the instance is available or not, based on the first systemStatus.

variant="destructiveGhost"
size="icon"
className="size-7"
onClick={() => setStatus({ ...instanceParams, id: 'availability', status: 'Unavailable' })}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how we set it to be unavailable.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await server.operation({ operation: 'set_status', id: 'availability', status: 'Unavailable' });

Yeah looks right to me.

variant="ghost"
size="icon"
className="size-7"
onClick={() => setStatus({ ...instanceParams, id: 'availability', status: 'Available' })}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is how we set it to be available.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that looks right.

await server.operation({ operation: 'set_status', id: 'availability', status: 'Available' });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks! Experimentally it works too. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants