Adjust API calls for snapshot option

This commit is contained in:
= 2024-12-13 22:57:25 -05:00
parent fcd1a806f8
commit a4256b66e8
2 changed files with 7 additions and 4 deletions

View File

@ -1331,6 +1331,7 @@ class PanelHandler(BaseHandler):
server_id = self.get_argument("id", None)
backup_id = self.get_argument("backup_id", None)
page_data["active_link"] = "backups"
page_data["new_backup"] = True
page_data["permissions"] = {
"Commands": EnumPermissionsServer.COMMANDS,
"Terminal": EnumPermissionsServer.TERMINAL,

View File

@ -8,7 +8,7 @@ from app.classes.web.base_api_handler import BaseApiHandler
logger = logging.getLogger(__name__)
backup_patch_schema = {
backup_schema = {
"type": "object",
"properties": {
"backup_name": {"type": "string", "minLength": 3, "error": "backupName"},
@ -48,12 +48,13 @@ backup_patch_schema = {
"error": "typeList",
"fill": True,
},
"snapshot": {"type": "boolean", "error": "typeBool", "fill": True},
},
"additionalProperties": False,
"minProperties": 1,
}
basic_backup_patch_schema = {
basic_backup_schema = {
"type": "object",
"properties": {
"backup_name": {"type": "string", "minLength": 3, "error": "backupName"},
@ -87,6 +88,7 @@ basic_backup_patch_schema = {
"error": "typeList",
"fill": True,
},
"snapshot": {"type": "boolean", "error": "typeBool", "fill": True},
},
"additionalProperties": False,
"minProperties": 1,
@ -135,9 +137,9 @@ class ApiServersServerBackupsIndexHandler(BaseApiHandler):
try:
if auth_data[4]["superuser"]:
validate(data, backup_patch_schema)
validate(data, backup_schema)
else:
validate(data, basic_backup_patch_schema)
validate(data, basic_backup_schema)
except ValidationError as why:
offending_key = ""
if why.schema.get("fill", None):