Bump version to 0.7.8

This commit is contained in:
cuigh 2018-05-02 17:56:25 +08:00
parent 07d2c4bc3b
commit f1b8e1dca8
5 changed files with 4 additions and 139 deletions

View File

@ -2584,7 +2584,6 @@ var Swirl;
validate($form, $input, arg) {
let el = $input[0];
if ($("#type-" + arg).prop("checked")) {
console.log(el.value);
return { ok: el.checkValidity ? el.checkValidity() : true, error: el.validationMessage };
}
return { ok: true };
@ -2682,139 +2681,6 @@ var Swirl;
})(Stack = Swirl.Stack || (Swirl.Stack = {}));
})(Swirl || (Swirl = {}));
var Swirl;
(function (Swirl) {
var Stack;
(function (Stack) {
var Archive;
(function (Archive) {
var Validator = Swirl.Core.Validator;
var Notification = Swirl.Core.Notification;
class ContentRequiredRule {
validate($form, $input, arg) {
let el = $input[0];
if ($("#type-" + arg).prop("checked")) {
console.log(el.value);
return { ok: el.checkValidity ? el.checkValidity() : true, error: el.validationMessage };
}
return { ok: true };
}
}
class EditPage {
constructor() {
Validator.register("content", new ContentRequiredRule(), "");
this.editor = CodeMirror.fromTextArea($("#txt-content")[0], { lineNumbers: true });
$("#file-content").change(e => {
let file = e.target;
if (file.files.length > 0) {
$('#filename').text(file.files[0].name);
}
});
$("#type-input,#type-upload").click(e => {
let type = $(e.target).val();
$("#div-input").toggle(type == "input");
$("#div-upload").toggle(type == "upload");
});
$("#btn-submit").click(this.submit.bind(this));
}
submit(e) {
this.editor.save();
let results = Validator.bind("#div-form").validate();
if (results.length > 0) {
return;
}
let data = new FormData();
data.append('name', $("#name").val());
if ($("#type-input").prop("checked")) {
data.append('content', $('#txt-content').val());
}
else {
let file = $('#file-content')[0];
data.append('content', file.files[0]);
}
let url = $(e.target).data("url") || "";
$ajax.post(url, data).encoder("none").trigger(e.target).json((r) => {
if (r.success) {
location.href = "/stack/archive/";
}
else {
Notification.show("danger", `FAILED: ${r.message}`);
}
});
}
}
Archive.EditPage = EditPage;
})(Archive = Stack.Archive || (Stack.Archive = {}));
})(Stack = Swirl.Stack || (Swirl.Stack = {}));
})(Swirl || (Swirl = {}));
var Swirl;
(function (Swirl) {
var Stack;
(function (Stack) {
var Archive;
(function (Archive) {
var Modal = Swirl.Core.Modal;
var Dispatcher = Swirl.Core.Dispatcher;
class ListPage {
constructor() {
let dispatcher = Dispatcher.bind("#table-items");
dispatcher.on("deploy-archive", this.deployArchive.bind(this));
dispatcher.on("delete-archive", this.deleteArchive.bind(this));
}
deployArchive(e) {
let $tr = $(e.target).closest("tr");
let id = $tr.data("id");
let name = $tr.find("td:first").text().trim();
Modal.confirm(`Are you sure to deploy archive: <strong>${name}</strong>?`, "Deploy archive", (dlg, e) => {
$ajax.post("deploy", { id: id }).trigger(e.target).encoder("form").json(r => {
dlg.close();
});
});
}
deleteArchive(e) {
let $tr = $(e.target).closest("tr");
let id = $tr.data("id");
let name = $tr.find("td:first").text().trim();
Modal.confirm(`Are you sure to remove archive: <strong>${name}</strong>?`, "Delete archive", (dlg, e) => {
$ajax.post("delete", { id: id }).trigger(e.target).encoder("form").json(r => {
$tr.remove();
dlg.close();
});
});
}
}
Archive.ListPage = ListPage;
})(Archive = Stack.Archive || (Stack.Archive = {}));
})(Stack = Swirl.Stack || (Swirl.Stack = {}));
})(Swirl || (Swirl = {}));
var Swirl;
(function (Swirl) {
var Stack;
(function (Stack) {
var Task;
(function (Task) {
var Modal = Swirl.Core.Modal;
var Dispatcher = Swirl.Core.Dispatcher;
class ListPage {
constructor() {
let dispatcher = Dispatcher.bind("#table-items");
dispatcher.on("delete-stack", this.deleteStack.bind(this));
}
deleteStack(e) {
let $tr = $(e.target).closest("tr");
let name = $tr.find("td:first").text().trim();
Modal.confirm(`Are you sure to remove stack: <strong>${name}</strong>?`, "Delete stack", (dlg, e) => {
$ajax.post("delete", { name: name }).trigger(e.target).encoder("form").json(r => {
$tr.remove();
dlg.close();
});
});
}
}
Task.ListPage = ListPage;
})(Task = Stack.Task || (Stack.Task = {}));
})(Stack = Swirl.Stack || (Swirl.Stack = {}));
})(Swirl || (Swirl = {}));
var Swirl;
(function (Swirl) {
var User;
(function (User) {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,6 @@ namespace Swirl.Stack {
validate($form: JQuery, $input: JQuery, arg?: string): {ok: boolean, error?: string} {
let el = <HTMLInputElement>$input[0];
if ($("#type-" + arg).prop("checked")) {
console.log(el.value);
return {ok: el.checkValidity ? el.checkValidity() : true, error: el.validationMessage};
}
return {ok: true}

View File

@ -28,7 +28,7 @@ func main() {
misc.BindOptions()
app.Name = "Swirl"
app.Version = "0.7.7"
app.Version = "0.7.8"
app.Desc = "A web management UI for Docker, focused on swarm cluster"
app.Action = func(ctx *app.Context) {
err := config.UnmarshalOption("swirl", &misc.Options)

View File

@ -55,8 +55,8 @@
<div class="card-content">
<article class="media">
<figure class="media-left">
{{ if .Type == "value" }}
<i class="fas fa-bullseye fa-4x"></i>
{{ if .Type == "gauge" }}
<i class="fas fa-tachometer-alt fa-4x"></i>
{{ else }}
<i class="fas fa-chart-{{ .Type }} fa-4x"></i>
{{ end }}