One Hat Cyber Team
  • Dir : ~/www/server/panel/BTPanel/templates/default/
  • Edit File: layout.html
    \
    When you use the product, what needs have not been met, or what bugs have not
    been solved, please describe your problems or needs to us in detail, and we will try
    our best to solve and develop corresponding functions for you
    \
    \
    \ 2.What is your main reason for giving this score?\ For example, the factors that affect your rating: features, actions, etc\ \
    \
    \ 3.Which of your needs are not being met on the aaPanel?\ Your suggestions are likely to be released in the next version update\ \
    \
    We pay special attention to your requirements feedback, and we conduct regular weekly requirements reviews. I hope I can help you better
    \ \ \ \ \ ', success: function (layers, indexs) { window.localStorage.setItem('NPS', true); // 动态获取问卷内容 var nps_content = '', nps_data = []; bt_tools.send( { url: '/config?action=get_nps_new', data: { product_type: 1, }, }, function (ress) { if (!ress.success) { layer.msg('Unable to score the survey, please refresh and try again', { icon: 2, }); return false; } nps_data = ress.res; for (var i = 0; i < ress.res.length; i++) { var item = ress.res[i]; nps_content += '
    \ ' + (item.required ? '* ' : '') + item.question + ' \ ' + item.hint + '\ \
    '; } $(layers).find('.nps_survey_content').html(nps_content); }, 'Loading...' ); var goNum = 0; var chooseScore = null; //评分栏目鼠标经过事件 $('.survey_score_num').on('mouseenter', 'li', function () { if (goNum < 1) { $(window).resize(); goNum++; } var _mouseScore = $(this).text(); if (!$(this).hasClass('act') && !$(this).hasClass('ten')) { $.each($('.survey_score_num li'), function (i, v) { if (i != chooseScore) { $(v).removeAttr('class'); $(v).removeAttr('style'); } }); $(this).addClass('act'); if (_mouseScore <= 6) { $(this).css({ 'background-color': 'red', opacity: '0.8', }); } else if (_mouseScore == 7 || _mouseScore == 8) { $(this).css({ 'background-color': '#ff7f00', opacity: '0.8', }); } else if (_mouseScore == 10) { $(this).css({ 'background-color': '#20a53a', opacity: '0.8', }); $(this).addClass('ten'); } else { $(this).css({ 'background-color': '#20a53a', opacity: '0.8', }); } } }); $('.survey_score_num').on('mouseout', 'li', function () { $.each($('.survey_score_num li'), function (i, v) { if (i != chooseScore) { $(v).removeAttr('class'); $(v).removeAttr('style'); } }); }); $('.survey_score_num').on('click', 'li', function (e) { chooseScore = $(this).text(); $.each($('.survey_score_num li'), function (i, v) { if (i != chooseScore) { $(v).removeAttr('class'); $(v).removeAttr('style'); } }); $(this).css('opacity', '1'); $('.nps_survey_content').removeClass('hide'); $('.nps_survey').css('top', ($(window).height() - 663) / 2 + 'px'); // 取消按钮样式 $('.set_survey_info').removeAttr('style'); }); // 聚焦问题1取消验证类名 $('[name=problem_one]').focus(function () { $('.nps_survey_line').removeClass('problem_rule'); }); // 文本域触发隐藏显示 $('.nps_survey_line .problem_tips').click(function () { $(this).prev().focus(); }); $('.nps_survey_line textarea').on('focus', function () { $('.nps_survey_line').removeClass('problem_rule1'); $(this).next().hide(); layer.tips($(this).next().html(), $(this), { tips: [1, '#20a53a'], time: 0, area: $(this).width(), }); }); $('.nps_survey_line textarea').on('blur', function () { if ($(this).val() === '') $(this).next().show(); layer.closeAll('tips'); }); // 设置调查信息 $('.set_survey_info').click(function () { var _score = $('.act').text(); // _one = $('input[name=problem_one]').val(), // _two = $('input[name=problem_two]').val(), // _three = $('input[name=problem_three]').val() // _two = _two == '' ? ' ' : _two // _three = _three == '' ? ' ' : _three if (_score == '') layer.msg('Please give me a score before you submit, thank you', { icon: 0, }); var answer_arr = {}; // 清除所有校验 $('input').parent('.nps_survey_line').removeClass('problem_rule'); // 排查未填写的必填项 for (var j = 0; j < nps_data.length; j++) { var data_item = nps_data[j]; var answer = $('[name=problem_' + data_item.id + ']').val(); if (data_item.required && answer == '') { $('input[name=problem_' + data_item.id + ']') .parent('.nps_survey_line') .addClass('problem_rule'); return false; } $('input[name=problem_' + data_item.id + ']') .parent('.nps_survey_line') .removeClass('problem_rule'); answer_arr[data_item.id] = answer; } // 文本域问题 清除所有校验 $('textarea').parent('.nps_survey_line').removeClass('problem_rule1'); // 排查未填写的必填项 answer_arr[4] = $('textarea[name=problem_one]').val(); if (answer_arr[4] == '') { $('textarea[name=problem_one]').parent('.nps_survey_line').addClass('problem_rule1'); return false; } $('textarea[name=problem_one]').parent('.nps_survey_line').removeClass('problem_rule1'); // 文本域问题 end // nps请求 product_type:0-宝塔面板 bt_tools.send( { url: '/config?action=write_nps_new', data: { product_type: 1, rate: _score, questions: JSON.stringify(answer_arr), }, }, function (rdata) { if (rdata.status) { layer.close(indexs); layer.open({ title: false, btn: false, shadeClose: true, shade: 0.1, closeBtn: 0, skin: 'qa_thank_dialog', area: '230px', content: '

    Thank you for your participation!

    ', success: function (layero, index) { $(layero).find('.layui-layer-content').css({ padding: '0', 'border-radius': '5px', }); $(layero).css({ 'border-radius': '5px', 'min-width': '230px', }); setTimeout(function () { layer.close(index); }, 3000); }, }); } }, 'submit a questionnaire' ); // 旧版nps // $.post('/config?action=write_nps',{software_name:'panel',product_type:0,rate:_score,questions:JSON.stringify({ // "LMdrUlYWLMjhjYjczNTUyMDIwcoCSWTt": _one, // "PCpsJvGUmMjRjYjczNTUyMDExLGAMKPd": _two, // "IYlVujIciMmM4YjczNTUyMDMzfselTpB":_three, // "RS4shJeBIMmIwYjczNTUyMDJim9MuCVq":'v1-'+window.localStorage.getItem('panelVersion')})}, // function (rdata) { // if(rdata.status){ // layer.close(indexs) // layer.open({ // title: false, // btn: false, // shadeClose: true, // shade:0.1, // closeBtn: 0, // skin:'qa_thank_dialog', // area: '230px', // content: '

    感谢您的参与!

    ', // success: function (layero,index) { // $(layero).find('.layui-layer-content').css({'padding': '0','border-radius': '5px'}) // $(layero).css({'border-radius': '5px','min-width': '230px'}) // setTimeout(function () { // layer.close(index) // }, 3000) // } // }) // } // }); }); // }, cancel: function (index) { var _width = $(window).width(), revers = Math.abs(_width) * -1, _height = $(window).height(); $('.nps_survey_box').append( '' ); setTimeout(function () { layer.close(index); }, 700); // 关闭nps bt.send('check_nps', 'config/check_nps', { product_type: 1 }); return false; }, }); }); if (!isNps) { $.post('/config?action=check_nps', { product_type: 1 }, function (rdata) { var npsStatus = rdata.res; if (npsStatus.is_submit && npsStatus.safe_day >= 3) $('.toolbar-right .feedback').click(); }); } $('#setBox').click(function () { if ($(this).prop('checked')) { $('input[name=id]').prop('checked', true); } else { $('input[name=id]').prop('checked', false); } }); setCookie('order', 'id desc'); var is_files_html = false; var task_open = 0; var task_close = false; if ($('.current').attr('id') == 'memuAfiles') { is_files_html = true; } function task_stat(my_init) { if (!my_init) { my_init = 0; if (task_open) return; } if (task_close) return; $.post( '/task?action=get_task_lists', { status: -3, }, function (task_list) { if (task_list.length == 0) { if (my_init && is_files_html) GetFiles(getCookie('Path')); if (task_open) { layer.close(task_open); task_open = false; } return; } console.log(task_list.length); var msg_body = ''; var is_add = false; for (var i = 0; i < task_list.length; i++) { if (task_list[i]['status'] == -1) { if (!task_open || !$('.message-list').attr('class')) { show_task(); } if (task_list[i]['type'] == '1') { msg_body += '
    \ \
    '; } else { msg_body += '\
    \ ' + task_list[i].name + ': ' + task_list[i].shell + 'Cancel
    \
    \ ' + task_list[i].log + '\
    '; } } else { if (!is_add) { msg_body += '
    Waiting to execute task
    '; } $('.message-list').html(msg_body); } if (my_init > 3) { if (is_files_html) GetFiles(getCookie('Path')); my_init = 1; } my_init += 1; setTimeout(function () { task_stat(my_init); }, 1000); } ); } function show_task() { task_open = layer.open({ type: 1, title: 'Real time task queue', area: '500px', closeBtn: 2, shadeClose: false, shade: false, offset: 'auto', content: '
    ', cancel: function () { task_close = true; }, }); } function remove_task(id) { layer.confirm( 'Do you want to cancel the current task queue?', { title: 'Cancel task queue', icon: 0, }, function (indexs) { layer.close(indexs); var loadT = bt.load('Canceling task...'); $.post( '/task?action=remove_task', { id: id, }, function (rdata) { loadT.close(); bt.msg(rdata); } ); } ); } loadScript(['{{g.cdn_url}}/laydate/laydate.js', '{{g.cdn_url}}/js/jquery.qrcode.min.js', '{{g.cdn_url}}/js/clipboard.min.js'], function (e) {}); task_stat(); // 获取支付状态 function getPaymentStatus() { bt.send('get_pd', 'ajax/get_pd', {}, function (res) { var tab = $('.pos-box .tab-list'), proHTML = '', _index = res[1] > 0 ? 1 : 2, is_pay = res[1] >= 0 || res[2] > 0, //是否购买 advanced = res[1] == 0 || res[1] > 0 ? 'pro' : 'ltd'; bt.set_cookie('pro_end', res[1]); bt.set_cookie('ltd_end', res[2]); // 已购买 if (is_pay) { proHTML = '
    Expire: ' + (res[1] === 0 ? '永久授权' : (res[1] === -2 && res[2] === -2 ? 'Expired' : bt.format_data(res[_index], 'yyyy-MM-dd')) + '  RENEW') + '
    '; } else { proHTML = '
    '; } $(window).resize(function () { if ($(window).innerWidth() < 1080) { $('.recommend-immediate-icon').next().addClass('hide'); } else { $('.recommend-immediate-icon').next().removeClass('hide'); } }); if (tab.children().length * 105 + 306.28 < tab.parent().width()) { tab.parent().css({ display: 'flex', 'justify-content': 'space-between' }); var _html = '
    ' + (!is_pay ? 'FREE  ' : '') + ' {{session["version"]}}
    ' + proHTML + '
    '; if (tab.next().hasClass('authState')) tab.next().remove(); tab.after(_html); } }); } if (bt.get_cookie('bt_user_info') == null || bt.get_cookie('bt_user_info') == '') { bt.pub.get_user_info(function (userInfo) { if (userInfo.status) { bt.set_cookie('bt_user_info', JSON.stringify(userInfo)); getPaymentStatus(); } }); } else { getPaymentStatus(); } {% endblock %}