Add mostly functional front-end for backup exclusions

This commit is contained in:
Andrew 2022-02-27 16:37:48 -05:00
parent 23a5c228cd
commit 4bcb91d1d5
3 changed files with 20 additions and 5 deletions

View File

@ -117,4 +117,4 @@ class Management_Controller:
@staticmethod
def del_excluded_backup_dir(server_id: int, dir_to_del: str):
management_helper.del_excluded_backup_dir(server_id, dir_to_del)
management_helper.del_excluded_backup_dir(server_id, dir_to_del)

View File

@ -354,7 +354,7 @@ class helpers_management:
Servers.update(backup_path=backup_path).where(Servers.server_id == server_id)
Backups.create(**conf)
logger.debug("Creating new backup record.")
@staticmethod
def get_excluded_backup_dirs(server_id: int):
excluded_dirs = helpers_management.get_backup_config(server_id)['excluded_dirs']
@ -370,7 +370,7 @@ class helpers_management:
management_helper.set_backup_config(server_id=server_id, excluded_dirs=excluded_dirs)
else:
logger.debug(f"Not adding {dir_to_add} to excluded directories - already in the excluded directory list for server ID {server_id}")
@staticmethod
def del_excluded_backup_dir(server_id: int, dir_to_del: str):
dir_list = management_helper.get_excluded_backup_dirs()

View File

@ -756,11 +756,18 @@ class Helpers:
<span id="{dpath}span" class="files-tree-title" data-path="{dpath}" data-name="{filename}" onclick="getDirView(event)">
<i class="far fa-folder"></i>
<i class="far fa-folder-open"></i>
{filename}
<strong>{filename}</strong>
</span>
</input></div><li>
\n"""\
else:
output += f"""<li
class="tree-item tree-ctx-item tree-file"
data-path="{dpath}"
data-name="{filename}"
onclick=""><input type='checkbox' name='root_path' value='{dpath}'><span style="margin-right: 6px;"><i class="far fa-file"></i></span></input>{filename}</li>"""
return output
@staticmethod
@ -782,10 +789,18 @@ class Helpers:
<span id="{dpath}span" class="files-tree-title" data-path="{dpath}" data-name="{filename}" onclick="getDirView(event)">
<i class="far fa-folder"></i>
<i class="far fa-folder-open"></i>
{filename}
<strong>{filename}</strong>
</span>
</input></div><li>"""\
else:
output += f"""<li
class="tree-item tree-ctx-item tree-file"
data-path="{dpath}"
data-name="{filename}"
onclick=""><input type='checkbox' name='root_path' value='{dpath}'><span style="margin-right: 6px;"><i class="far fa-file"></i></span></input>{filename}</li>"""
return output
@staticmethod