mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
#591 - services
This commit is contained in:
@ -77,11 +77,15 @@ function Action({ type, worker }: { type: 'start' | 'stop' | 'restart'; worker:
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<DropdownMenuItem onSelect={(e) => e.preventDefault()}>{type}</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={(e) => e.preventDefault()} className="capitalize">
|
||||
{type}
|
||||
</DropdownMenuItem>
|
||||
</DialogTrigger>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>{type} worker</DialogTitle>
|
||||
<DialogTitle>
|
||||
<span className="capitalize">{type}</span> worker
|
||||
</DialogTitle>
|
||||
<DialogDescription className="sr-only">{type} worker</DialogDescription>
|
||||
</DialogHeader>
|
||||
<p className="p-4">Are you sure you want to {type} the worker?</p>
|
||||
@ -89,7 +93,7 @@ function Action({ type, worker }: { type: 'start' | 'stop' | 'restart'; worker:
|
||||
<DialogClose asChild>
|
||||
<Button variant="outline">Cancel</Button>
|
||||
</DialogClose>
|
||||
<Button disabled={form.processing} onClick={submit}>
|
||||
<Button variant={['stop'].includes(type) ? 'destructive' : 'default'} disabled={form.processing} onClick={submit} className="capitalize">
|
||||
{form.processing && <LoaderCircleIcon className="animate-spin" />}
|
||||
<FormSuccessful successful={form.recentlySuccessful} />
|
||||
{type}
|
||||
|
@ -107,25 +107,27 @@ export default function WorkerForm({ serverId, worker, children }: { serverId: n
|
||||
/>
|
||||
<InputError message={form.errors.numprocs} />
|
||||
</FormField>
|
||||
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
{/*auto start*/}
|
||||
<FormField>
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch id="auto_start" checked={form.data.auto_start} onCheckedChange={(value) => form.setData('auto_start', value)} />
|
||||
<Label htmlFor="auto_start">Auto start</Label>
|
||||
<InputError message={form.errors.auto_start} />
|
||||
</div>
|
||||
</FormField>
|
||||
|
||||
{/*auto restart*/}
|
||||
<FormField>
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch id="auto_restart" checked={form.data.auto_restart} onCheckedChange={(value) => form.setData('auto_restart', value)} />
|
||||
<Label htmlFor="auto_restart">Auto restart</Label>
|
||||
<InputError message={form.errors.auto_restart} />
|
||||
</div>
|
||||
</FormField>
|
||||
</div>
|
||||
</FormFields>
|
||||
|
||||
{/*auto start*/}
|
||||
<FormField>
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch id="auto_start" checked={form.data.auto_start} onCheckedChange={(value) => form.setData('auto_start', value)} />
|
||||
<Label htmlFor="auto_start">Auto start</Label>
|
||||
<InputError message={form.errors.auto_start} />
|
||||
</div>
|
||||
</FormField>
|
||||
|
||||
{/*auto restart*/}
|
||||
<FormField>
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch id="auto_restart" checked={form.data.auto_restart} onCheckedChange={(value) => form.setData('auto_restart', value)} />
|
||||
<Label htmlFor="auto_restart">Auto restart</Label>
|
||||
<InputError message={form.errors.auto_restart} />
|
||||
</div>
|
||||
</FormField>
|
||||
</Form>
|
||||
<DialogFooter>
|
||||
<DialogClose asChild>
|
||||
|
Reference in New Issue
Block a user