mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 15:33:12 +09:00
Refactor to use subsribers
This commit is contained in:
16 files changed
+120
-707
No files matched your search
@@ -67,33 +67,12 @@ export class InstanceDetailsListRequest {
|
||||
static Response = jsonArray(InstanceDetails);
|
||||
};
|
||||
|
||||
export class InstanceDetailsSetSubscriptionsRequest {
|
||||
declare ["constructor"]: typeof InstanceDetailsSetSubscriptionsRequest;
|
||||
static type = "request" as const;
|
||||
static src = "control" as const;
|
||||
static dst = "controller" as const;
|
||||
static permission = "core.instance.subscribe" as const;
|
||||
|
||||
constructor(
|
||||
public all: boolean = false,
|
||||
public instanceIds: number[] = [],
|
||||
) { }
|
||||
|
||||
static jsonSchema = Type.Object({
|
||||
"all": Type.Boolean(),
|
||||
"instanceIds": Type.Array(Type.Integer()),
|
||||
});
|
||||
|
||||
static fromJSON(json: Static<typeof this.jsonSchema>) {
|
||||
return new this(json.all, json.instanceIds);
|
||||
}
|
||||
};
|
||||
|
||||
export class InstanceDetailsUpdateEvent {
|
||||
declare ["constructor"]: typeof InstanceDetailsUpdateEvent;
|
||||
static type = "event" as const;
|
||||
static src = "controller" as const;
|
||||
static dst = "control" as const;
|
||||
static permission = "core.instance.subscribe" as const;
|
||||
|
||||
constructor(
|
||||
public details: InstanceDetails,
|
||||
@@ -299,33 +278,12 @@ export class InstanceListSavesRequest {
|
||||
static Response = jsonArray(SaveDetails);
|
||||
}
|
||||
|
||||
export class InstanceSetSaveListSubscriptionsRequest {
|
||||
declare ["constructor"]: typeof InstanceSetSaveListSubscriptionsRequest;
|
||||
static type = "request" as const;
|
||||
static src = "control" as const;
|
||||
static dst = "controller" as const;
|
||||
static permission = "core.instance.save.list_subscribe" as const;
|
||||
|
||||
constructor(
|
||||
public all: boolean = false,
|
||||
public instanceIds: number[] = [],
|
||||
) { }
|
||||
|
||||
static jsonSchema = Type.Object({
|
||||
"all": Type.Boolean(),
|
||||
"instanceIds": Type.Array(Type.Integer()),
|
||||
});
|
||||
|
||||
static fromJSON(json: Static<typeof this.jsonSchema>) {
|
||||
return new this(json.all, json.instanceIds);
|
||||
}
|
||||
};
|
||||
|
||||
export class InstanceSaveListUpdateEvent {
|
||||
declare ["constructor"]: typeof InstanceSaveListUpdateEvent;
|
||||
static type = "event" as const;
|
||||
static src = ["instance", "host", "controller"] as const;
|
||||
static dst = ["controller", "control"] as const;
|
||||
static permission = "core.instance.save.list_subscribe" as const;
|
||||
|
||||
constructor(
|
||||
public instanceId: number,
|
||||
|
||||
Reference in new issue
Block a user