Fixed hostbanner

This commit is contained in:
WolverinDEV 2019-02-09 21:52:48 +01:00
parent b61d210eb7
commit 0f6e517920
3 changed files with 31 additions and 15 deletions

View file

@ -97,7 +97,9 @@
.fulloverlay .container { .fulloverlay .container {
position: relative; position: relative;
display: inline-block; display: inline-block;
top: 30% top: 30%;
max-width: unset!important; /* override bootstrap */
} }
.no-js { .no-js {
@ -148,8 +150,8 @@
<!-- Critical load error --> <!-- Critical load error -->
<div class="fulloverlay" id="critical-load"> <div class="fulloverlay" id="critical-load">
<div class="container"> <div class="container">
<img src="img/script.svg" height="128px"> <img src="img/loading_error_right.svg" height="192px">
<h1 style="color: red">Got some trouble while loading important files!</h1> <h1 style="color: red">Ooops, we encountered some trouble while loading important files!</h1>
<h3 class="detail"></h3> <h3 class="detail"></h3>
</div> </div>
</div> </div>

View file

@ -2159,7 +2159,7 @@
{{/if}} {{/if}}
{{if property_client_flag_avatar && property_client_flag_avatar.length > 0}} {{if property_client_flag_avatar && property_client_flag_avatar.length > 0}}
<div style="margin-top: 10px;"> <div style="margin-top: 10px;" class="client-avatar">
<node key="client_avatar"/> <node key="client_avatar"/>
</div> </div>
{{/if}} {{/if}}
@ -2238,9 +2238,10 @@
</script> </script>
<script class="jsrender-template" id="tmpl_selected_hostbanner" type="text/html"> <script class="jsrender-template" id="tmpl_selected_hostbanner" type="text/html">
<div class="hostbanner"> <div class="hostbanner">
<a href="{{:property_virtualserver_hostbanner_url}}" target="_blank" style="display: flex; flex-direction: row; justify-content: center;"> <a href="{{:property_virtualserver_hostbanner_url}}" target="_blank" style="display: flex; flex-direction: row; justify-content: center; height: 100%">
<img src=" <div style="
background:center no-repeat url(
{{:property_virtualserver_hostbanner_gfx_url}} {{:property_virtualserver_hostbanner_gfx_url}}
{{if property_virtualserver_hostbanner_gfx_interval > 0}} {{if property_virtualserver_hostbanner_gfx_interval > 0}}
{{* {{*
@ -2251,17 +2252,22 @@
}} }}
?ts={{*:date}} ?ts={{*:date}}
{{/if}} {{/if}}
" );
{{if property_virtualserver_hostbanner_mode == 0}}
{{else property_virtualserver_hostbanner_mode == 1}} background-position: center;
style="width: 100%; height: 100%;" {{if property_virtualserver_hostbanner_mode == 0}}
{{else property_virtualserver_hostbanner_mode == 2}}
style="width: 100%; height: auto;"
{{/if}}
alt="{{tr "Host banner"/}}" {{else property_virtualserver_hostbanner_mode == 1}}
> width: 100%; height: auto;
{{else property_virtualserver_hostbanner_mode == 2}}
background-size:contain;
width:100%;
height:100%
{{/if}}
"
alt="{{tr "Host banner"/}}"
></div>
</a> </a>
</div> </div>
</script> </script>

View file

@ -160,6 +160,13 @@ class Hostbanner {
properties["property_" + key] = server.properties[key]; properties["property_" + key] = server.properties[key];
const rendered = $("#tmpl_selected_hostbanner").renderTag(properties); const rendered = $("#tmpl_selected_hostbanner").renderTag(properties);
console.debug(tr("Hostbanner has been loaded"));
if(server.properties.virtualserver_hostbanner_gfx_interval > 0)
this.updater = setTimeout(() => this.update(), Math.min(server.properties.virtualserver_hostbanner_gfx_interval, 60) * 1000);
return Promise.resolve(rendered);
/*
const image = rendered.find("img"); const image = rendered.find("img");
return new Promise<JQuery<HTMLElement>>((resolve, reject) => { return new Promise<JQuery<HTMLElement>>((resolve, reject) => {
const node_image = image[0] as HTMLImageElement; const node_image = image[0] as HTMLImageElement;
@ -173,6 +180,7 @@ class Hostbanner {
reject(event); reject(event);
} }
}); });
*/
} }
} }