mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-22 17:14:22 +00:00
Fix lint errors
This commit is contained in:
12
webui/package-lock.json
generated
12
webui/package-lock.json
generated
@@ -31,7 +31,6 @@
|
|||||||
"@testing-library/jest-dom": "^6.9.1",
|
"@testing-library/jest-dom": "^6.9.1",
|
||||||
"@testing-library/react": "^16.3.0",
|
"@testing-library/react": "^16.3.0",
|
||||||
"@testing-library/user-event": "^14.6.1",
|
"@testing-library/user-event": "^14.6.1",
|
||||||
"@types/eslint__js": "^9.14.0",
|
|
||||||
"@types/node": "^24.10.1",
|
"@types/node": "^24.10.1",
|
||||||
"@types/react": "^19.2.4",
|
"@types/react": "^19.2.4",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
@@ -2557,17 +2556,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/eslint__js": {
|
|
||||||
"version": "9.14.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/eslint__js/-/eslint__js-9.14.0.tgz",
|
|
||||||
"integrity": "sha512-s0jepCjOJWB/GKcuba4jISaVpBudw3ClXJ3fUK4tugChUMQsp6kSwuA8Dcx6wFd/JsJqcY8n4rEpa5RTHs5ypA==",
|
|
||||||
"deprecated": "This is a stub types definition. @eslint/js provides its own type definitions, so you do not need this installed.",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@eslint/js": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/estree": {
|
"node_modules/@types/estree": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
"@testing-library/jest-dom": "^6.9.1",
|
"@testing-library/jest-dom": "^6.9.1",
|
||||||
"@testing-library/react": "^16.3.0",
|
"@testing-library/react": "^16.3.0",
|
||||||
"@testing-library/user-event": "^14.6.1",
|
"@testing-library/user-event": "^14.6.1",
|
||||||
"@types/eslint__js": "^9.14.0",
|
|
||||||
"@types/node": "^24.10.1",
|
"@types/node": "^24.10.1",
|
||||||
"@types/react": "^19.2.4",
|
"@types/react": "^19.2.4",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import NumberInput from '@/components/form/NumberInput'
|
|||||||
|
|
||||||
interface AutoRestartConfigurationProps {
|
interface AutoRestartConfigurationProps {
|
||||||
formData: CreateInstanceOptions
|
formData: CreateInstanceOptions
|
||||||
onChange: (key: keyof CreateInstanceOptions, value: any) => void
|
onChange: <K extends keyof CreateInstanceOptions>(key: K, value: CreateInstanceOptions[K]) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const AutoRestartConfiguration: React.FC<AutoRestartConfigurationProps> = ({
|
const AutoRestartConfiguration: React.FC<AutoRestartConfigurationProps> = ({
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ import type { CreateInstanceOptions } from '@/types/instance'
|
|||||||
import { getBasicBackendFields, getAdvancedBackendFields } from '@/lib/zodFormUtils'
|
import { getBasicBackendFields, getAdvancedBackendFields } from '@/lib/zodFormUtils'
|
||||||
import BackendFormField from '@/components/BackendFormField'
|
import BackendFormField from '@/components/BackendFormField'
|
||||||
|
|
||||||
|
type BackendFieldValue = string | number | boolean | string[] | Record<string, string> | undefined
|
||||||
|
|
||||||
interface BackendConfigurationProps {
|
interface BackendConfigurationProps {
|
||||||
formData: CreateInstanceOptions
|
formData: CreateInstanceOptions
|
||||||
onBackendFieldChange: (key: string, value: any) => void
|
onBackendFieldChange: (key: string, value: BackendFieldValue) => void
|
||||||
showAdvanced?: boolean
|
showAdvanced?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,7 +28,7 @@ const BackendConfiguration: React.FC<BackendConfigurationProps> = ({
|
|||||||
<BackendFormField
|
<BackendFormField
|
||||||
key={fieldKey}
|
key={fieldKey}
|
||||||
fieldKey={fieldKey}
|
fieldKey={fieldKey}
|
||||||
value={(formData.backend_options as any)?.[fieldKey]}
|
value={(formData.backend_options as Record<string, BackendFieldValue> | undefined)?.[fieldKey]}
|
||||||
onChange={onBackendFieldChange}
|
onChange={onBackendFieldChange}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
@@ -41,7 +43,7 @@ const BackendConfiguration: React.FC<BackendConfigurationProps> = ({
|
|||||||
<BackendFormField
|
<BackendFormField
|
||||||
key={fieldKey}
|
key={fieldKey}
|
||||||
fieldKey={fieldKey}
|
fieldKey={fieldKey}
|
||||||
value={(formData.backend_options as any)?.[fieldKey]}
|
value={(formData.backend_options as Record<string, BackendFieldValue> | undefined)?.[fieldKey]}
|
||||||
onChange={onBackendFieldChange}
|
onChange={onBackendFieldChange}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
@@ -53,7 +55,7 @@ const BackendConfiguration: React.FC<BackendConfigurationProps> = ({
|
|||||||
<BackendFormField
|
<BackendFormField
|
||||||
key="extra_args"
|
key="extra_args"
|
||||||
fieldKey="extra_args"
|
fieldKey="extra_args"
|
||||||
value={(formData.backend_options as any)?.extra_args}
|
value={(formData.backend_options as Record<string, BackendFieldValue> | undefined)?.extra_args}
|
||||||
onChange={onBackendFieldChange}
|
onChange={onBackendFieldChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -70,37 +70,37 @@ function TestComponent() {
|
|||||||
|
|
||||||
{/* Action buttons for testing with specific instances */}
|
{/* Action buttons for testing with specific instances */}
|
||||||
<button
|
<button
|
||||||
onClick={() => createInstance("new-instance", { backend_type: BackendType.LLAMA_CPP, backend_options: { model: "test.gguf" } })}
|
onClick={() => void createInstance("new-instance", { backend_type: BackendType.LLAMA_CPP, backend_options: { model: "test.gguf" } })}
|
||||||
data-testid="create-instance"
|
data-testid="create-instance"
|
||||||
>
|
>
|
||||||
Create Instance
|
Create Instance
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => updateInstance("instance1", { backend_type: BackendType.LLAMA_CPP, backend_options: { model: "updated.gguf" } })}
|
onClick={() => void updateInstance("instance1", { backend_type: BackendType.LLAMA_CPP, backend_options: { model: "updated.gguf" } })}
|
||||||
data-testid="update-instance"
|
data-testid="update-instance"
|
||||||
>
|
>
|
||||||
Update Instance
|
Update Instance
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => startInstance("instance2")}
|
onClick={() => void startInstance("instance2")}
|
||||||
data-testid="start-instance"
|
data-testid="start-instance"
|
||||||
>
|
>
|
||||||
Start Instance2
|
Start Instance2
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => stopInstance("instance1")}
|
onClick={() => void stopInstance("instance1")}
|
||||||
data-testid="stop-instance"
|
data-testid="stop-instance"
|
||||||
>
|
>
|
||||||
Stop Instance1
|
Stop Instance1
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => restartInstance("instance1")}
|
onClick={() => void restartInstance("instance1")}
|
||||||
data-testid="restart-instance"
|
data-testid="restart-instance"
|
||||||
>
|
>
|
||||||
Restart Instance1
|
Restart Instance1
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => deleteInstance("instance2")}
|
onClick={() => void deleteInstance("instance2")}
|
||||||
data-testid="delete-instance"
|
data-testid="delete-instance"
|
||||||
>
|
>
|
||||||
Delete Instance2
|
Delete Instance2
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowSyntheticDefaultImports": true
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"include": ["vite.config.ts"]
|
"include": ["vite.config.ts"]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user