do updatecheck

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-02-22 11:37:30 +01:00
parent 60029ba1c3
commit 1974cb5217
6 changed files with 36 additions and 21 deletions

View File

@@ -18,7 +18,7 @@
{% endif %}
{% if redirect_link %}
<p class="mt-1">
<a href="{{ redirect_link }}" class="btn btn-{{ btntype }}">{% if type == 'danger' %}{{ lng('panel.back') }}{% else %}{{ lng('success.clickheretocontinue') }}{% endif %}</a>
<a href="{{ redirect_link|raw }}" class="btn btn-{{ btntype }}">{% if type == 'danger' %}{{ lng('panel.back') }}{% else %}{{ lng('success.clickheretocontinue') }}{% endif %}</a>
</p>
{% endif %}
</div>

View File

@@ -0,0 +1,8 @@
<a class="btn {% if isnewerversion == 0 %}btn-light text-success{% else %}btn-warning{% endif %} btn-sm d-block me-2" {% if isnewerversion == 0 %} href="#" {% else %} href="admin_autoupdate.php?page=overview&s={{ s }}" {% endif %} title="{% if isnewerversion == 0 %}{{ additional_info }}{% else %}{{ message }}{% endif %}">
{% if isnewerversion == 0 %}
<i class="fa-solid fa-circle-check me-1"></i>
{% else %}
<i class="fa-solid fa-circle-exclamation me-1"></i>
{% endif %}
{{ version }}
</a>

View File

@@ -3,21 +3,15 @@ $(document).ready(function () {
* updatecheck
*/
if (document.getElementById('updatecheck')) {
let role = "";
if (typeof $("#updatecheck").data("role") !== "undefined") {
role = "&role=" + $("#newsfeed").data("role");
}
$.ajax({
url: "lib/ajax.php?action=updatecheck" + role + "&theme=" + window.$theme + "&s=" + window.$session,
url: "lib/ajax.php?action=updatecheck&theme=" + window.$theme + "&s=" + window.$session,
type: "GET",
success: function (data) {
$("#newsfeeditems").html(data);
$("#updatecheck").html(data);
},
error: function (request, status, error) {
console.log(request, status, error)
$("#newsfeeditems").html('<div class="alert alert-warning" role="alert">Error loading newsfeed</div>');
$("#updatecheck").html('<div class="alert alert-warning" role="alert">Error checking version</div>');
}
});
}

View File

@@ -32,11 +32,10 @@
</div>
<div class="collapse navbar-collapse justify-content-end px-3" id="navbar">
<ul class="navbar-nav align-items-center">
<li class="nav-item text-nowrap d-block">
<a class="btn btn-link" title="{{ lng('login.logout') }}" href="{{ linker({'section': 'index', 'action': 'logout'}) }}">
<i class="fas fa-power-off"></i>
</a>
{% if userinfo.adminsession == 1 %}
<li class="nav-item text-nowrap d-block" id="updatecheck">
</li>
{% endif %}
<li class="nav-item text-nowrap d-block me-2">
<a class="btn btn-primary btn-sm d-block" href="{{ linker({'section': 'index'}) }}">
<i class="fa fa-dashboard"></i> {{ lng('panel.dashboard') }}