diff options
author | Dirk Brenken <dev@brenken.org> | 2018-05-27 20:52:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-27 20:52:31 +0200 |
commit | 31dfa80d4fb4826e77aec0a1b09b19690eba134d (patch) | |
tree | 93cfee01e4e2980e35376f3cfd252cb0b98541c4 /applications/luci-app-lxc/luasrc/view/lxc.htm | |
parent | 247754431b321d643c9f0431e178eef37ef2865c (diff) | |
parent | d9b6c5dd781fec6603e7941b72774b9af140e858 (diff) |
Merge pull request #1828 from dibdot/lxc_fix
luci-app-lxc: fix "plain-vanilla" integration, part 2
Diffstat (limited to 'applications/luci-app-lxc/luasrc/view/lxc.htm')
-rw-r--r-- | applications/luci-app-lxc/luasrc/view/lxc.htm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/applications/luci-app-lxc/luasrc/view/lxc.htm b/applications/luci-app-lxc/luasrc/view/lxc.htm index 5b1fb0411c..e02c3a7888 100644 --- a/applications/luci-app-lxc/luasrc/view/lxc.htm +++ b/applications/luci-app-lxc/luasrc/view/lxc.htm @@ -107,9 +107,9 @@ table.cbi-section-table td, function lxc_create(tr) { - var lxc_name = tr.querySelector("#tx_name").value.replace(/\s/g,'') + var lxc_name = tr.querySelector("#tx_name").value.replace(/[\s!@#$%^&*()+=\[\]{};':"\\|,<>\/?]/g,'') var lxc_template = tr.querySelector("#s_template").value - var bt_create = tr.querySelector("#bt_create") + var bt_create = tr.querySelector("#bt_create") if (t_lxc_list.querySelector("[data-id='" + lxc_name + "']") != null) return info_message(output_add, "Container with that name already exists!", 4000) @@ -224,6 +224,14 @@ table.cbi-section-table td, else if (action == "destroy") { + var tr = self.parentNode.parentNode + var img = tr.querySelector('img') + if (img.getAttribute('src') != window.img["red"]) + { + bt_action.disabled = false + return info_message(output_list,"Container is still running!") + } + if (!confirm("This will completely remove a stopped LXC container from disk. Are you sure?")) return @@ -396,7 +404,7 @@ table.cbi-section-table td, row.id = 'tr_holder' var cell = row.insertCell(0); cell.colSpan = 3; - cell.innerHTML = '<em><br />There are no templates for your architecture (<%=target%>) available, please select another Containers URL.</em>'; + cell.innerHTML = '<em><br />There are no templates for your architecture (<%=target%>) available, please select another containers URL.</em>'; } function lxc_list_update() |