mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 15:30:41 +09:00
Merge pull request #577 from Hornwitser/small-things-15
Small things 15
This commit is contained in:
7 files changed
+15
-5
No files matched your search
@@ -18,6 +18,7 @@
|
||||
- Fixed host hanging if stopped while an instance is in the process of creating a save during startup.
|
||||
- Fixed `instance.auto_start` option.
|
||||
- Fixed host log spammed with errors when plugins broadcast messages to instances with the plugin disabled.
|
||||
- Fixed properties of object config fields not being possible to remove.
|
||||
|
||||
|
||||
## Version 2.0.0-alpha.14
|
||||
|
||||
@@ -459,7 +459,7 @@ export class Config<
|
||||
setProp<Field extends keyof Fields & string>(
|
||||
name: Field,
|
||||
prop: string,
|
||||
value: unknown,
|
||||
value?: unknown,
|
||||
location = this.location,
|
||||
) {
|
||||
let def = this.constructor.fieldDefinitions[name];
|
||||
|
||||
@@ -87,7 +87,7 @@ export class Address {
|
||||
}
|
||||
|
||||
toString() {
|
||||
const typeMap = ["controller", "instance", "host", "control"];
|
||||
const typeMap = ["controller", "host", "instance", "control"];
|
||||
const type = typeMap[this.type] || this.type;
|
||||
if (this.type === Address.broadcast) {
|
||||
return `[Address ${type}:${typeMap[this.id] || this.id}]`;
|
||||
|
||||
@@ -208,7 +208,7 @@ export class InstanceConfigSetPropRequest {
|
||||
"instanceId": Type.Integer(),
|
||||
"field": Type.String(),
|
||||
"prop": Type.String(),
|
||||
"value": Type.Unknown(),
|
||||
"value": Type.Optional(Type.Unknown()),
|
||||
});
|
||||
|
||||
static fromJSON(json: Static<typeof this.jsonSchema>) {
|
||||
|
||||
@@ -73,7 +73,7 @@ export class WebConsoleFormat {
|
||||
transform(info: any, _options: object) {
|
||||
let src = " ";
|
||||
if (info.host_id !== undefined) {
|
||||
src += `s:${info.host_name} - `;
|
||||
src += `h:${info.host_name} - `;
|
||||
}
|
||||
if (info.instance_id !== undefined) {
|
||||
src += `i:${info.instance_name}`;
|
||||
|
||||
@@ -163,7 +163,7 @@ export class TerminalFormat {
|
||||
src += `i:${info.instance_name} `;
|
||||
|
||||
} else if (info.host_name) {
|
||||
src += `s:${info.host_name} `;
|
||||
src += `h:${info.host_name} `;
|
||||
}
|
||||
if (info.plugin) {
|
||||
src += `${info.plugin}: `;
|
||||
|
||||
@@ -557,6 +557,15 @@ describe("Integration of Clusterio", function() {
|
||||
slowTest(this);
|
||||
await checkInstanceStatus(44, "running");
|
||||
});
|
||||
it("should allow creating and removing props", async function() {
|
||||
slowTest(this);
|
||||
await execCtl("instance config set-prop test factorio.settings new_property new-string-value");
|
||||
let config = await getControl().send(new lib.InstanceConfigGetRequest(44));
|
||||
assert.equal(config["factorio.settings"]["new_property"], "new-string-value");
|
||||
await execCtl("instance config set-prop test factorio.settings new_property");
|
||||
config = await getControl().send(new lib.InstanceConfigGetRequest(44));
|
||||
assert.equal(config["factorio.settings"]["new_property"], undefined);
|
||||
});
|
||||
});
|
||||
|
||||
describe("user set-admin/whitelisted/banned", function() {
|
||||
|
||||
Reference in new issue
Block a user