mirror of
https://github.com/cuigh/swirl
synced 2025-01-02 17:16:37 +00:00
Allow updating replicas of service to zero
This commit is contained in:
parent
42f3ad8b23
commit
260bf8313b
@ -1535,7 +1535,7 @@ var Swirl;
|
|||||||
if (this.$mode.val() == "global") {
|
if (this.$mode.val() == "global") {
|
||||||
return { ok: true };
|
return { ok: true };
|
||||||
}
|
}
|
||||||
const regex = /^[1-9]\d*$/;
|
const regex = /^(0|[1-9]\d*)$/;
|
||||||
return { ok: regex.test($.trim($input.val())) };
|
return { ok: regex.test($.trim($input.val())) };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1712,7 +1712,7 @@ var Swirl;
|
|||||||
new PreferenceTable("#table-preferences");
|
new PreferenceTable("#table-preferences");
|
||||||
this.secret = new ConfigTable("#table-secrets");
|
this.secret = new ConfigTable("#table-secrets");
|
||||||
this.config = new ConfigTable("#table-configs");
|
this.config = new ConfigTable("#table-configs");
|
||||||
Validator.register("service-mode", new ServiceModeRule(this.$mode), "Please input a positive integer.");
|
Validator.register("service-mode", new ServiceModeRule(this.$mode), "Please input a valid integer.");
|
||||||
this.$mode.change(e => this.$replicas.toggle(this.$mode.val() != "global"));
|
this.$mode.change(e => this.$replicas.toggle(this.$mode.val() != "global"));
|
||||||
$("#btn-add-secret").click(() => EditPage.addConfig(this.secret));
|
$("#btn-add-secret").click(() => EditPage.addConfig(this.secret));
|
||||||
$("#btn-add-config").click(() => EditPage.addConfig(this.config));
|
$("#btn-add-config").click(() => EditPage.addConfig(this.config));
|
||||||
|
File diff suppressed because one or more lines are too long
@ -18,7 +18,7 @@ namespace Swirl.Service {
|
|||||||
return { ok: true }
|
return { ok: true }
|
||||||
}
|
}
|
||||||
|
|
||||||
const regex = /^[1-9]\d*$/;
|
const regex = /^(0|[1-9]\d*)$/;
|
||||||
return { ok: regex.test($.trim($input.val())) };
|
return { ok: regex.test($.trim($input.val())) };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ namespace Swirl.Service {
|
|||||||
this.config = new ConfigTable("#table-configs");
|
this.config = new ConfigTable("#table-configs");
|
||||||
|
|
||||||
// register custom validators
|
// register custom validators
|
||||||
Validator.register("service-mode", new ServiceModeRule(this.$mode), "Please input a positive integer.");
|
Validator.register("service-mode", new ServiceModeRule(this.$mode), "Please input a valid integer.");
|
||||||
|
|
||||||
// bind events
|
// bind events
|
||||||
this.$mode.change(e => this.$replicas.toggle(this.$mode.val() != "global"))
|
this.$mode.change(e => this.$replicas.toggle(this.$mode.val() != "global"))
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
<input id="txt-replicas" name="replicas" class="input" placeholder="" data-type="integer" data-v-rule="service-mode" {{if .Service.Mode == "global"}}style="display: none"{{else}}value="{{ trimZero(.Service.Replicas) }}"{{end}}>
|
<input id="txt-replicas" name="replicas" class="input" placeholder="" data-type="integer" data-v-rule="service-mode" {{if .Service.Mode == "global"}}style="display: none"{{else}}value="{{ .Service.Replicas }}"{{end}}>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{{ extends "base" }}
|
{{ extends "_base" }}
|
||||||
{{ import "../_modules/detail" }}
|
{{ import "../_modules/detail" }}
|
||||||
|
|
||||||
{{ block body_content() }}
|
{{ block body_content() }}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{{ extends "base" }}
|
{{ extends "_base" }}
|
||||||
{{ import "../_modules/service" }}
|
{{ import "../_modules/service" }}
|
||||||
|
|
||||||
{{ block script() }}
|
{{ block script() }}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{{ extends "base" }}
|
{{ extends "_base" }}
|
||||||
{{ import "../_modules/pager" }}
|
{{ import "../_modules/pager" }}
|
||||||
|
|
||||||
{{ block script() }}
|
{{ block script() }}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{{ extends "base" }}
|
{{ extends "_base" }}
|
||||||
|
|
||||||
{{ block body_content() }}
|
{{ block body_content() }}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{{ extends "base" }}
|
{{ extends "_base" }}
|
||||||
{{ import "../_modules/service" }}
|
{{ import "../_modules/service" }}
|
||||||
|
|
||||||
{{ block script() }}
|
{{ block script() }}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{{ extends "base" }}
|
{{ extends "_base" }}
|
||||||
|
|
||||||
{{ block style() }}
|
{{ block style() }}
|
||||||
<link rel="stylesheet" href="/highlight/highlight.css?v=9.12">
|
<link rel="stylesheet" href="/highlight/highlight.css?v=9.12">
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{{ extends "base" }}
|
{{ extends "_base" }}
|
||||||
{{ import "../../_modules/service" }}
|
{{ import "../../_modules/service" }}
|
||||||
|
|
||||||
{{ block script() }}
|
{{ block script() }}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{{ extends "base" }}
|
{{ extends "_base" }}
|
||||||
{{ import "../../_modules/pager" }}
|
{{ import "../../_modules/pager" }}
|
||||||
|
|
||||||
{{ block script() }}
|
{{ block script() }}
|
||||||
|
Loading…
Reference in New Issue
Block a user