ajaxGetServiceStatus(); function ajaxGetServiceStatus() { $('#serviceContent').addClass('loading'); $.get(createLink('zahost', 'ajaxGetServiceStatus', 'hostID=' + hostID), function(response) { var resultData = JSON.parse(response); let html = ""; let isSuccess = true var service = ''; for (let key in resultData.data) { if(key == 'kvm') service = 'KVM'; if(key == 'nginx') service = 'Nginx'; if(key == 'novnc') service = 'noVNC'; if(key == 'websockify') service = 'Websockify'; if(resultData.data[key] == 'ready'){ html += "
" + service + ' ' + zahostLang.init[resultData.data[key]] + "
" }else{ isSuccess = false html += "
" + service + ' ' + zahostLang.init[resultData.data[key]] + "
" } }; $('#statusContainer').html(html) if(!isSuccess){ $('.result .init-fail').removeClass('hide') $('.result .init-success').addClass('hide') } else { $('.result .init-fail').addClass('hide') $('.result .init-success').removeClass('hide') } setTimeout(function() { $('#serviceContent').removeClass('loading'); $(".service-status, .status-notice").show() }, 500); }); return } $('#checkServiceStatus').click(function(){ ajaxGetServiceStatus(); }) $('.btn-init-copy').live('click', function() { var copyText = $('#initBash'); copyText.show(); copyText.select(); document.execCommand("Copy"); copyText.hide(); $('.btn-init-copy').tooltip({ trigger: 'click', placement: 'bottom', title: zahostLang.copied, tipClass: 'tooltip-success' }); $(this).tooltip('show'); var that = this; setTimeout(function() { $(that).tooltip('hide') }, 2000) }) function setIframeHeight(iframe) { if (iframe) { var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow; if (iframeWin.document.body) { var height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight iframe.height = height+10; } } }