mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 01:35:28 +01:00
Add mostly functional front-end for backup exclusions
This commit is contained in:
parent
23a5c228cd
commit
4bcb91d1d5
@ -117,4 +117,4 @@ class Management_Controller:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def del_excluded_backup_dir(server_id: int, dir_to_del: str):
|
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)
|
||||||
|
@ -354,7 +354,7 @@ class helpers_management:
|
|||||||
Servers.update(backup_path=backup_path).where(Servers.server_id == server_id)
|
Servers.update(backup_path=backup_path).where(Servers.server_id == server_id)
|
||||||
Backups.create(**conf)
|
Backups.create(**conf)
|
||||||
logger.debug("Creating new backup record.")
|
logger.debug("Creating new backup record.")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_excluded_backup_dirs(server_id: int):
|
def get_excluded_backup_dirs(server_id: int):
|
||||||
excluded_dirs = helpers_management.get_backup_config(server_id)['excluded_dirs']
|
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)
|
management_helper.set_backup_config(server_id=server_id, excluded_dirs=excluded_dirs)
|
||||||
else:
|
else:
|
||||||
logger.debug(f"Not adding {dir_to_add} to excluded directories - already in the excluded directory list for server ID {server_id}")
|
logger.debug(f"Not adding {dir_to_add} to excluded directories - already in the excluded directory list for server ID {server_id}")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def del_excluded_backup_dir(server_id: int, dir_to_del: str):
|
def del_excluded_backup_dir(server_id: int, dir_to_del: str):
|
||||||
dir_list = management_helper.get_excluded_backup_dirs()
|
dir_list = management_helper.get_excluded_backup_dirs()
|
||||||
|
@ -756,11 +756,18 @@ class Helpers:
|
|||||||
<span id="{dpath}span" class="files-tree-title" data-path="{dpath}" data-name="{filename}" onclick="getDirView(event)">
|
<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"></i>
|
||||||
<i class="far fa-folder-open"></i>
|
<i class="far fa-folder-open"></i>
|
||||||
{filename}
|
<strong>{filename}</strong>
|
||||||
</span>
|
</span>
|
||||||
</input></div><li>
|
</input></div><li>
|
||||||
\n"""\
|
\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
|
return output
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -782,10 +789,18 @@ class Helpers:
|
|||||||
<span id="{dpath}span" class="files-tree-title" data-path="{dpath}" data-name="{filename}" onclick="getDirView(event)">
|
<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"></i>
|
||||||
<i class="far fa-folder-open"></i>
|
<i class="far fa-folder-open"></i>
|
||||||
{filename}
|
<strong>{filename}</strong>
|
||||||
</span>
|
</span>
|
||||||
</input></div><li>"""\
|
</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
|
return output
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user