update
This commit is contained in:
@@ -16,108 +16,45 @@
|
||||
|
||||
{{ macros.setting_input_textarea('celery_start_command', 'celery 실행 명령', desc=['',
|
||||
|
||||
'예: celery -A flaskfarm.main.celery worker --loglevel=info --pool=gevent --concurrency=2 --config_filepath="config.yaml파일경로" --running_type=native',
|
||||
'예: celery -A flaskfarm.main.celery worker --workdir={F.config["path_working"]} --loglevel=info --pool=gevent --concurrency=2 --config_filepath={F.config["config_filepath"]} --running_type=native',
|
||||
'',
|
||||
'패키지로 실행시 : -A flaskfarm.main.celery',
|
||||
'GIT 소스로 실행시 : -A main.celery (현재 작업폴더가 flaskfarm)',
|
||||
'Git 소스로 실행시 : -A main.celery', '',
|
||||
'Linux는 사용자에 따라 export C_FORCE_ROOT=true 필요'
|
||||
],
|
||||
value=arg['celery_start_command'], row='5') }}
|
||||
</form>
|
||||
{{ macros.setting_buttons([['celery_excute_btn', '실행 테스트']]) }}
|
||||
{{ macros.setting_buttons([['celery_excute_btn', '실행 테스트'], ['celery_excute_back_btn', '실행(Background) ']]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var running_type = "{{arg['running_type']}}";
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
console.log(running_type);
|
||||
if (running_type == 'docker') {
|
||||
$('#celery_start_by_web').bootstrapToggle('off');
|
||||
$('#celery_start_by_web').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
$("body").on('click', '#celery_excute_btn', function(e){
|
||||
e.preventDefault();
|
||||
globalSendCommand('celery_execute', $('#celery_start_command').val());
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$("body").on('click', '#shutdown_btn', function(e){
|
||||
$("body").on('click', '#celery_excute_back_btn', function(e){
|
||||
e.preventDefault();
|
||||
shutdown_confirm();
|
||||
globalSendCommand('celery_execute_back', $('#celery_start_command').val());
|
||||
});
|
||||
|
||||
$("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)
|
||||
}
|
||||
});
|
||||
globalSendCommand('celery_test');
|
||||
});
|
||||
|
||||
|
||||
$("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 %}
|
||||
|
||||
Reference in New Issue
Block a user