linkkf 로직수정중
This commit is contained in:
@@ -1,33 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
</style>
|
||||
<div>
|
||||
{{ macros.setting_select_empty('log_select1', '로그 파일 선택 (.log)') }}
|
||||
<!--{{ macros.setting_select_empty('log_select2', '로그 파일 선택 (.logX)') }}-->
|
||||
<nav>
|
||||
{{ macros.m_tab_head_start() }}
|
||||
{{ macros.m_tab_head('old', '이전', true) }}
|
||||
{{ macros.m_tab_head('new', '실시간', false) }}
|
||||
{{ macros.m_tab_head_end() }}
|
||||
</nav>
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
{{ macros.m_tab_content_start('old', true) }}
|
||||
<div>
|
||||
<textarea id="log" class="col-md-12" rows="30" charswidth="23" disabled style="background-color:#ffffff;visibility:hidden"></textarea>
|
||||
</div>
|
||||
{{ macros.m_tab_content_end() }}
|
||||
{{ macros.m_tab_content_start('new', false) }}
|
||||
<div>
|
||||
<textarea id="add" class="col-md-12" rows="30" charswidth="23" disabled style="background-color:#ffffff;visibility:visible"></textarea>
|
||||
</div>
|
||||
<div class="form-inline">
|
||||
<label class="form-check-label" for="auto_scroll">자동 스크롤</label>
|
||||
<input id="auto_scroll" name="auto_scroll" class="form-control form-control-sm" type="checkbox" data-toggle="toggle" checked>
|
||||
<span class='text-left' style="padding-left:25px; padding-top:0px">
|
||||
<button id="clear" class="btn btn-sm btn-outline-success">리셋</button>
|
||||
</span>
|
||||
</div>
|
||||
{{ macros.m_tab_content_end() }}
|
||||
<div id="log_div" class="bg-dark" style="overflow:auto; border-color: blue; border: solid 1px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,14 +32,6 @@ function make_form() {
|
||||
str += '<option value="' + data[i] + '">' + data[i] + '</option>';
|
||||
}
|
||||
$("#log_select1_div").html(str);
|
||||
/*
|
||||
str = '<select id="log_select" name="log_select" class="form-control form-control-sm">';
|
||||
data = all_list.split('|')
|
||||
for(var i in data) {
|
||||
str += '<option value="' + data[i] + '">' + data[i] + '</option>';
|
||||
}
|
||||
$("#log_select2_div").html(str);
|
||||
*/
|
||||
}
|
||||
|
||||
$("body").on('change', '#log_select', function(e){
|
||||
@@ -75,11 +43,9 @@ $("body").on('change', '#log_select', function(e){
|
||||
socket.emit("start", {'filename':filename} );
|
||||
});
|
||||
|
||||
|
||||
function ResizeTextAreaAllLog() {
|
||||
ClientHeight = window.innerHeight
|
||||
$("#log").height(ClientHeight-300);
|
||||
$("#add").height(ClientHeight-320);
|
||||
$("#log_div").height(ClientHeight-180);
|
||||
}
|
||||
|
||||
$(window).resize(function() {
|
||||
@@ -88,17 +54,20 @@ $(window).resize(function() {
|
||||
|
||||
|
||||
socket.on('on_start', function(data){
|
||||
document.getElementById("log").innerHTML += data.data;
|
||||
document.getElementById("log").scrollTop = document.getElementById("log").scrollHeight;
|
||||
document.getElementById("log").style.visibility = 'visible';
|
||||
lines = splitLines(data.data);
|
||||
var html = '';
|
||||
for (i in lines) {
|
||||
html += logline(lines[i]);
|
||||
}
|
||||
$('#log_div').html(html)
|
||||
document.getElementById("log_div").scrollTop = document.getElementById("log_div").scrollHeight;
|
||||
$('#loading').hide();
|
||||
});
|
||||
|
||||
socket.on('add', function(data){
|
||||
if (data.filename == current_filename) {
|
||||
var chk = $('#auto_scroll').is(":checked");
|
||||
document.getElementById("add").innerHTML += data.data;
|
||||
if (chk) document.getElementById("add").scrollTop = document.getElementById("add").scrollHeight;
|
||||
$('#log_div').append(logline(data.data.trim()));
|
||||
document.getElementById("log_div").scrollTop = document.getElementById("log_div").scrollHeight;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
|
||||
<canvas id="mycanvas" height="100vh"></canvas>
|
||||
<h3>시스템</h3>
|
||||
<hr>
|
||||
{{ macros.info_text_and_buttons('python_version', 'Python', [['globalLinkBtn', '패키지 관리', [('url','/system/tool/python')]]], info['python_version']) }}
|
||||
@@ -45,21 +45,102 @@
|
||||
|
||||
<h3>스케쥴</h3>
|
||||
<div id="scheduler_list_div"></div>
|
||||
</div> <!--전체-->
|
||||
</div>
|
||||
<!--전체-->
|
||||
<script src="{{ url_for('static', filename='js/chartjs-utils.js') }}"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.9.1/dist/chart.min.js"></script>
|
||||
<script>
|
||||
const Utils = ChartUtils.init()
|
||||
</script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/luxon@3.0.4"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-luxon@1.2.0"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-streaming@2.0.0"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var socket = io.connect(window.location.href);
|
||||
Chart.defaults.set("plugins.streaming", {
|
||||
duration: 20000,
|
||||
})
|
||||
|
||||
socket.on('start', function(data){
|
||||
});
|
||||
// used for example purposes
|
||||
function getRandomIntInclusive(min, max) {
|
||||
min = Math.ceil(min)
|
||||
max = Math.floor(max)
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min
|
||||
}
|
||||
|
||||
socket.on('status', function(data) {
|
||||
make_system(data.system);
|
||||
make_scheduler_list(data.scheduler);
|
||||
});
|
||||
});
|
||||
$(document).ready(function () {
|
||||
var socket = io.connect(window.location.href)
|
||||
var postId = 1
|
||||
socket.on("start", function (data) {})
|
||||
|
||||
socket.on("status", function (data) {
|
||||
console.log(data.system.cpu_percent)
|
||||
const now = Date.now()
|
||||
//myChart.data.labels.push("T " + postId++)
|
||||
/* */
|
||||
myChart.data.datasets[0].data.push({ x: now, y: data.system.cpu_percent.replace(/.%/g, "") })
|
||||
/* */
|
||||
myChart.update()
|
||||
make_system(data.system)
|
||||
make_scheduler_list(data.scheduler)
|
||||
})
|
||||
|
||||
/* const onRefresh = (chart) => {
|
||||
const now = Date.now()
|
||||
chart.data.datasets.forEach((dataset) => {
|
||||
dataset.data.push({
|
||||
x: now,
|
||||
y: Utils.rand(0, 100),
|
||||
})
|
||||
})
|
||||
}
|
||||
*/
|
||||
|
||||
var ctx_live = document.getElementById("mycanvas")
|
||||
var myChart = new Chart(ctx_live, {
|
||||
type: "line",
|
||||
data: {
|
||||
labels: [],
|
||||
datasets: [
|
||||
{
|
||||
label: "CPU",
|
||||
backgroundColor: Utils.transparentize(Utils.CHART_COLORS.blue, 0.5),
|
||||
borderColor: Utils.CHART_COLORS.blue,
|
||||
cubicInterpolationMode: "monotone",
|
||||
data: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
options: {
|
||||
plugins: {
|
||||
// Change options for ALL axes of THIS CHART
|
||||
streaming: {
|
||||
duration: 20000,
|
||||
},
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
type: "realtime",
|
||||
realtime: {
|
||||
duration: 60000,
|
||||
refresh: 1000,
|
||||
delay: 1000,
|
||||
//onRefresh: onRefresh,
|
||||
},
|
||||
},
|
||||
y: {
|
||||
title: {
|
||||
display: true,
|
||||
//text: "Value",
|
||||
},
|
||||
},
|
||||
},
|
||||
interaction: {
|
||||
intersect: false,
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
$("body").on('click', '#recent_version_btn', function(e){
|
||||
e.preventDefault();
|
||||
@@ -70,7 +151,7 @@ $("body").on('click', '#recent_version_btn', function(e){
|
||||
|
||||
$("body").on('click', '#config_show_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommand('get_config', null, null, null, 'Config');
|
||||
globalSendCommand('get_config');
|
||||
});
|
||||
|
||||
|
||||
@@ -184,4 +265,4 @@ function make_scheduler_list(data) {
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -45,7 +45,6 @@ $("body").on('click', '#login_btn', function(e){
|
||||
$('#username').val(),
|
||||
$('#password').val(),
|
||||
$("#remember").is(":checked"),
|
||||
'',
|
||||
function(data) {
|
||||
if (data == 'redirect') {
|
||||
next = document.getElementById("next").value;
|
||||
@@ -53,7 +52,6 @@ $("body").on('click', '#login_btn', function(e){
|
||||
if (next == '' || next == 'None' || next == '/system/restart' || '/system/shutdown') {
|
||||
next = '/'
|
||||
}
|
||||
//console.log(next)
|
||||
window.location.href = next;
|
||||
} else if (data == 'no_id') {
|
||||
$.notify('<strong>ID가 없습니다.</strong>', {
|
||||
|
||||
153
lib/system/templates/system_plugin_all.html
Normal file
153
lib/system/templates/system_plugin_all.html
Normal file
@@ -0,0 +1,153 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div>
|
||||
<div id="plugin_list_div"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
globalSendCommand('get_plugin_list_all', null, null, null, function(data){
|
||||
make_plugin_list(data.data);
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#plugin_install_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommand('plugin_install', $('#_plugin_git').val());
|
||||
});
|
||||
|
||||
function make_plugin_list(data) {
|
||||
current_data = data;
|
||||
str = ''
|
||||
count = 0;
|
||||
for (i in data) {
|
||||
console.log(data[i])
|
||||
str += j_row_start();
|
||||
str += j_col(12, '<b><span style="font-size:150%; font-style:italic; margin=0px;">' + data[i].name + '</span></b>', 'left');
|
||||
//str += '<hr style="width: 100%; margin:0px; margin-bottom:10px; margin-top:2px; margin-left:15px; margin-right:15px; background-color:black; height:2px" />'
|
||||
//str += '<div class="d-inline-block"></div><hr style="width: 100%; margin:0px; margin-left:15px; margin-right:15px;background-color:#808080;">';
|
||||
|
||||
str += j_row_end();
|
||||
//str += j_hr_black(0);
|
||||
|
||||
str += head();
|
||||
for (j in data[i].list) {
|
||||
console.log(data[i].list[j]);
|
||||
str += j_row_start();
|
||||
count += 1
|
||||
str += j_col_wide(1, (parseInt(count)), 'center')
|
||||
tmp = text_color_bootstrap(data[i].list[j].title, 'text-info');
|
||||
str += j_col_wide(2, tmp);
|
||||
tmp = data[i].list[j].package_name;
|
||||
str += j_col_wide(2, tmp);
|
||||
str += j_col_wide(1, data[i].list[j].developer);
|
||||
if (data[i].list[j].version == null) {
|
||||
str += j_col_wide(1, "미설치");
|
||||
} else {
|
||||
str += j_col_wide(1, text_color_bootstrap(data[i].list[j].version, 'text-danger'));
|
||||
}
|
||||
if (data[i].list[j].loading == false) {
|
||||
tmp = data[i].list[j].description + '<br>' + text_color('[로딩 실패] ') + data[i].list[j].status;
|
||||
str += j_col_wide(3, tmp);
|
||||
|
||||
} else {
|
||||
str += j_col_wide(3, data[i].list[j].description);
|
||||
}
|
||||
tmp = ''
|
||||
tmp += j_button_small('globalOpenBtn', '홈페이지', {'url':data[i].list[j].home}, 'primary', false, true);
|
||||
if (data[i].list[j].version == null) {
|
||||
tmp += j_button_small('install_btn', '설치', {'package_name':data[i].list[j].package_name, 'title':data[i].list[j].title, 'home':data[i].list[j].home}, 'info', false, true);
|
||||
} else {
|
||||
tmp += j_button_small('uninstall_btn', '삭제', {'package_name':data[i].list[j].package_name, 'title':data[i].list[j].title}, 'danger', false, true);
|
||||
}
|
||||
tmp = j_button_group(tmp)
|
||||
str += j_col_wide(2, tmp, 'right')
|
||||
str += j_row_end();
|
||||
if (i != current_data.length -1) str += j_hr(0);
|
||||
}
|
||||
str += j_row_start();
|
||||
str += j_row_end();
|
||||
}
|
||||
$("#plugin_list_div").html(str);
|
||||
}
|
||||
|
||||
$("body").on('click', '#json_btn', function(e){
|
||||
e.preventDefault();
|
||||
item_id = $(this).data('idx');
|
||||
showModal(current_data[item_id]);
|
||||
});
|
||||
|
||||
$("body").on('click', '#install_btn', function(e){
|
||||
e.preventDefault();
|
||||
$("#confirm_title").html("설치 확인");
|
||||
$("#confirm_body").html($(this).data('title') + " 플러그인을 설치 하시겠습니까?");
|
||||
home = $(this).data('home');
|
||||
$('#confirm_button').attr('onclick', "javascript:install(home);");
|
||||
$("#confirm_modal").modal();
|
||||
});
|
||||
|
||||
function install(git) {
|
||||
globalSendCommand('plugin_install', git);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$("body").on('click', '#uninstall_btn', function(e){
|
||||
e.preventDefault();
|
||||
$("#confirm_title").html("삭제 확인");
|
||||
$("#confirm_body").html($(this).data('title') + " 플러그인을 삭제 하시겠습니까?");
|
||||
package_name = $(this).data('package_name');
|
||||
$('#confirm_button').attr('onclick', "javascript:uninstall(package_name);");
|
||||
$("#confirm_modal").modal();
|
||||
});
|
||||
|
||||
|
||||
function uninstall(package_name) {
|
||||
globalSendCommand('uninstall', package_name, null, null, function(ret) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$("body").on('click', '#plugin_uninstall_btn', function(e){
|
||||
e.preventDefault();
|
||||
plugin_name = $(this).data('plugin_name')
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/plugin_uninstall',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data:{plugin_name:plugin_name},
|
||||
success: function (data) {
|
||||
if (data == 'success') {
|
||||
$.notify('<strong>재시작시 적용됩니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
$.notify('<strong>실패하였습니다.</strong>', {
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function head(str) {
|
||||
|
||||
tmp = '<hr style="width: 100%; margin:0px; background-color:#808080;"> \
|
||||
<div class="row chover" style="padding:0px; align-items:center;"> \
|
||||
<div class="col-sm-1" style="padding:0px; margin:0px; text-align:center; word-break:break-all;"><strong>Idx</strong></div> \
|
||||
<div class="col-sm-2" style="padding:0px; margin:0px; text-align:left; word-break:break-all;"><strong>Title</strong></div> \
|
||||
<div class="col-sm-2" style="padding:0px; margin:0px; text-align:left; word-break:break-all;"><strong>Package Name</strong></div> \
|
||||
<div class="col-sm-1" style="padding:0px; margin:0px; text-align:left; word-break:break-all;"><strong>Dev.</strong></div> \
|
||||
<div class="col-sm-1" style="padding:0px; margin:0px; text-align:left; word-break:break-all;"><strong>Version</strong></div> \
|
||||
<div class="col-sm-5" style="padding:0px; margin:0px; text-align:left; word-break:break-all;"><strong>Description</strong></div> \
|
||||
</div> \
|
||||
<hr style="width: 100%; margin:0px; margin-bottom:10px; margin-top:2px; background-color:#808080; height:2px" />';
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -19,7 +19,7 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
globalSendCommand('get_plugin_list', null, null, null, null, function(data){
|
||||
globalSendCommand('get_plugin_list', null, null, null, function(data){
|
||||
make_plugin_list(data.data);
|
||||
});
|
||||
});
|
||||
@@ -31,7 +31,6 @@ $("body").on('click', '#plugin_install_btn', function(e){
|
||||
|
||||
function make_plugin_list(data) {
|
||||
current_data = data;
|
||||
console.log(data);
|
||||
str = ''
|
||||
console.log(data)
|
||||
for (i in data) {
|
||||
@@ -41,7 +40,7 @@ function make_plugin_list(data) {
|
||||
if (data[i].title == null) {
|
||||
str += j_col_wide(2, '');
|
||||
str += j_col_wide(2, data[i].package_name);
|
||||
str += j_col_wide(5, '');
|
||||
str += j_col_wide(5, data[i].status, 'center');
|
||||
tmp = j_button('uninstall_btn', '삭제', {'package_name':data[i].package_name}, 'danger', false, true);
|
||||
} else {
|
||||
str += j_col_wide(2, data[i].title);
|
||||
@@ -74,7 +73,7 @@ function make_plugin_list(data) {
|
||||
$("body").on('click', '#json_btn', function(e){
|
||||
e.preventDefault();
|
||||
item_id = $(this).data('idx');
|
||||
m_modal(current_data[item_id]);
|
||||
showModal(current_data[item_id]);
|
||||
});
|
||||
|
||||
|
||||
@@ -89,7 +88,7 @@ $("body").on('click', '#uninstall_btn', function(e){
|
||||
|
||||
|
||||
function uninstall(package_name) {
|
||||
globalSendCommand('uninstall', package_name, null, null, null, function(ret) {
|
||||
globalSendCommand('uninstall', package_name, null, null, function(ret) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ $(document).ready(function() {
|
||||
var restartSocket = io.connect(window.location.href);
|
||||
|
||||
restartSocket.on('connect', function(data){
|
||||
console.log('접속 받음')
|
||||
window.location.href = referer;
|
||||
});
|
||||
}, 3000);
|
||||
|
||||
@@ -33,7 +33,7 @@ $('#use_login').change(function() {
|
||||
|
||||
$("body").on('click', '#apikey_generate_btn', function(e) {
|
||||
e.preventDefault();
|
||||
globalSendCommand('apikey_generate', null, null, null, null, function(ret){
|
||||
globalSendCommand('apikey_generate', null, null, null, function(ret){
|
||||
$("#apikey").val(ret);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<div>
|
||||
{{ macros.m_button_group([['globalSettingSaveBtn', '설정 저장']])}}
|
||||
{{ macros.m_row_start('5') }}
|
||||
{{ macros.m_row_end() }}
|
||||
{{ macros.m_hr() }}
|
||||
{{ macros.m_button_group([['globalSettingSaveBtn', '설정 저장']])}}
|
||||
{{ macros.m_row_start('5') }}
|
||||
{{ macros.m_row_end() }}
|
||||
{{ macros.m_hr() }}
|
||||
|
||||
<form id='setting' name='setting'>
|
||||
{{ macros.setting_input_int('port', 'Port', value=arg['port'], min='1', placeholder='Port', desc=['포트 번호입니다.', '네이티브 설치 혹은 도커 네트워크 타입이 호스트일 경우 반영됩니다.', '도커 브릿지 모드인 경우는 docker run -p 옵션에서 변경하시기 바랍니다.', '경고 : -p 브릿지 모드로 사용중 일 경우 9999번을 변경하지 마세요.']) }}
|
||||
{{ macros.setting_input_text_and_buttons('ddns', 'DDNS', [['ddns_test_btn', '테스트']], value=arg['ddns'], desc=['외부에서 접근시 사용할 DDNS. http:// 나 https:// 로 시작해야합니다.', 'URL생성시 사용합니다.', '테스트 버튼 클릭 후 버전을 확인 할 수 있어야 합니다.']) }}
|
||||
{{ macros.setting_input_text('restart_interval', '자동 재시작 시간', value=arg['restart_interval'], col='3', desc=['자동 재시작 간격(시간단위)이나 Cron 설정을 입력합니다.', '0이면 재시작 안함.']) }}
|
||||
{{ macros.setting_checkbox('restart_notify', '시작시 알림', value=arg['restart_notify'], desc=['메시지 ID: system_start']) }}
|
||||
{{ macros.setting_select('log_level', '로그 레벨', [['10', 'DEBUG'],['20', 'INFO'],['30', 'WARNING'],['40', 'ERROR'], ['50', 'CRITICAL'] ], value=arg['log_level'], col='3') }}
|
||||
{{ macros.m_hr() }}
|
||||
{{ macros.setting_input_text_and_buttons('command_text', 'Command', [['command_run_btn', 'Run']], value='', desc='') }}
|
||||
</form>
|
||||
</div><!--전체-->
|
||||
<form id='setting' name='setting'>
|
||||
{{ macros.setting_input_int('port', 'Port', value=arg['port'], min='1', placeholder='Port', desc=['포트 번호입니다.', '네이티브 설치 혹은 도커 네트워크 타입이 호스트일 경우 반영됩니다.', '도커 브릿지 모드인 경우는 docker run -p 옵션에서 변경하시기 바랍니다.', '경고 : -p 브릿지 모드로 사용중 일 경우 9999번을 변경하지 마세요.']) }}
|
||||
{{ macros.setting_input_text_and_buttons('ddns', 'DDNS', [['ddns_test_btn', '테스트']], value=arg['ddns'], desc=['외부에서 접근시 사용할 DDNS. http:// 나 https:// 로 시작해야합니다.', 'URL생성시 사용합니다.', '테스트 버튼 클릭 후 버전을 확인 할 수 있어야 합니다.']) }}
|
||||
{{ macros.setting_input_text('restart_interval', '자동 재시작 시간', value=arg['restart_interval'], col='3', desc=['자동 재시작 간격(시간단위)이나 Cron 설정을 입력합니다.', '0이면 재시작 안함.']) }}
|
||||
{{ macros.setting_checkbox('restart_notify', '시작시 알림', value=arg['restart_notify'], desc=['메시지 ID: system_start']) }}
|
||||
{{ macros.setting_select('log_level', '로그 레벨', [['10', 'DEBUG'],['20', 'INFO'],['30', 'WARNING'],['40', 'ERROR'], ['50', 'CRITICAL'] ], value=arg['log_level'], col='3') }}
|
||||
{{ macros.m_hr() }}
|
||||
{{ macros.setting_input_text_and_buttons('command_text', 'Command', [['command_run_btn', 'Run']], value=arg['command_text'], desc='') }}
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("body").on('click', '#ddns_test_btn', function(e){
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
{{ macros.info_text('use_celery', 'use_celery 값', arg['use_celery']) }}
|
||||
{{ macros.info_text('running_type', 'running_type 값', arg['running_type']) }}
|
||||
{{ macros.info_text('_tmp', '설명', "Docker는 celery가 서비스로 동작하기 때문에 설정이 불필요하며 '테스트' 버튼으로 작동 여부 확인만 가능합니다.", desc=['','native로 동작하는 경우 celery 실행을 따로 하지 않고 한번에 실행하기 위한 설정', 'Redis는 설정된 Port로 동작중인 상태여야 함.']) }}
|
||||
{{ macros.info_text('_tmp', '설명', "보통 시작시 celery 실행 On 상태로 동작하며 개발시에만 Off로 설정.", desc=None) }}
|
||||
{{ macros.m_hr() }}
|
||||
<form id='setting' name='setting'>
|
||||
{{ macros.setting_checkbox('celery_start_by_web', '시작시 celery 실행', value=arg['celery_start_by_web']) }}
|
||||
|
||||
@@ -29,6 +29,14 @@
|
||||
{{ macros.setting_input_text('notify_discord_webhook', '웹훅', value=arg['notify_discord_webhook']) }}
|
||||
{{ macros.setting_input_text_and_buttons('tmp_text_discord', 'Test', [['tmp_discord_test_btn', '전송']], value='테스트 메시지입니다.', col='9') }}
|
||||
</div>
|
||||
|
||||
{{ macros.m_hr() }}
|
||||
|
||||
{{ macros.setting_checkbox('notify_slack_use', '슬랙 사용', value=arg['notify_slack_use']) }}
|
||||
<div id="notify_slack_use_div" class="collapse">
|
||||
{{ macros.setting_input_text('notify_slack_webhook', '웹훅', value=arg['notify_slack_webhook']) }}
|
||||
{{ macros.setting_input_text_and_buttons('tmp_text_slack', 'Test', [['tmp_slack_test_btn', '전송']], value='테스트 메시지입니다.', col='9') }}
|
||||
</div>
|
||||
{{ macros.m_tab_content_end() }}
|
||||
|
||||
{{ macros.m_tab_content_start('advanced', false) }}
|
||||
@@ -53,6 +61,7 @@
|
||||
$(document).ready(function(){
|
||||
use_collapse("notify_telegram_use");
|
||||
use_collapse("notify_discord_use");
|
||||
use_collapse("notify_slack_use");
|
||||
use_collapse("notify_advaned_use");
|
||||
});
|
||||
|
||||
@@ -64,6 +73,10 @@ $('#notify_discord_use').change(function() {
|
||||
use_collapse('notify_discord_use');
|
||||
});
|
||||
|
||||
$('#notify_slack_use').change(function() {
|
||||
use_collapse('notify_slack_use');
|
||||
});
|
||||
|
||||
$('#notify_advaned_use').change(function() {
|
||||
use_collapse('notify_advaned_use');
|
||||
});
|
||||
@@ -80,6 +93,11 @@ $("body").on('click', '#tmp_discord_test_btn', function(e){
|
||||
globalSendCommand('notify_test', 'discord', $('#notify_discord_webhook').val(), $('#tmp_text_discord').val());
|
||||
});
|
||||
|
||||
$("body").on('click', '#tmp_slack_test_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommand('notify_test', 'slack', $('#notify_slack_webhook').val(), $('#tmp_text_slack').val());
|
||||
});
|
||||
|
||||
$("body").on('click', '#tmp_advanced_test_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommand('notify_test', 'advanced', $('#tmp_message_id').val(), $('#tmp_text_advanced').val());
|
||||
|
||||
@@ -63,7 +63,7 @@ $("body").on('click', '#foreground_command_btn', function(e){
|
||||
|
||||
$("body").on('click', '#job_new_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('job_new', $('#command').val(), null, null, null, function(ret){
|
||||
globalSendCommandPage('job_new', $('#command').val(), null, null, function(ret){
|
||||
request_list();
|
||||
});
|
||||
});
|
||||
@@ -79,7 +79,7 @@ $("body").on('click', '#select_file_btn', function(e){
|
||||
|
||||
|
||||
function request_list() {
|
||||
globalSendCommandPage('job_list', null, null, null, null, function(ret){
|
||||
globalSendCommandPage('job_list', null, null, null, function(ret){
|
||||
make_list(ret.data);
|
||||
});
|
||||
}
|
||||
@@ -92,18 +92,16 @@ function make_list(data) {
|
||||
<th style="width:60%; text-align:center;">Command & arg & Desc</th> \
|
||||
<th style="width:5%; text-align:center;">자동</th> \
|
||||
<th colspan="2" style="width:20%; text-align:center;">스케쥴 상태</th> \
|
||||
<th style="width:10%; text-align:center;">스케쥴</th> \
|
||||
<th style="width:10%; text-align:center;">스케쥴주기</th> \
|
||||
</tr></thead><tbody id="list">';
|
||||
|
||||
if (data.length == 0) str += '<tr><td colspan="6"><h4>작업이 없습니다.</h4></td></tr>';
|
||||
|
||||
for(i in data) {
|
||||
console.log(data[i]);
|
||||
//console.log(data[i]);
|
||||
str += '<tr class="chover" style="cursor: pointer;" data-toggle="collapse" data-target="#collapse_' + i + '" aria-expanded="true" >';
|
||||
|
||||
str += '<td rowspan="2" scope="col" style="width:5%; text-align:center;">'+ (data[i].id) + '</td>';
|
||||
|
||||
|
||||
// command
|
||||
tmp = '';
|
||||
tmp += text_color(data[i].command, 'blue') + '<br>';
|
||||
@@ -123,7 +121,7 @@ function make_list(data) {
|
||||
tmp1 = "시작시 한번 실행";
|
||||
} else if (data[i].schedule_mode == 'scheduler') {
|
||||
tmp1 = "스케쥴링";
|
||||
tmp2 = '<input id="use_checkbox|'+data[i].id+'" type="checkbox" data-id='+data[i].id+' data-toggle="toggle" data-on="On" data-off="Off" data-onstyle="info" data-offstyle="danger" data-size="small" ' + ((data[i].scheduler_is_include) ? 'checked' : '') + '>';
|
||||
tmp2 = '<input id="use_checkbox|'+data[i].id+'" type="checkbox" data-id='+data[i].id+' data-toggle="toggle" data-on="On" data-off="Off" data-onstyle="danger" data-offstyle="info" data-size="small" ' + ((data[i].scheduler_is_include) ? 'checked' : '') + '>';
|
||||
if (data[i].scheduler_is_include) {
|
||||
tmp2 += (data[i].scheduler_is_running) ? "<br>실행중" : "<br>대기중";
|
||||
}
|
||||
@@ -197,7 +195,7 @@ $("body").on('click', '#job_save_btn', function(e){
|
||||
}
|
||||
|
||||
var formData = getFormdata('#item_setting');
|
||||
globalSendCommandPage('job_save', formData, null, null, null, function(ret){
|
||||
globalSendCommandPage('job_save', formData, null, null, function(ret){
|
||||
if (ret.ret == 'success') {
|
||||
$('#job_modal').modal('hide');
|
||||
request_list();
|
||||
@@ -216,7 +214,7 @@ $("body").on('click', '#job_remove_btn', function(e){
|
||||
});
|
||||
|
||||
function remove_job(job_id) {
|
||||
globalSendCommandPage('job_remove', job_id, null, null, null, function(ret){
|
||||
globalSendCommandPage('job_remove', job_id, null, null, function(ret){
|
||||
if (ret.ret == 'success') {
|
||||
$('#job_modal').modal('hide');
|
||||
request_list();
|
||||
@@ -267,14 +265,14 @@ $("body").on('click', '#job_fore_execute_btn', function(e){
|
||||
|
||||
$("body").on('click', '#job_back_execute_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('job_back_execute', $(this).data('id'), null, null, null, function(e) {
|
||||
globalSendCommandPage('job_back_execute', $(this).data('id'), null, null, function(e) {
|
||||
request_list();
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#job_log_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('job_log', $(this).data('id'), null, null, null, function(data){
|
||||
globalSendCommandPage('job_log', $(this).data('id'), null, null, function(data){
|
||||
if (data.ret == 'success') {
|
||||
redirect = '/system/all_log/list';
|
||||
$.redirectPost(redirect, {filename: data.filename});
|
||||
@@ -293,14 +291,14 @@ $("body").on('click', '#job_cmd_input_btn', function(e){
|
||||
|
||||
$("body").on('change', 'input[id^="use_checkbox|"]', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('task_sched', $(this).data('id'), $(this).prop('checked'), null, null, function(e) {
|
||||
globalSendCommandPage('task_sched', $(this).data('id'), $(this).prop('checked'), null, function(e) {
|
||||
request_list();
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#job_process_stop_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('job_process_stop', $(this).data('id'), null, null, null, function(e) {
|
||||
globalSendCommandPage('job_process_stop', $(this).data('id'), null, null, function(e) {
|
||||
request_list();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
function refresh() {
|
||||
globalSendCommandPage('get_freeze', null, null, null, null, function(ret){
|
||||
globalSendCommandPage('get_freeze', null, null, null, function(ret){
|
||||
make_list(ret.data);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user