fixes update check performance ...

This commit is contained in:
Abdulrahman
2019-01-31 20:03:35 +03:00
parent eca2a15446
commit c565d4f8df
6 changed files with 99 additions and 76 deletions

View File

@@ -7,7 +7,30 @@
<li class="breadcrumb-item active">{lang.R_CHECK_UPDATE}</li>
</ol>
<div class="alert <IF NAME="error">alert-warning<ELSE>alert-info</IF>">{text}</div>
<div id="updateInfo" class="alert">
<img src="{STYLE_PATH_ADMIN}images/ajax-loader-small.gif" />
</div>
<script>
setTimeout(function(){
$.ajax({
url: './?cp=p_check_update&smt=check&_ajax_=1',
dataType: 'json',
success: function (data) {
if(data.content){
var info = data.content.split(":::");
$('#updateInfo').html(info[1]).addClass(info[0] == 1 ? 'alert-warning' : 'alert-info');
} else {
this.fail();
}
<IF NAME="showMessage"> location.href = './?update_done=1'; </IF>
},
fail: function() {
$('#updateInfo').html('{lang.ERROR_CHECK_VER}').addClass('alert-warning');
<IF NAME="showMessage"> location.href = './?update_done=1'; </IF>
}
});
}, 300);
</script>
<ELSEIF NAME="current_smt == howto">

View File

@@ -24,25 +24,8 @@
<script type="text/javascript" src="{STYLE_PATH_ADMIN}js/jquery.waitforimages.js"></script>
</IF>
<IF NAME="go_to==start">
<script type="text/javascript">
$.ajax({url: "https://api.github.com/repos/awssat/kleeja/contributors",
dataType: 'json',
success: function (data) {
var template = $('#ghTemplate')[0].outerHTML;
$.each(data, function(i, item) {
$("#gtresults").append(template.replace('%id%', item['id']).replace('%login%', item['login']).replace('ghTemplate',
'gt'+item['id']).replace('%avatarUrl%', item['avatar_url']).replace('%contributions%', item['contributions']).replace('%htmlUrl%', item['html_url']));
$('#gt'+item['id']).removeAttr('style');
});
}
});
</script>
</IF>
<script type="text/javascript">
<!--//
$(function () {
//check for msg, reports every 5min
@@ -239,7 +222,6 @@ function confirm_form(r)
function get_kleeja_link(link) {
location.href = link;
}
//-->
</script>
</body>
</html>

View File

@@ -412,7 +412,24 @@
<br>
<hr>
<div class="text-muted text-center">Kleeja proudly made in Buraydah City <br> ❤ Trusted since 2007 <br><small>{kleeja_version}</small></div>
<script type="text/javascript">
setTimeout(function() {
$.ajax({
url: "https://api.github.com/repos/awssat/kleeja/contributors",
dataType: 'json',
success: function (data) {
var template = $('#ghTemplate')[0].outerHTML;
$.each(data, function (i, item) {
$("#gtresults").append(template.replace('%id%', item['id']).replace('%login%', item['login']).replace(
'ghTemplate',
'gt' + item['id']).replace('%avatarUrl%', item['avatar_url']).replace('%contributions%', item[
'contributions']).replace('%htmlUrl%', item['html_url']));
$('#gt' + item['id']).removeAttr('style');
});
}
});
}, 400);
</script>
</IF>

View File

@@ -439,7 +439,11 @@ if(!ig('_ajax_'))
else
{
$is_ajax = 'yes';
echo_ajax(1, $tpl->display($stylee, $styleePath), $go_menu_html);
echo_ajax(1,
empty($adminAjaxContent) ? $tpl->display($stylee, $styleePath) : $adminAjaxContent,
$go_menu_html
);
}
//footer