diff --git a/CHANGELOG.md b/CHANGELOG.md index d81afb9f..917cc3a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ ### New features TBD ### Bug fixes -TBD +- Remove webhook `custom` option from webook provider list as it's not currently an option ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/664)) ### Tweaks -TBD +- Homogenize Panel logos/branding ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/666)) +- Retain previous tab when revisiting server details page (#272)([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/667)) +- Add server name tag in panel header (#272)([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/667)) ### Lang TBD

diff --git a/app/classes/controllers/servers_controller.py b/app/classes/controllers/servers_controller.py index c0bae7b0..99151a32 100644 --- a/app/classes/controllers/servers_controller.py +++ b/app/classes/controllers/servers_controller.py @@ -36,6 +36,7 @@ class ServersController(metaclass=Singleton): self.management_helper = management_helper self.servers_list = [] self.stats = Stats(self.helper, self) + self.server_subpage = {} # ********************************************************************************** # Generic Servers Methods diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index e1d21f03..e8643aa7 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -481,6 +481,12 @@ class PanelHandler(BaseHandler): subpage = nh3.clean(self.get_argument("subpage", "")) server_id = self.check_server_id() + # load page the user was on last + server_subpage = self.controller.servers.server_subpage.get(server_id, "") + if subpage == "" and server_subpage != "": + subpage = self.controller.servers.server_subpage.get(server_id, "") + else: + self.controller.servers.server_subpage[server_id] = subpage if server_id is None: return if not self.failed_server: diff --git a/app/frontend/static/assets/images/Crafty_4-0.png b/app/frontend/static/assets/images/Crafty_4-0.png index d873eedc..0671d421 100644 Binary files a/app/frontend/static/assets/images/Crafty_4-0.png and b/app/frontend/static/assets/images/Crafty_4-0.png differ diff --git a/app/frontend/static/assets/images/Crafty_4-0_Logo_square.ico b/app/frontend/static/assets/images/Crafty_4-0_Logo_square.ico index 68095bf6..7b354581 100644 Binary files a/app/frontend/static/assets/images/Crafty_4-0_Logo_square.ico and b/app/frontend/static/assets/images/Crafty_4-0_Logo_square.ico differ diff --git a/app/frontend/static/assets/images/crafty-logo-square-1024.png b/app/frontend/static/assets/images/crafty-logo-square-1024.png index 65dd0671..cec34236 100644 Binary files a/app/frontend/static/assets/images/crafty-logo-square-1024.png and b/app/frontend/static/assets/images/crafty-logo-square-1024.png differ diff --git a/app/frontend/static/assets/images/crafty-logo-square-96.png b/app/frontend/static/assets/images/crafty-logo-square-96.png index 6928e039..8c3a34b2 100644 Binary files a/app/frontend/static/assets/images/crafty-logo-square-96.png and b/app/frontend/static/assets/images/crafty-logo-square-96.png differ diff --git a/app/frontend/static/assets/images/crafty-logo-square.svg b/app/frontend/static/assets/images/crafty-logo-square.svg new file mode 100644 index 00000000..c0a686d3 --- /dev/null +++ b/app/frontend/static/assets/images/crafty-logo-square.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index 40ee757b..cca5ef3b 100755 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -82,6 +82,9 @@ +     + + {% include notify.html %} diff --git a/app/frontend/templates/panel/parts/details_stats.html b/app/frontend/templates/panel/parts/details_stats.html index 47fa501d..ad190bc3 100644 --- a/app/frontend/templates/panel/parts/details_stats.html +++ b/app/frontend/templates/panel/parts/details_stats.html @@ -248,12 +248,38 @@ $("#player-body").html(text); } - + //used to get cookies from browser - this is part of tornados xsrf protection - it's for extra security + function getCookie(name) { + var r = document.cookie.match("\\b" + name + "=([^;]*)\\b"); + return r ? r[1] : undefined; + } + const token = getCookie("_xsrf") $(window).ready(function () { console.log("ready!"); //if (webSocket) { webSocket.on('update_server_details', update_server_details); + add_server_name(); //} }); + async function add_server_name(){ + let res = await fetch(`/api/v2/servers/${serverId}`, { + method: 'GET', + headers: { + 'X-XSRFToken': token + }, + }); + let responseData = await res.json(); + if (responseData.status === "ok") { + console.log(responseData) + $("#server-name-nav").html(`${responseData.data['server_name']}`) + $("#server-name-nav").show(); + } else { + + bootbox.alert({ + title: responseData.error, + message: responseData.error_data + }); + } + } \ No newline at end of file diff --git a/app/frontend/templates/panel/server_webhook_edit.html b/app/frontend/templates/panel/server_webhook_edit.html index e7087771..fd556833 100644 --- a/app/frontend/templates/panel/server_webhook_edit.html +++ b/app/frontend/templates/panel/server_webhook_edit.html @@ -43,8 +43,10 @@
{% end %} - + {% if data['new_webhook'] == False %} + {% end %} {% for type in data['providers'] %} {% if type != data['webhook']['webhook_type'] %}