Only support changing server dir in non-docker env

This commit is contained in:
amcmanu3 2023-02-12 12:29:05 -05:00
parent fdf7bd7621
commit dd317a3460
3 changed files with 8 additions and 1 deletions

View File

@ -590,6 +590,12 @@ class AjaxHandler(BaseHandler):
if not superuser:
self.redirect("/panel/error?error=Not a super user")
return
if self.helper.is_env_docker():
self.redirect(
"/panel/error?error=This feature is not"
" supported on docker environments"
)
return
new_dir = urllib.parse.unquote(self.get_argument("server_dir"))
self.controller.update_master_server_dir(new_dir, exec_user["user_id"])
return

View File

@ -290,6 +290,7 @@ class PanelHandler(BaseHandler):
page_data: t.Dict[str, t.Any] = {
# todo: make this actually pull and compare version data
"update_available": self.helper.update_available,
"docker": self.helper.is_env_docker(),
"background": self.controller.cached_login,
"login_opacity": self.controller.management.get_login_opacity(),
"serverTZ": tz,

View File

@ -230,7 +230,7 @@
</div>
</div>
</div>
{% if data['superuser'] %}
{% if data['superuser'] and not data["docker"] %}
<div class="row">
<div class="col-md-12 col-lg-12 grid-margin stretch-card">
<div class="card">