This commit is contained in:
@@ -18,7 +18,7 @@ import type { WolClient } from 'types';
|
||||
import DebouncedWolClient from './DebouncedWolClient';
|
||||
import WolClientSettingsItem from './WolClientSettingsItem';
|
||||
|
||||
const WolClientSettings = () => {
|
||||
export function WolClients() {
|
||||
const defaultWolClient: WolClient = {
|
||||
id: undefined,
|
||||
hostname: '',
|
||||
@@ -65,76 +65,78 @@ const WolClientSettings = () => {
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
<AddItemModal
|
||||
modalOpened={modalOpened}
|
||||
handleClose={handleClose}
|
||||
title={'Add a new WoL Client'}
|
||||
body={
|
||||
<form
|
||||
onSubmit={form.onSubmit((values) => {
|
||||
mutateAsync({
|
||||
method: 'POST',
|
||||
endpoint: endpoint,
|
||||
body: values,
|
||||
});
|
||||
handleClose();
|
||||
})}
|
||||
>
|
||||
<Stack gap={0} w={'100%'} align='center'>
|
||||
<Group w={'100%'} justify='center'>
|
||||
<TextInput
|
||||
key={form.key('hostname')}
|
||||
{...form.getInputProps('hostname')}
|
||||
label={'Hostname'}
|
||||
placeholder='eg. Workstation'
|
||||
className={textInputClasses.settingsItem}
|
||||
classNames={textInputClasses}
|
||||
withAsterisk
|
||||
styles={
|
||||
theme.textShadowsEnabled
|
||||
? {
|
||||
label: { boxShadow: '2px 2px var(--mantine-color-border-0)' },
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
<TextInput
|
||||
key={form.key('macAddress')}
|
||||
{...form.getInputProps('macAddress')}
|
||||
label={'MAC Address'}
|
||||
placeholder='eg. 00:00:00:00:00:00'
|
||||
className={textInputClasses.settingsItem}
|
||||
classNames={textInputClasses}
|
||||
withAsterisk
|
||||
styles={
|
||||
theme.textShadowsEnabled
|
||||
? {
|
||||
label: { boxShadow: '2px 2px var(--mantine-color-border-0)' },
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
</Group>
|
||||
<Group mt={'1rem'}>
|
||||
<Button
|
||||
type='submit'
|
||||
className={buttonClasses.saveButton}
|
||||
classNames={buttonClasses}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
<Button
|
||||
className={buttonClasses.cancelButton}
|
||||
classNames={buttonClasses}
|
||||
onClick={handleClose}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</form>
|
||||
}
|
||||
/>
|
||||
{modalOpened && (
|
||||
<AddItemModal
|
||||
modalOpened={modalOpened}
|
||||
handleClose={handleClose}
|
||||
title={'Add a new WoL Client'}
|
||||
body={
|
||||
<form
|
||||
onSubmit={form.onSubmit((values) => {
|
||||
mutateAsync({
|
||||
method: 'POST',
|
||||
endpoint: endpoint,
|
||||
body: values,
|
||||
});
|
||||
handleClose();
|
||||
})}
|
||||
>
|
||||
<Stack gap={0} w={'100%'} align='center'>
|
||||
<Group w={'100%'} justify='center'>
|
||||
<TextInput
|
||||
key={form.key('hostname')}
|
||||
{...form.getInputProps('hostname')}
|
||||
label={'Hostname'}
|
||||
placeholder='eg. Workstation'
|
||||
className={textInputClasses.settingsItem}
|
||||
classNames={textInputClasses}
|
||||
withAsterisk
|
||||
styles={
|
||||
theme.textShadowsEnabled
|
||||
? {
|
||||
label: { boxShadow: '2px 2px var(--mantine-color-border-0)' },
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
<TextInput
|
||||
key={form.key('macAddress')}
|
||||
{...form.getInputProps('macAddress')}
|
||||
label={'MAC Address'}
|
||||
placeholder='eg. 00:00:00:00:00:00'
|
||||
className={textInputClasses.settingsItem}
|
||||
classNames={textInputClasses}
|
||||
withAsterisk
|
||||
styles={
|
||||
theme.textShadowsEnabled
|
||||
? {
|
||||
label: { boxShadow: '2px 2px var(--mantine-color-border-0)' },
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
</Group>
|
||||
<Group mt={'1rem'}>
|
||||
<Button
|
||||
type='submit'
|
||||
className={buttonClasses.saveButton}
|
||||
classNames={buttonClasses}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
<Button
|
||||
className={buttonClasses.cancelButton}
|
||||
classNames={buttonClasses}
|
||||
onClick={handleClose}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</form>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<SettingsHeader
|
||||
setDragging={undefined}
|
||||
openModal={openModal}
|
||||
@@ -204,5 +206,4 @@ const WolClientSettings = () => {
|
||||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
export default WolClientSettings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user