145 lines
4.0 KiB
HTML
145 lines
4.0 KiB
HTML
{% extends "base.html" %}
|
|
{% block content %}
|
|
|
|
<div>
|
|
<nav>
|
|
{{ macros.m_tab_head_start() }}
|
|
{{ macros.m_tab_head2('system', '시스템 변수', true) }}
|
|
{{ macros.m_tab_head2('celery', 'celery 상태', false) }}
|
|
{{ macros.m_tab_head_end() }}
|
|
</nav>
|
|
|
|
<div class="tab-content" id="nav-tabContent">
|
|
{{ macros.m_tab_content_start('system', true) }}
|
|
<form id='setting' name='setting'>
|
|
{{ macros.setting_input_textarea('export', '환경변수', desc=['',
|
|
'도커를 재시작하거나 sjva3.sh 스크립트를 재시작해야 적용됩니다.',
|
|
'구동 환경에 따라 사용하는 변수가 다릅니다.',
|
|
'',
|
|
'USE_CELERY : 멀티프로세싱 작업 사용 여부 설정. true or false',
|
|
'CELERY_WORKER_COUNT : 작업 프로세스 개수.',
|
|
'USE_GEVENT : 비동기 라이브러리 사용 설정. true or false. 클수록 메모리를 많이 소비하는 대신 더 원할하게 동작', '',
|
|
'REDIS_PORT : celery에서 사용하는 redis port. 특별한 경우외에는 변경하지 마세요',
|
|
'SJVA_PORT : 이 변수가 있는 경우 DB값을 무시하고 port로 설정',
|
|
],
|
|
value=arg['export'], row='10') }}
|
|
{{ macros.setting_button([['setting_save_btn', '저장'], ['shutdown_btn', '시스템 종료']]) }}
|
|
</form>
|
|
</form>
|
|
{{ macros.m_tab_content_end() }}
|
|
|
|
{{ macros.m_tab_content_start('celery', false) }}
|
|
{{ macros.setting_button([['celery_test_btn', 'Celery Test'], ['worker_start_btn', '워커 재시작'], ['ps_btn', '프로세스 목록']]) }}
|
|
|
|
{{ macros.m_tab_content_end() }}
|
|
</div><!--tab-content-->
|
|
</div> <!--전체-->
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
var package_name = "{{arg['package_name']}}";
|
|
var sub = "{{arg['sub'] }}";
|
|
|
|
$(document).ready(function(){
|
|
|
|
});
|
|
|
|
$("body").on('click', '#setting_save_btn', function(e){
|
|
e.preventDefault();
|
|
var formData = get_formdata('#setting');
|
|
$.ajax({
|
|
url: '/' + package_name + '/ajax/' + sub + '/setting_save',
|
|
type: "POST",
|
|
cache: false,
|
|
data: formData,
|
|
dataType: "json",
|
|
success: function (ret) {
|
|
if (ret) {
|
|
$.notify('<strong>시스템 변수를 저장하였습니다.</strong>', {
|
|
type: 'success'
|
|
});
|
|
} else {
|
|
$.notify('<strong>시스템 변수 저장에 실패하였습니다.</strong>', {
|
|
type: 'warning'
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$("body").on('click', '#shutdown_btn', function(e){
|
|
e.preventDefault();
|
|
shutdown_confirm();
|
|
});
|
|
|
|
$("body").on('click', '#celery_test_btn', function(e){
|
|
e.preventDefault();
|
|
$.ajax({
|
|
url: '/' + package_name + '/ajax/' + sub + '/celery_test',
|
|
type: "POST",
|
|
cache: false,
|
|
data: {},
|
|
dataType: "json",
|
|
success: function (ret) {
|
|
if (ret.ret == 'success') {
|
|
$.notify('<strong>'+ ret.data+'</strong>', {
|
|
type: 'success'
|
|
});
|
|
} else if (ret.ret == 'timeout' || ret.ret == 'no_celery') {
|
|
$.notify('<strong>'+ ret.data+'</strong>', {
|
|
type: 'warning'
|
|
});
|
|
}
|
|
//m_modal(ret)
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$("body").on('click', '#ps_btn', function(e){
|
|
e.preventDefault();
|
|
$.ajax({
|
|
url: '/' + package_name + '/ajax/' + sub + '/ps',
|
|
type: "POST",
|
|
cache: false,
|
|
data: {},
|
|
dataType: "json",
|
|
success: function (ret) {
|
|
}
|
|
});
|
|
});
|
|
|
|
$("body").on('click', '#worker_start_btn', function(e){
|
|
e.preventDefault();
|
|
$.ajax({
|
|
url: '/' + package_name + '/ajax/' + sub + '/worker_start',
|
|
type: "POST",
|
|
cache: false,
|
|
data: {},
|
|
dataType: "json",
|
|
success: function (ret) {
|
|
if (ret.ret == 'success') {
|
|
$.notify('<strong>'+ ret.data+'</strong>', {
|
|
type: 'success'
|
|
});
|
|
} else if (ret.ret == 'timeout' || ret.ret == 'no_celery' || ret.ret == 'not_registered') {
|
|
$.notify('<strong>'+ ret.data+'</strong>', {
|
|
type: 'warning'
|
|
});
|
|
}
|
|
//m_modal(ret)
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
{% endblock %}
|