feat: add checkbox to generate LAN commands

This commit is contained in:
bsourisse 2023-06-05 23:29:43 +02:00
parent fca4560e18
commit bbe1de8b8a

View file

@ -118,6 +118,7 @@ export default function RepoManage(props) {
sshPublicKey: dataForm.sshkey,
comment: dataForm.comment,
alert: dataForm.alert.value,
lanCommand: dataForm.lanCommand,
};
//POST API to send new repo
await fetch('/api/repo/add', {
@ -153,6 +154,7 @@ export default function RepoManage(props) {
sshPublicKey: dataForm.sshkey,
comment: dataForm.comment,
alert: dataForm.alert.value,
lanCommand: dataForm.lanCommand,
};
await fetch('/api/repo/id/' + router.query.slug + '/edit', {
method: 'PUT',
@ -363,6 +365,22 @@ export default function RepoManage(props) {
{errors.comment.message}
</span>
)}
{/* LAN COMMAND GENERATION */}
<div className={classes.lanCommandWrapper}>
<input
type='checkbox'
name='lanCommand'
defaultChecked={
props.mode == 'edit'
? targetRepo.lanCommand
: false
}
{...register('lanCommand')}
/>
<label htmlFor='lanCommand'>
Generates commands for use over LAN.
</label>
</div>
{/* ALERT */}
<label
style={{ margin: '25px auto 10px auto' }}