feat(admin): implement admin controls polling and restart prompt (#16627)

This commit is contained in:
Shreya Keshive
2026-01-16 15:24:53 -05:00
committed by GitHub
parent 93224e1813
commit d8d4d87e29
20 changed files with 689 additions and 26 deletions
@@ -0,0 +1,36 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Box, Text } from 'ink';
import { theme } from '../semantic-colors.js';
import { useKeypress } from '../hooks/useKeypress.js';
import { useUIActions } from '../contexts/UIActionsContext.js';
import { Command, keyMatchers } from '../keyMatchers.js';
export const AdminSettingsChangedDialog = () => {
const { handleRestart } = useUIActions();
useKeypress(
(key) => {
if (keyMatchers[Command.RESTART_APP](key)) {
handleRestart();
}
},
{ isActive: true },
);
const message =
'Admin settings have changed. Please restart the session to apply new settings.';
return (
<Box borderStyle="round" borderColor={theme.status.warning} paddingX={1}>
<Text color={theme.status.warning}>
{message} Press &apos;r&apos; to restart, or &apos;Ctrl+C&apos; twice to
exit.
</Text>
</Box>
);
};