/** * Settings Page * * Configuration page for the Sealed Secrets plugin */ import { Box, Button, Divider, TextField, Typography } from '@mui/material'; import { useSnackbar } from 'notistack'; import React from 'react'; import { getPluginConfig, savePluginConfig } from '../lib/controller'; import { PluginConfig } from '../types'; import { ControllerStatus } from './ControllerStatus'; import { VersionWarning } from './VersionWarning'; /** * Settings page component */ export function SettingsPage() { const [config, setConfig] = React.useState(getPluginConfig()); const { enqueueSnackbar } = useSnackbar(); const handleSave = () => { savePluginConfig(config); enqueueSnackbar('Settings saved successfully', { variant: 'success' }); }; const handleReset = () => { const defaultConfig: PluginConfig = { controllerName: 'sealed-secrets-controller', controllerNamespace: 'kube-system', controllerPort: 8080, }; setConfig(defaultConfig); }; return ( Configure the connection to your Sealed Secrets controller. These settings are stored in your browser's local storage. {/* API Version Detection */} {/* Controller Health Status */} Controller Status
Controller Configuration setConfig({ ...config, controllerName: e.target.value })} margin="normal" helperText="Name of the sealed-secrets-controller deployment/service" inputProps={{ 'aria-label': 'Controller name', 'aria-describedby': 'controller-name-help', }} FormHelperTextProps={{ id: 'controller-name-help', }} /> setConfig({ ...config, controllerNamespace: e.target.value })} margin="normal" helperText="Namespace where the controller is installed" inputProps={{ 'aria-label': 'Controller namespace', 'aria-describedby': 'controller-namespace-help', }} FormHelperTextProps={{ id: 'controller-namespace-help', }} /> setConfig({ ...config, controllerPort: parseInt(e.target.value, 10) })} margin="normal" helperText="HTTP port of the controller service" inputProps={{ 'aria-label': 'Controller port', 'aria-describedby': 'controller-port-help', min: 1, max: 65535, }} FormHelperTextProps={{ id: 'controller-port-help', }} /> Default Values
Controller Name:
{' '}
sealed-secrets-controller

Controller Namespace:
{' '}
kube-system

Controller Port:
{' '}
8080
); }