mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Start of frontend
This commit is contained in:
parent
060af7ff04
commit
f21b95e358
@ -92,6 +92,8 @@ class ServerHandler(BaseHandler):
|
||||
|
||||
page_data = {
|
||||
"update_available": self.helper.update_available,
|
||||
"steamCMD": True,
|
||||
"windows": self.helper.is_os_windows(),
|
||||
"version_data": self.helper.get_version_string(),
|
||||
"user_data": exec_user,
|
||||
"user_role": exec_user_role,
|
||||
@ -165,6 +167,21 @@ class ServerHandler(BaseHandler):
|
||||
|
||||
template = "server/bedrock_wizard.html"
|
||||
|
||||
if page == "steam_cmd_step1":
|
||||
if not superuser and not self.controller.crafty_perms.can_create_server(
|
||||
exec_user["user_id"]
|
||||
):
|
||||
self.redirect(
|
||||
"/panel/error?error=Unauthorized access: "
|
||||
"not a server creator or server limit reached"
|
||||
)
|
||||
return
|
||||
|
||||
page_data["servers"] = self.controller.steam_apps.fetch_cache()
|
||||
if page_data["servers"] is None:
|
||||
page_data["servers"] = []
|
||||
template = "server/steam_wizard.html"
|
||||
|
||||
self.render(
|
||||
template,
|
||||
data=page_data,
|
||||
|
@ -14,6 +14,20 @@
|
||||
<a class="nav-link active" href="/server/bedrock_step1" role="tab" aria-selected="false">
|
||||
<i class="fas fa-file-signature"></i>Minecraft-Bedrock</a>
|
||||
</li>
|
||||
{% if data["steamCMD"] %}
|
||||
<li class="nav-item term-nav-item">
|
||||
<a class="nav-link" href="/server/steam_cmd_step1" role="tab" aria-selected="false">
|
||||
<i class="fas fa-file-signature"></i>Steam-CMD</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item term-nav-item" id="steam_link">
|
||||
<a style="color: gray;" class="nav-link" href="" role="tab" aria-selected="false">
|
||||
<i class="fas fa-file-signature"></i>Steam-CMD 🔒</a>
|
||||
</li>
|
||||
<span class="missing" title="Missing Deps" ,
|
||||
data-content="SteamCMD dependencies missing. To run SteamCMD servers please install dependencies as noted in our docs."
|
||||
, data-placement="bottom"></span>
|
||||
{% end %}
|
||||
</ul>
|
||||
<div class="d-none" id="overlay" onclick="hide(event)"></div>
|
||||
<div class="row">
|
||||
@ -662,6 +676,13 @@
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$("#steam_link").mouseenter(function () {
|
||||
$('[data-toggle="popover"]').popover();
|
||||
$('.missing').popover("show");
|
||||
})
|
||||
$("#steam_link").mouseleave(function () {
|
||||
$('.missing').popover("hide");
|
||||
});
|
||||
$(".tree-reset").on("click", function () {
|
||||
location.href = "/server/bedrock_step1";
|
||||
});
|
||||
|
1094
app/frontend/templates/server/steam_wizard.html
Normal file
1094
app/frontend/templates/server/steam_wizard.html
Normal file
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,20 @@
|
||||
<a class="nav-link" href="/server/bedrock_step1" role="tab" aria-selected="false">
|
||||
<i class="fas fa-file-signature"></i>Minecraft-Bedrock</a>
|
||||
</li>
|
||||
{% if data["steamCMD"] %}
|
||||
<li class="nav-item term-nav-item">
|
||||
<a class="nav-link" href="/server/steam_cmd_step1" role="tab" aria-selected="false">
|
||||
<i class="fas fa-file-signature"></i>Steam-CMD</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item term-nav-item" id="steam_link">
|
||||
<a style="color: gray;" class="nav-link" href="" role="tab" aria-selected="false">
|
||||
<i class="fas fa-file-signature"></i>Steam-CMD 🔒</a>
|
||||
</li>
|
||||
<span class="missing" title="Missing Deps" ,
|
||||
data-content="SteamCMD dependencies missing. To run SteamCMD servers please install dependencies as noted in our docs."
|
||||
, data-placement="bottom"></span>
|
||||
{% end %}
|
||||
</ul>
|
||||
<div class="d-none" id="overlay" onclick="hide(event)"></div>
|
||||
<div class="row">
|
||||
@ -905,6 +919,16 @@
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$("#steam_link").mouseenter(function () {
|
||||
$('[data-toggle="popover"]').popover();
|
||||
$('.missing').popover("show");
|
||||
})
|
||||
$("#steam_link").mouseleave(function () {
|
||||
$('.missing').popover("hide");
|
||||
});
|
||||
$(".tree-reset").on("click", function () {
|
||||
location.href = "/server/bedrock_step1";
|
||||
});
|
||||
$(".tree-reset").on("click", function () {
|
||||
location.href = "/server/step1";
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user