mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 07:30:41 +09:00
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:
1 parent
0055f28f45
commit
ce85149b4c
6 files changed
+63
-10
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user