update
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
<div>
|
||||
{{ macros.setting_select_empty('log_select1', '로그 파일 선택 (.log)') }}
|
||||
{{ macros.setting_select_empty('log_select2', '로그 파일 선택 (.logX)') }}
|
||||
<!--{{ macros.setting_select_empty('log_select2', '로그 파일 선택 (.logX)') }}-->
|
||||
<nav>
|
||||
{{ macros.m_tab_head_start() }}
|
||||
{{ macros.m_tab_head('이전', true) }}
|
||||
@@ -42,7 +42,7 @@ var start_filename = "{{arg['filename']}}";
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#main_container').attr('class', 'container-fluid');
|
||||
ResizeTextArea()
|
||||
ResizeTextAreaAllLog()
|
||||
make_form()
|
||||
if (start_filename != '')
|
||||
document.getElementById('log_select').value = start_filename;
|
||||
@@ -56,13 +56,14 @@ 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,14 +76,14 @@ $("body").on('change', '#log_select', function(e){
|
||||
});
|
||||
|
||||
|
||||
function ResizeTextArea() {
|
||||
function ResizeTextAreaAllLog() {
|
||||
ClientHeight = window.innerHeight
|
||||
$("#log").height(ClientHeight-300);
|
||||
$("#add").height(ClientHeight-320);
|
||||
}
|
||||
|
||||
$(window).resize(function() {
|
||||
ResizeTextArea();
|
||||
ResizeTextAreaAllLog();
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -159,13 +159,13 @@ function make_scheduler_list(data) {
|
||||
TD_STR = '<td scope="col" style="width:10%; text-align:center;">';
|
||||
for(var i in data) {
|
||||
if (data[i].is_running) {
|
||||
str += '<tr class="bg-light">';
|
||||
str += '<tr class="bg-dark text-white">';
|
||||
} else {
|
||||
str += '<tr>';
|
||||
}
|
||||
str += '<td scope="col" style="width:5%; text-align:center;">' + (parseInt(i)+1) + '</td>';
|
||||
str += '<td scope="col" style="width:10%; text-align:center;">' + (data[i].plugin) + '<br>' + (data[i].id) + '</td>';
|
||||
str += '<td scope="col" style="width:10%; text-align:center;">' + ((data[i].is_running) ?'실행중':'대기중') + '</td>';
|
||||
str += '<td scope="col" style="width:10%; text-align:center;">' + ((data[i].is_running) ? '실행중':'대기중') + '</td>';
|
||||
str += '<td scope="col" style="width:10%; text-align:center;">' + (data[i].next_run_time) + '</td>';
|
||||
str += '<td scope="col" style="width:10%; text-align:center;">' + (data[i].remain_time) + '</td>';
|
||||
|
||||
@@ -180,54 +180,6 @@ function make_scheduler_list(data) {
|
||||
|
||||
$("#scheduler_list_div").html(str);
|
||||
return;
|
||||
|
||||
|
||||
str = m_row_start(p='0');
|
||||
str += m_col(1, '<strong>NO</strong>');
|
||||
str += m_col(2, '<strong>플러그인 & ID</strong>');
|
||||
//str += m_col(2, '<strong>생성 & 다음 실행</strong>');
|
||||
str += m_col(2, '<strong>다음 실행 (남은시간)</strong>');
|
||||
str += m_col(1, '<strong>이전소요/횟수</strong>');
|
||||
str += m_col(2, '<strong>Interval & Cron</strong>');
|
||||
str += m_col(1, '<strong>상태</strong>');
|
||||
str += m_col(3, '<strong>설 명</strong>');
|
||||
str += m_row_end();
|
||||
str += m_hr();
|
||||
|
||||
for(var i in data) {
|
||||
if (data[i].is_running) {
|
||||
str += m_row_start_color2(0);
|
||||
} else {
|
||||
str += m_row_start(p='0');
|
||||
}
|
||||
|
||||
str += m_col(1, data[i].no);
|
||||
tmp = '<strong>'+data[i].plugin+'</strong><br>' + data[i].id;
|
||||
str += m_col(2, tmp);
|
||||
|
||||
//tmp = ''+''+'' + data[i].make_time + '<br>';
|
||||
//tmp += ''+''+'' + data[i].next_run_time + '<br>';
|
||||
tmp = ''+''+'' + data[i].next_run_time + '<br>';
|
||||
if (data[i].remain_time != '') {
|
||||
tmp += '('+data[i].remain_time+')';
|
||||
}
|
||||
str += m_col(2, tmp);
|
||||
tmp = ''+''+'' + data[i].running_timedelta + '초 / ';
|
||||
tmp += ''+''+'' + data[i].count + '회';
|
||||
str += m_col(1, tmp);
|
||||
|
||||
tmp = ''+''+'' + data[i].interval + ' <br>';
|
||||
str += m_col(2, tmp);
|
||||
tmp = ''+''+'' + ((data[i].is_running) ?'실행중':'대기중') + '';
|
||||
if (data[i].run == false) {
|
||||
tmp += '(F)'
|
||||
}
|
||||
str += m_col(1, tmp);
|
||||
str += m_col(3, data[i].description);
|
||||
str += m_row_end();
|
||||
str += m_hr();
|
||||
}
|
||||
document.getElementById("scheduler_list_div").innerHTML = str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,39 +36,39 @@ function make_plugin_list(data) {
|
||||
console.log(data)
|
||||
for (i in data) {
|
||||
console.log(data[i]);
|
||||
str += m_row_start();
|
||||
str += m_col_wide(1, (parseInt(i)+1), 'center')
|
||||
str += j_row_start();
|
||||
str += j_col_wide(1, (parseInt(i)+1), 'center')
|
||||
if (data[i].title == null) {
|
||||
str += m_col_wide(2, '');
|
||||
str += m_col_wide(2, data[i].package_name);
|
||||
str += m_col_wide(5, '');
|
||||
tmp = m_button('uninstall_btn', '삭제', {'package_name':data[i].package_name}, 'danger', false, true);
|
||||
str += j_col_wide(2, '');
|
||||
str += j_col_wide(2, data[i].package_name);
|
||||
str += j_col_wide(5, '');
|
||||
tmp = j_button('uninstall_btn', '삭제', {'package_name':data[i].package_name}, 'danger', false, true);
|
||||
} else {
|
||||
str += m_col_wide(2, data[i].title);
|
||||
str += j_col_wide(2, data[i].title);
|
||||
|
||||
str += m_col_wide(2, data[i].package_name);
|
||||
str += m_col_wide(1, data[i].developer);
|
||||
str += m_col_wide(1, data[i].version);
|
||||
str += j_col_wide(2, data[i].package_name);
|
||||
str += j_col_wide(1, data[i].developer);
|
||||
str += j_col_wide(1, data[i].version);
|
||||
if (data[i].loading == false) {
|
||||
tmp = data[i].description + '<br>' + text_color('[로딩 실패] ') + data[i].status;
|
||||
str += m_col_wide(3, tmp);
|
||||
str += j_col_wide(3, tmp);
|
||||
|
||||
} else {
|
||||
str += m_col_wide(3, data[i].description);
|
||||
str += j_col_wide(3, data[i].description);
|
||||
}
|
||||
|
||||
tmp = ''
|
||||
|
||||
tmp += m_button_small('globalOpenBtn', '홈페이지', {'url':data[i].home}, 'primary', false, true);
|
||||
tmp += m_button_small('uninstall_btn', '삭제', {'package_name':data[i].package_name, 'title':data[i].title}, 'danger', false, true);
|
||||
tmp += m_button_small('json_btn', 'JSON', {'idx':i}, 'info', false, true);
|
||||
tmp += j_button_small('globalOpenBtn', '홈페이지', {'url':data[i].home}, 'primary', false, true);
|
||||
tmp += j_button_small('uninstall_btn', '삭제', {'package_name':data[i].package_name, 'title':data[i].title}, 'danger', false, true);
|
||||
tmp += j_button_small('json_btn', 'JSON', {'idx':i}, 'info', false, true);
|
||||
}
|
||||
tmp = m_button_group(tmp)
|
||||
str += m_col_wide(2, tmp, 'right')
|
||||
str += m_row_end();
|
||||
if (i != current_data.length -1) str += m_hr(0);
|
||||
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);
|
||||
}
|
||||
document.getElementById("plugin_list_div").innerHTML = str;
|
||||
$("#plugin_list_div").html(str);
|
||||
}
|
||||
|
||||
$("body").on('click', '#json_btn', function(e){
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
{{ macros.m_hr() }}
|
||||
|
||||
{{ macros.setting_checkbox('use_apikey', 'APIKEY 사용', value=arg['use_apikey'], desc=['On : 모든 API 요청 시 apikey 값을 입력해야 합니다.', '없거나 틀릴 경우 에러코드 403리턴']) }}
|
||||
<div id="use_apikey_div" class="collapse">
|
||||
{{ macros.setting_input_text_and_buttons('apikey', 'APIKEY', [['apikey_generate_btn', '자동생성']], col='4', value=arg['apikey']) }}
|
||||
</div>
|
||||
{{ macros.setting_input_text_and_buttons('apikey', 'APIKEY', [['apikey_generate_btn', '자동생성']], col='4', value=arg['apikey']) }}
|
||||
{{ macros.m_hr() }}
|
||||
</form>
|
||||
</div> <!--전체-->
|
||||
@@ -27,17 +25,12 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
use_collapse("use_login");
|
||||
use_collapse("use_apikey");
|
||||
});
|
||||
|
||||
$('#use_login').change(function() {
|
||||
use_collapse('use_login');
|
||||
});
|
||||
|
||||
$('#use_apikey').change(function() {
|
||||
use_collapse('use_apikey');
|
||||
});
|
||||
|
||||
$("body").on('click', '#apikey_generate_btn', function(e) {
|
||||
e.preventDefault();
|
||||
globalSendCommand('apikey_generate', null, null, null, null, function(ret){
|
||||
|
||||
310
lib/system/templates/system_tool_command.html
Normal file
310
lib/system/templates/system_tool_command.html
Normal file
@@ -0,0 +1,310 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
{{ macros.m_button_group([['foreground_command_btn', 'Foreground 실행'], ['job_new_btn', '저장'], ['select_file_btn', '파일선택', [['path_data', arg['path_data']]] ]])}}
|
||||
|
||||
{{ macros.setting_input_textarea_wide('command', 'Command', row='3', value=arg['tool_command_recent'], desc=['예) cmd, bssh, sh, python test.py, LOAD test.py, curl ifconfig.me']) }}
|
||||
|
||||
<div id="list_div"></div>
|
||||
|
||||
{{ macros.m_modal_start('job_modal', '', 'modal-lg') }}
|
||||
<form id='item_setting' name='item_setting'>
|
||||
<input type='hidden' id="job_id" name="job_id">
|
||||
{{ macros.setting_input_textarea_wide('job_command', 'Command', row=5, desc=['LOAD형으로 실행할 경우 python 대신 LOAD로 시작']) }}
|
||||
{{ macros.setting_input_text('job_command_args', 'ARGS', desc=['Command에 덧붙여 전달할 값. API로 변경 가능']) }}
|
||||
|
||||
{{ macros.setting_input_text('job_description', 'Description') }}
|
||||
{{ macros.setting_radio_with_value('job_schedule_mode', '스케쥴링 타입', [['none', '없음'], ['startup', '시작시 한번 실행'], ['scheduler', '스케쥴링']]) }}
|
||||
{{ macros.setting_input_text('job_schedule_interval', '스케쥴링 정보', desc=['Interval(minute 단위)이나 Cron 설정']) }}
|
||||
{{ macros.setting_checkbox('job_schedule_auto_start', '시작시 스케쥴링 등록', desc=['On : 시작시 자동으로 스케쥴러에 등록됩니다.']) }}
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{ macros.m_button_group([['job_save_btn', '저장'], ['job_remove_btn', '삭제'], ['modal_hide_btn', '닫기']])}}
|
||||
</div>
|
||||
</div></div></div>
|
||||
|
||||
<div class="modal fade" id="file_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="modal_title">Site </h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_body" style="word-break:break-all;">
|
||||
<form id="file_form" name="file_form">
|
||||
<div class="input-group col-sm-12">
|
||||
<textarea id="file_textarea" name="file_textarea" class="col-md-12" rows="50"></textarea>
|
||||
</div>
|
||||
<input type="hidden" name="file_job_id" id="file_job_id" value="-1">
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="file_save_btn" type="button" class="btn btn-primary">저장</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
request_list();
|
||||
});
|
||||
|
||||
|
||||
////////////////////////////////// 상단 버튼
|
||||
$("body").on('click', '#foreground_command_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('foreground_command', $('#command').val());
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#job_new_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('job_new', $('#command').val(), null, null, null, function(ret){
|
||||
request_list();
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#select_file_btn', function(e){
|
||||
e.preventDefault();
|
||||
path_data = $(this).data('path_data');
|
||||
globalSelectLocalFile("파일 선택", path_data, function(ret){
|
||||
$('#command').val(ret);
|
||||
});
|
||||
});
|
||||
////////////////////////////////// 상단 버튼 END
|
||||
|
||||
|
||||
function request_list() {
|
||||
globalSendCommandPage('job_list', null, null, null, null, function(ret){
|
||||
make_list(ret.data);
|
||||
});
|
||||
}
|
||||
|
||||
function make_list(data) {
|
||||
current_data = data;
|
||||
str = '';
|
||||
str = '<table id="result_table" class="table table-sm" ><thead class="thead-dark"><tr> \
|
||||
<th style="width:5%; text-align:center;">ID</th> \
|
||||
<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> \
|
||||
</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]);
|
||||
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>';
|
||||
tmp += data[i].args + '<br>';
|
||||
tmp += data[i].description + '<br>';
|
||||
|
||||
str += '<td scope="col" style="width:60%; text-align:left;">'+ tmp + '</td>';
|
||||
|
||||
|
||||
tmp = (data[i].schedule_auto_start) ? text_color("ON", 'blue') : "OFF";
|
||||
str += '<td scope="col" style="width:5%; text-align:center;">'+ tmp + '</td>';
|
||||
|
||||
tmp2 = null;
|
||||
if (data[i].schedule_mode == 'none') {
|
||||
tmp1 = "없음";
|
||||
} else if (data[i].schedule_mode == 'startup') {
|
||||
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' : '') + '>';
|
||||
if (data[i].scheduler_is_include) {
|
||||
tmp2 += (data[i].scheduler_is_running) ? "<br>실행중" : "<br>대기중";
|
||||
}
|
||||
}
|
||||
if (tmp2 == null) {
|
||||
str += '<td scope="col" colspan="2" style="width:20%; text-align:center;">'+ tmp1 + '</td>';
|
||||
} else {
|
||||
str += '<td scope="col" style="width:10%; text-align:right;">'+ tmp1 + '</td>';
|
||||
str += '<td scope="col" style="width:10%; text-align:left;">'+ tmp2 + '</td>';
|
||||
}
|
||||
str += '<td scope="col" style="width:10%; text-align:center;">'+ data[i].schedule_interval + '</td>';
|
||||
str += '</tr>'
|
||||
|
||||
str += '<tr>'
|
||||
tmp = j_row_start(0);
|
||||
tmp += j_col('0', '');
|
||||
btn = j_button('job_edit_btn', '작업 편집', {'idx':i}, 'secondary', false, true);
|
||||
btn += j_button('job_remove_from_table_btn', '삭제', {'id':data[i].id}, 'danger', true, true);
|
||||
btn += j_button('job_fore_execute_btn', 'Foreground 실행', {'id':data[i].id}, 'primary', true, true);
|
||||
btn += j_button('job_back_execute_btn', 'Background 실행', {'id':data[i].id}, 'primary', true, true);
|
||||
btn += j_button('job_log_btn', '로그', {'id':data[i].id}, 'info', true, true);
|
||||
btn += j_button('job_cmd_input_btn', 'Command에 입력', {'idx':i}, 'info', true, true);
|
||||
if ( data[i].filepath != '' && data[i].filepath != null )
|
||||
btn += j_button('globalEditBtn', '파일 수정', {'file':data[i].filepath}, 'info', false, true);
|
||||
if ( data[i].process )
|
||||
btn += j_button('job_process_stop_btn', '실행중인 Process 중지', {'id':data[i].id}, 'danger', false, true);
|
||||
tmp += j_col('12', j_button_group(btn));
|
||||
tmp += j_row_end();
|
||||
str += '<td colspan="1" scope="col" style="width:5%; text-align:center;">'+ tmp + '</td>';
|
||||
str += '</tr>'
|
||||
}
|
||||
str += '</table>';
|
||||
document.getElementById("list_div").innerHTML = str;
|
||||
$('input[id^="use_checkbox|"]').bootstrapToggle();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$('input[type=radio][name=job_schedule_mode]').change(function() {
|
||||
set_schedule_mode(this.value);
|
||||
});
|
||||
|
||||
|
||||
function set_schedule_mode(mode) {
|
||||
$('input:radio[name="job_schedule_mode"][value="'+mode+'"]').attr('checked',true);
|
||||
|
||||
if ( mode == 'none' || mode == 'startup') {
|
||||
$("#job_schedule_interval").attr('disabled', true);
|
||||
$("#job_schedule_auto_start").attr('disabled', true);
|
||||
} else {
|
||||
$("#job_schedule_interval").attr('disabled', false);
|
||||
$("#job_schedule_auto_start").attr('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 아이템 저장 버튼
|
||||
$("body").on('click', '#job_save_btn', function(e){
|
||||
e.preventDefault();
|
||||
//tmp = document.getElementById("schedule_radio2").getAttribute("checked");
|
||||
schedule_mode = $('input[name=job_schedule_mode]:checked').val();
|
||||
console.log(tmp);
|
||||
|
||||
schedule_interval = $("#job_schedule_interval").val();
|
||||
|
||||
if (schedule_mode == 'scheduler' && schedule_interval == '') {
|
||||
notify("스케쥴링 정보를 입력하세요", 'warning');
|
||||
return
|
||||
}
|
||||
|
||||
var formData = getFormdata('#item_setting');
|
||||
globalSendCommandPage('job_save', formData, null, null, null, function(ret){
|
||||
if (ret.ret == 'success') {
|
||||
$('#job_modal').modal('hide');
|
||||
request_list();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#modal_hide_btn', function(e){
|
||||
e.preventDefault();
|
||||
$('#job_modal').modal('hide');
|
||||
});
|
||||
|
||||
$("body").on('click', '#job_remove_btn', function(e){
|
||||
e.preventDefault();
|
||||
remove_job($("#job_id").val());
|
||||
});
|
||||
|
||||
function remove_job(job_id) {
|
||||
globalSendCommandPage('job_remove', job_id, null, null, null, function(ret){
|
||||
if (ret.ret == 'success') {
|
||||
$('#job_modal').modal('hide');
|
||||
request_list();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// JOB 테이블 제어
|
||||
$("body").on('click', '#job_edit_btn', function(e){
|
||||
e.preventDefault();
|
||||
idx = parseInt($(this).data('idx'));
|
||||
item = current_data[idx];
|
||||
$("#job_id").val(item.id);
|
||||
$("#job_modal_title").html('ID: ' + item.id + ' Command ID: ' + item.command_id);
|
||||
$("#job_command").val(item.command);
|
||||
$("#job_description").val(item.description);
|
||||
$("#job_command_args").val(item.args);
|
||||
set_schedule_mode(item.schedule_mode);
|
||||
if ( item.schedule_mode == 'scheduler') {
|
||||
$("#scheduler_swtich_btn").attr('disabled', false);
|
||||
} else {
|
||||
$("#scheduler_swtich_btn").attr('disabled', true);
|
||||
}
|
||||
$("#job_schedule_interval").val(item.schedule_interval);
|
||||
if (item.schedule_auto_start) {
|
||||
$("#job_schedule_auto_start").val('on');
|
||||
$('#job_schedule_auto_start').bootstrapToggle('on')
|
||||
} else {
|
||||
$("#job_schedule_auto_start").val('off');
|
||||
$('#job_schedule_auto_start').bootstrapToggle('off')
|
||||
}
|
||||
$("#job_modal").modal();
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#job_remove_from_table_btn', function(e){
|
||||
e.preventDefault();
|
||||
remove_job($(this).data('id'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("body").on('click', '#job_fore_execute_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('job_fore_execute', $(this).data('id'));
|
||||
});
|
||||
|
||||
$("body").on('click', '#job_back_execute_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('job_back_execute', $(this).data('id'), null, 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){
|
||||
if (data.ret == 'success') {
|
||||
redirect = '/system/all_log/list';
|
||||
$.redirectPost(redirect, {filename: data.filename});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#job_cmd_input_btn', function(e){
|
||||
e.preventDefault();
|
||||
idx = parseInt($(this).data('idx'));
|
||||
$("#command").val((current_data[idx].command + ' ' + current_data[idx].args).trim());
|
||||
window.scrollTo(0,0);
|
||||
});
|
||||
|
||||
|
||||
$("body").on('change', 'input[id^="use_checkbox|"]', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommandPage('task_sched', $(this).data('id'), $(this).prop('checked'), null, 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) {
|
||||
request_list();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
76
lib/system/templates/system_tool_python.html
Normal file
76
lib/system/templates/system_tool_python.html
Normal file
@@ -0,0 +1,76 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div>
|
||||
{{ macros.m_button_group([['globalSettingSaveBtn', '설정 저장']])}}
|
||||
{{ macros.m_row_start('5') }}
|
||||
{{ macros.m_row_end() }}
|
||||
<nav>
|
||||
{{ macros.m_tab_head_start() }}
|
||||
{{ macros.m_tab_head2('normal', '일반', true) }}
|
||||
|
||||
{{ macros.m_tab_head_end() }}
|
||||
</nav>
|
||||
<form id='setting' name='setting'>
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
{{ macros.m_tab_content_start('normal', true) }}
|
||||
{{ macros.setting_checkbox('tool_crypt_use_user_key', '암호화 키 직접 입력', value=arg['tool_crypt_use_user_key'], desc=['On : 본인 키 사용', '주의) 변경 후 일반설정-인증-로그인 암호를 새로 저장해야 합니다.', 'Off : 앱 고정 키 사용']) }}
|
||||
<div id="tool_crypt_use_user_key_div" class="collapse">
|
||||
{{ macros.setting_input_text('tool_crypt_user_key', '암호화 키', value=arg['tool_crypt_user_key'], desc=['16진수(숫자, a~e)로 이루어진 32글자. 미만시 앞을 0으로 채움. 초과시 뒤에 무시']) }}
|
||||
</div>
|
||||
|
||||
{{ macros.setting_input_text_and_buttons('tool_crypt_encrypt_word', '암호화', [['tool_crypt_encrypt_word_btn', '암호화']], value=arg['tool_crypt_encrypt_word']) }}
|
||||
{{ macros.setting_input_text('tool_crypt_encrypt_word_result', '', disabled=True) }}
|
||||
|
||||
{{ macros.setting_input_text_and_buttons('tool_crypt_decrypt_word', '평문화', [['tool_crypt_decrypt_word_btn', '평문화']], value=arg['tool_crypt_decrypt_word']) }}
|
||||
{{ macros.setting_input_text('tool_crypt_decrypt_word_result', '', disabled=True) }}
|
||||
{{ macros.m_tab_content_end() }}
|
||||
|
||||
</div><!--tab-content-->
|
||||
</form>
|
||||
</div> <!--전체-->
|
||||
|
||||
<script type="text/javascript">
|
||||
var package_name = "{{arg['package_name'] }}";
|
||||
var sub = "{{arg['sub'] }}";
|
||||
|
||||
$(document).ready(function(){
|
||||
use_collapse("tool_crypt_use_user_key");
|
||||
});
|
||||
|
||||
$("body").on('change', '#tool_crypt_use_user_key', function(e){
|
||||
use_collapse('tool_crypt_use_user_key');
|
||||
});
|
||||
|
||||
$("body").on('click', '#tool_crypt_encrypt_word_btn', function(e) {
|
||||
e.preventDefault();
|
||||
word = document.getElementById("tool_crypt_encrypt_word").value
|
||||
crypt_test('encrypt', word);
|
||||
});
|
||||
|
||||
$("body").on('click', '#tool_crypt_decrypt_word_btn', function(e) {
|
||||
e.preventDefault();
|
||||
word = document.getElementById("tool_crypt_decrypt_word").value
|
||||
crypt_test('decrypt', word);
|
||||
});
|
||||
|
||||
function crypt_test(mode, word) {
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/'+sub+'/crypt_test',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {mode:mode, word:word},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret.ret == 'success') {
|
||||
if (mode == "encrypt")
|
||||
document.getElementById("tool_crypt_encrypt_word_result").value = ret.data;
|
||||
else
|
||||
document.getElementById("tool_crypt_decrypt_word_result").value = ret.data;
|
||||
} else {
|
||||
notify(ret.log, 'warning');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user