Add Backups card
This commit is contained in:
1 parent
ca45a90930
commit
4b74bc01a7
2 files changed
+60
-3
No files matched your search
@@ -213,6 +213,18 @@ def read_server_info
|
||||
info
|
||||
end
|
||||
|
||||
def read_backups
|
||||
paths = [
|
||||
["rsync", "/backup/last-backup"],
|
||||
["gmail", "/backup/gmail/new"]
|
||||
]
|
||||
entries = paths.map do |label, path|
|
||||
mtime = (File.mtime(path).to_i rescue nil)
|
||||
{ "label" => label, "path" => path, "mtime" => mtime }
|
||||
end
|
||||
{ "type" => "backup", "entries" => entries }
|
||||
end
|
||||
|
||||
def read_mail
|
||||
users = []
|
||||
|
||||
@@ -308,6 +320,7 @@ def handle_info(conn)
|
||||
|
||||
info << read_server_info
|
||||
info << read_mail
|
||||
info << read_backups
|
||||
|
||||
if (ups = read_ups)
|
||||
info << ups
|
||||
|
||||
Reference in new issue
Block a user