summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lbu-commit-html.lsp3
-rw-r--r--lbu-controller.lua7
-rw-r--r--lbu-model.lua10
-rw-r--r--lbu-status-html.lsp4
4 files changed, 15 insertions, 9 deletions
diff --git a/lbu-commit-html.lsp b/lbu-commit-html.lsp
index 6164739..ffba7a4 100644
--- a/lbu-commit-html.lsp
+++ b/lbu-commit-html.lsp
@@ -22,6 +22,9 @@
<H2>Save to media</h2>
<form name="cmd" action="" method="POST">
<dl>
+ <dt>Remove existing apk.ovls from media</dt>
+ <dd><input type="checkbox" class="checkbox" name="lbucleanmedia" >
+<p class=attention>Attention!</p><p>By checking this box, you remove all existing archives from the <?= view.status.LBU_MEDIA ?> when commiting (adding the '-d' flag to the commit action).<br>This needs to be done when you want/dont want to encrypt your archive and there already exists archives on the media.<BR>There can only be one sort of arcive on the media.</dd>
<dt>Simulate/Test a commit</dt>
<dd><input type=submit class="submit" name="lbusimulate" value="simulate" ></dd>
<dt>Actually Commit and save changes</dt>
diff --git a/lbu-controller.lua b/lbu-controller.lua
index bd08d1d..c13bc5c 100644
--- a/lbu-controller.lua
+++ b/lbu-controller.lua
@@ -63,14 +63,17 @@ end
function commit(self)
local cmdresult
local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller
+ local cmdflag = nil
+ if (self.clientdata.lbucleanmedia) then cmdflag = "-d" else cmdflag = "" end
if (self.clientdata.lbusimulate) then
- cmdresult = self.model:getsimulate()
+ cmdresult = self.model:getsimulate(cmdflag)
end
if (self.clientdata.lbucommit) then
- cmdresult = self.model:getcommit()
+ cmdresult = self.model:getcommit(cmdflag)
end
return ( {status = self.model:getstatus(),
cmdresult = cmdresult,
+ cmdflag = cmdflag,
clientdata = self.clientdata,
url = url, } )
end
diff --git a/lbu-model.lua b/lbu-model.lua
index e239496..b0f5cf7 100644
--- a/lbu-model.lua
+++ b/lbu-model.lua
@@ -109,11 +109,13 @@ function list(self)
return ret
end
-function getcommit()
- return getLbuCommit("-v")
+function getcommit(self, flag)
+ if flag ~= "-d" then flag = "" end
+ return getLbuCommit("-v " .. flag)
end
-function getsimulate()
- return getLbuCommit("-n")
+function getsimulate(self, flag)
+ if flag ~= "-d" then flag = "" end
+ return getLbuCommit("-n " .. flag)
end
function getconfig ()
diff --git a/lbu-status-html.lsp b/lbu-status-html.lsp
index 796212b..856a050 100644
--- a/lbu-status-html.lsp
+++ b/lbu-status-html.lsp
@@ -16,10 +16,8 @@
<dt>Archives will be saved to</dt>
<dd><?= view.status.LBU_MEDIA ?></DD>
<? end ?>
-<? if (view.status.ENCRYPTION) then ?>
<dt>Archives will be encrypted</dt>
- <dd>yes <I>(Using cipher: <?= view.status.DEFAULT_CIPHER or "unknown" ?>)</I></DD>
-<? end ?>
+ <dd><? if (view.status.ENCRYPTION) then io.write("yes <I>(Using cipher: " ..view.status.DEFAULT_CIPHER .. ")</I>") else io.write("No") end ?></DD>
</dl>
<H2>CHANGES SINCE LAST COMMIT</H2>