Add config cloning on instance creation (#747)

* Add instance config cloning on creation

* Add test for instance cloning

* Add tooltip to copy config button
This commit is contained in:
Cooldude2606 authored and GitHub committed 2025-04-06 02:00:08 +01:00
1 parent 0055f28f45
commit ce85149b4c
6 files changed
+63 -10

No files matched your search

+3 -1
View File
@@ -137,14 +137,16 @@ export class InstanceCreateRequest {
constructor(
public config: Static<typeof InstanceConfig.jsonSchema>,
public cloneFromId?: number,
) { }
static jsonSchema = Type.Object({
"config": InstanceConfig.jsonSchema,
"cloneFromId": Type.Optional(Type.Number()),
});
static fromJSON(json: Static<typeof this.jsonSchema>) {
return new this(json.config);
return new this(json.config, json.cloneFromId);
}
}