feat: add script disable functionality with visual indicators (#9374)

This commit is contained in:
Alpha Vylly
2025-11-23 09:22:57 -03:00
committed by GitHub
parent 4134f68fb4
commit 72a39012b6
8 changed files with 190 additions and 26 deletions

View File

@@ -42,6 +42,8 @@ const initialScript: Script = {
website: null,
logo: null,
description: "",
disable: undefined,
disable_description: undefined,
install_methods: [],
default_credentials: {
username: null,
@@ -261,7 +263,25 @@ export default function JSONGenerator() {
<Switch checked={script.privileged} onCheckedChange={checked => updateScript("privileged", checked)} />
<label>Privileged</label>
</div>
<div className="flex items-center space-x-2">
<Switch checked={script.disable || false} onCheckedChange={checked => updateScript("disable", checked)} />
<label>Disabled</label>
</div>
</div>
{script.disable && (
<div>
<Label>
Disable Description
{" "}
<span className="text-red-500">*</span>
</Label>
<Textarea
placeholder="Explain why this script is disabled..."
value={script.disable_description || ""}
onChange={e => updateScript("disable_description", e.target.value)}
/>
</div>
)}
<Input
placeholder="Interface Port"
type="number"