Skip to content

Commit

Permalink
fix: configure lxc container POST request
Browse files Browse the repository at this point in the history
Signed-off-by: Loc Nguyen <ducloc464@gmail.com>
  • Loading branch information
ducloc464 committed Feb 15, 2025
1 parent 9c3be81 commit 993cc41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions applications/luci-app-lxc/luasrc/controller/lxc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ function lxc_configuration_set(lxc_name)
luci.http.prepare_content("text/plain")

local lxc_configuration = luci.http.formvalue("lxc_conf")
lxc_configuration = luci.http.urldecode(lxc_configuration, true)
if lxc_configuration == nil then
util.perror("lxc error: config formvalue is empty")
return
Expand Down
2 changes: 1 addition & 1 deletion applications/luci-app-lxc/luasrc/view/lxc.htm
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ <h3><%:Create New Container%></h3>
var lxc_name = textarea.dataset['id'];
var lxc_conf = textarea.value;

new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, "lxc_conf=" + encodeURIComponent(lxc_conf),
new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, {"lxc_conf": encodeURIComponent(lxc_conf)},
function(x)
{
if (!x || x.responseText != "0")
Expand Down

0 comments on commit 993cc41

Please sign in to comment.