Backends: Use backend switcher to indicate the current backend in use.
This commit is contained in:
parent
eff8673efc
commit
dc2aba106c
2 changed files with 22 additions and 4 deletions
|
@ -171,6 +171,9 @@ class Config
|
||||||
|
|
||||||
# List of names of the backends
|
# List of names of the backends
|
||||||
property backends : Array(String) = [] of String
|
property backends : Array(String) = [] of String
|
||||||
|
# Character used to separate the backend number from the description/note
|
||||||
|
# of the backend
|
||||||
|
property backends_delimiter : String = "|"
|
||||||
|
|
||||||
property external_videoplayback_proxy : String?
|
property external_videoplayback_proxy : String?
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<%
|
<%
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
locale = env.get("preferences").as(Preferences).locale
|
||||||
dark_mode = env.get("preferences").as(Preferences).dark_mode
|
dark_mode = env.get("preferences").as(Preferences).dark_mode
|
||||||
|
current_backend = env.request.cookies["SERVER_ID"]?.try &.value
|
||||||
%>
|
%>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= locale %>">
|
<html lang="<%= locale %>">
|
||||||
|
@ -104,13 +105,26 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if CONFIG.backends %>
|
<% if !CONFIG.backends.empty? %>
|
||||||
<div class="h-box">
|
<div class="h-box">
|
||||||
<b>Switch Backend:</b>
|
<b>Switch Backend:</b>
|
||||||
<% CONFIG.backends.each do | backend | %>
|
<% CONFIG.backends.each do | backend | %>
|
||||||
<a href="/switchbackend?backend_id=<%= backend %>">
|
<% backend = backend.split(CONFIG.backends_delimiter) %>
|
||||||
Backend<%= HTML.escape(backend) %>
|
<% if current_backend == backend[0] %>
|
||||||
</a> |
|
<a href="/switchbackend?backend_id=<%= backend[0] %>" style="text-decoration-line: underline; display: inline-block;">
|
||||||
|
Backend<%= HTML.escape(backend[0]) %>
|
||||||
|
<% if backend.size == 2 %>
|
||||||
|
<%= HTML.escape(backend[1]) %>
|
||||||
|
<% end %>
|
||||||
|
</a> <span> | </span>
|
||||||
|
<% else %>
|
||||||
|
<a href="/switchbackend?backend_id=<%= backend[0] %>" style="display: inline-block;">
|
||||||
|
Backend<%= HTML.escape(backend[0]) %>
|
||||||
|
<% if backend.size == 2 %>
|
||||||
|
<%= HTML.escape(backend[1]) %>
|
||||||
|
<% end %>
|
||||||
|
</a> <span> | </span>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -296,6 +310,7 @@
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
<div class="footer-footer">
|
<div class="footer-footer">
|
||||||
|
<div class="box">You are currently using Backend: <%= current_backend %></p>
|
||||||
<span class="left">
|
<span class="left">
|
||||||
<% if CONFIG.modified_source_code_url %>
|
<% if CONFIG.modified_source_code_url %>
|
||||||
<%= translate(locale, "footer_current_version_modified") %>
|
<%= translate(locale, "footer_current_version_modified") %>
|
||||||
|
|
Loading…
Reference in a new issue