Add hidden and readonly config property

This commit is contained in:
Cooldude2606 committed 2024-09-21 01:52:01 +01:00
1 parent 3e6806ff0e
commit e3eb266704
4 files changed
+20 -4

No files matched your search

+9
View File
@@ -122,6 +122,15 @@ export interface FieldDefinition {
* from the locations specified.
*/
credential?: ConfigLocation[];
/**
* True if graphical interfaces should prevent the user modifying the value
* This is client side and does not provide any validation logic
*/
readonly?: boolean;
/**
* True if graphical interfaces should hide the config value
*/
hidden?: boolean;
}
export type ConfigDefs<Fields> = {
+3
View File
@@ -223,6 +223,7 @@ export class HostConfig extends classes.Config<HostConfigFields> {
description: "ID of the host",
type: "number",
initialValue: () => Math.random() * 2**31 | 0,
hidden: true,
},
"host.factorio_directory": {
description: "Path to directory to look for factorio installs",
@@ -345,10 +346,12 @@ export class InstanceConfig extends classes.Config<InstanceConfigFields> {
description: "ID of the instance",
type: "number",
initialValue: () => Math.random() * 2**31 | 0,
hidden: true,
},
"instance.assigned_host": {
type: "number",
optional: true,
hidden: true,
},
"instance.auto_start": {
description: "Automatically start this instance when the host hosting it is started up",