diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-05-19 14:46:59 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-05-19 14:46:59 +0000 |
commit | d70b5178ca41a9e6f5643773df421398c19f73e0 (patch) | |
tree | d650c0f001d6c0cedf8cac4c43580bb6aef9b20e | |
parent | 9404f82db56a6f8fdd3631ce54890ddb7f4ee88c (diff) | |
download | acf-alpine-conf-d70b5178ca41a9e6f5643773df421398c19f73e0.tar.bz2 acf-alpine-conf-d70b5178ca41a9e6f5643773df421398c19f73e0.tar.xz |
Added comments for deletebackupfile, if want to implement it in the future
-rw-r--r-- | lbu-controller.lua | 2 | ||||
-rw-r--r-- | lbu-model.lua | 28 |
2 files changed, 3 insertions, 27 deletions
diff --git a/lbu-controller.lua b/lbu-controller.lua index 64a479c..124a9d5 100644 --- a/lbu-controller.lua +++ b/lbu-controller.lua @@ -35,7 +35,7 @@ function listbackups(self) end --[[ function deletebackup(self) - return self:redirect_to_referrer(self.model.deletebackupfile(self.clientdata.backup)) + return self.handle_form(self, self.model.get_deletebackup, self.model.deletebackupfile, self.clientdata, "Delete", "Delete backup file", "Backup file deleted") end --]] function selectbackup(self) diff --git a/lbu-model.lua b/lbu-model.lua index 1022e32..14d025b 100644 --- a/lbu-model.lua +++ b/lbu-model.lua @@ -178,6 +178,7 @@ local function validatefilecontent (filedetails) return success, filedetails end --[[ +-- FIXME - now the USB is mounted readonly by default, so have to check that too local was_mounted local mnt local function mount() @@ -398,32 +399,7 @@ function commit(self, input) return input end --[[ -function getbackupfiles() - mount() - local files = {} - local selected - local f = io.popen("ls "..mnt.."/*.[0-9]*[0-9].tar.gz") - for line in f:lines() do - files[#files + 1] = line - end - f:close() - if #files then - f = io.popen("date -u -r "..mnt.."/*.apkovl.tar.gz +%Y%m%d%H%m%S") - selected = string.match(files[1], "^[^.]*.") .. f:read("*l") .. ".tar.gz" - end - unmount() - return cfe({ type="list", value=files, label="Backup archive list", selected = selected }) -end - -function selectbackupfile(file) - mount() - if string.find(file, "^"..mnt) and fs.is_file(file) then - local f = io.popen("cp -p "..file.." "..string.match(file, "^[^.]*.").."apkovl.tar.gz") - f:close() - end - unmount() -end - +-- FIXME - create get_deletebackupfile function and modify for use with handle_form function deletebackupfile(file) mount() if string.find(file, "^"..mnt) and fs.is_file(file) then |