first commit
This commit is contained in:
153
lib/system/templates/system_home.html
Executable file
153
lib/system/templates/system_home.html
Executable file
@@ -0,0 +1,153 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<script type="text/javascript">
|
||||
document.getElementById("plugin_first_menu").innerHTML = '';
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<h3>시스템</h3>
|
||||
<hr>
|
||||
{{ macros.info_text('python_version', 'Python 버전') }}
|
||||
{{ macros.info_text('platform', 'Platform') }}
|
||||
{{ macros.info_text('processor', 'Processor') }}
|
||||
{{ macros.info_text_and_buttons('version', 'SJVA 버전', [['changelog_btn', '업데이트 내역'], ['recent_version_btn', '최신버전 확인']]) }}
|
||||
{{ macros.info_text('path_app_root', 'SJVA 폴더') }}
|
||||
{{ macros.info_text('running_type', '실행타입') }}
|
||||
{{ macros.info_text('auth', '인증') }}
|
||||
<div class="d-inline-block"></div>
|
||||
|
||||
<h3>모니터링</h3>
|
||||
<hr>
|
||||
{{ macros.info_text('time', '시간') }}
|
||||
{{ macros.info_text('cpu_percent', 'CPU 사용량') }}
|
||||
{{ macros.info_text('memory', '메모리') }}
|
||||
{{ macros.info_text('disk', '디스크') }}
|
||||
<div class="d-inline-block"></div>
|
||||
|
||||
<h3>스케쥴러</h3>
|
||||
<hr>
|
||||
<div id="scheduler_list_div"></div>
|
||||
</div> <!--전체-->
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
function make_scheduler_list(data) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$.ajax({
|
||||
url: '/system/ajax/info',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data:{},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
make_system(data);
|
||||
}
|
||||
});
|
||||
|
||||
var protocol = window.location.protocol;
|
||||
var socket = io.connect(protocol + "//" + document.domain + ":" + location.port + "/system")
|
||||
socket.on('status', function(data) {
|
||||
make_system(data);
|
||||
make_scheduler_list(data.scheduler);
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#changelog_btn', function(e){
|
||||
e.preventDefault();
|
||||
//window.location.href='/system/information';
|
||||
window.open('https://sjva.me/wiki/public/changelog', "_blank");
|
||||
});
|
||||
|
||||
$("body").on('click', '#recent_version_btn', function(e){
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: '/system/ajax/recent_version',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data:{},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.ret)
|
||||
$.notify('<strong>최신버전 : '+data.version+'</strong>', {type: 'success'});
|
||||
else
|
||||
$.notify('<strong>확인 실패</strong>', {type: 'warning'});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function make_system(data) {
|
||||
for(var key in data.system) {
|
||||
if (key == 'auth' && data.system[key].startsWith('인증')==false)
|
||||
document.getElementById(key).innerHTML = '<span style="color:red;font-weight: bold;font-size: xx-large ;">' + data.system[key]+ '</span>';
|
||||
else {
|
||||
if (document.getElementById(key) != null)
|
||||
document.getElementById(key).innerHTML = data.system[key];
|
||||
}
|
||||
tmp = data.system['version']
|
||||
if (data.system['version'] == data.system['recent_version']) {
|
||||
tmp += ' <span style="color:red;font-weight: bold;">(최신버전)</span>';
|
||||
} else {
|
||||
tmp += ' <span style="color:red;font-weight: bold;">(최신버전이 아닙니다. 최신:'+data.system['recent_version']+')</span>';
|
||||
}
|
||||
document.getElementById('version').innerHTML = tmp;
|
||||
}
|
||||
//console.log(document.getElementById('version'))
|
||||
//document.getElementById('version').innerHTML = data.system.version + data.system.recent_version;
|
||||
}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
1
lib/system/templates/system_home_test.html
Normal file
1
lib/system/templates/system_home_test.html
Normal file
@@ -0,0 +1 @@
|
||||
{% extends "base.html" %} {% block content %} hihi {% endblock %}
|
||||
184
lib/system/templates/system_plugin.html
Executable file
184
lib/system/templates/system_plugin.html
Executable file
@@ -0,0 +1,184 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<style type="text/css">
|
||||
.my_hover:hover{
|
||||
background-color: #ffff00;
|
||||
transition: all 0.01s ease-in-out;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<nav>
|
||||
{{ macros.m_tab_head_start() }}
|
||||
{{ macros.m_tab_head2('normal', '일반', false) }}
|
||||
{{ macros.m_tab_head2('list', '플러그인 목록', true) }}
|
||||
{{ macros.m_tab_head_end() }}
|
||||
</nav>
|
||||
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
|
||||
{{ macros.m_tab_content_start('normal', false) }}
|
||||
<form id='setting' name='setting'>
|
||||
{{ macros.setting_input_text('plugin_dev_path', '개발용 플러그인 경로', value=arg['plugin_dev_path'], desc=['플러그인을 개발할 때 사용하는 경로'], col='9') }}
|
||||
{{ macros.setting_button([['setting_save', '저장']]) }}
|
||||
|
||||
</form>
|
||||
</form>
|
||||
{{ macros.m_tab_content_end() }}
|
||||
|
||||
{{ macros.m_tab_content_start('list', true) }}
|
||||
{{ macros.setting_input_text_and_buttons('plugin_git', '플러그인 수동 설치', [['plugin_install_btn', '설치']], value='https://github.com/', desc=['SJVA.ME 플러그인 게시판에 있는 링크 주소를 입력하세요.']) }}
|
||||
|
||||
{{ macros.m_hr_head_top() }}
|
||||
{{ macros.m_row_start('0') }}
|
||||
{{ macros.m_col(3, macros.m_strong('Name')) }}
|
||||
{{ macros.m_col(1, macros.m_strong('Dev.')) }}
|
||||
{{ macros.m_col(1, macros.m_strong('Category')) }}
|
||||
{{ macros.m_col(1, macros.m_strong('Version')) }}
|
||||
{{ macros.m_col(6, macros.m_strong('Description')) }}
|
||||
{{ macros.m_row_end() }}
|
||||
{{ macros.m_hr_head_bottom() }}
|
||||
<div id="plugin_list_div"></div>
|
||||
{{ macros.m_tab_content_end() }}
|
||||
</div><!--tab-content-->
|
||||
</div> <!--전체-->
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var package_name = 'system';
|
||||
var current_data;
|
||||
var install = "{{arg['install']}}";
|
||||
|
||||
$(document).ready(function(){
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/plugin_list',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
current_data = data
|
||||
make_plugin_list();
|
||||
if (install != '') {
|
||||
$('#plugin_git').val(install);
|
||||
//notify('플러그인이 설치되어 있지 않습니다.', 'danger');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//설정 저장
|
||||
$("#setting_save").click(function(e) {
|
||||
e.preventDefault();
|
||||
var formData = get_formdata('#setting');
|
||||
setting_save_func(formData, true)
|
||||
//
|
||||
});
|
||||
|
||||
|
||||
function setting_save_func(formData, noti) {
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/setting_save',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret) {
|
||||
if (noti) {
|
||||
$.notify('<strong>설정을 저장하였습니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
window.location.href = "/"
|
||||
}
|
||||
} else {
|
||||
$.notify('<strong>설정 저장에 실패하였습니다.</strong>', {
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function make_plugin_list() {
|
||||
str = ''
|
||||
console.log(current_data)
|
||||
for (i in current_data) {
|
||||
console.log(i)
|
||||
console.log(current_data[i])
|
||||
str += m_row_start();
|
||||
str += m_col(3, i)
|
||||
|
||||
if (current_data[i].info != null) {
|
||||
str += m_col(1, current_data[i].info.developer);
|
||||
str += m_col(1, current_data[i].info.category);
|
||||
str += m_col(1, current_data[i].info.version);
|
||||
tmp = ''
|
||||
tmp += m_button('plugin_uninstall_btn', '삭제', [{'key':'plugin_name', 'value':current_data[i].info.name}]);
|
||||
if (current_data[i].info.local_info != null) {
|
||||
tmp += m_button('global_link_btn', 'GIT', [{'key':'url', 'value':current_data[i].info.local_info.home}]);
|
||||
if (current_data[i].info.local_info.home != current_data[i].info.local_info.more && current_data[i].info.local_info.more.startsWith('http'))
|
||||
tmp += m_button('global_link_btn', 'MORE', [{'key':'url', 'value':current_data[i].info.local_info.more}]);
|
||||
}
|
||||
|
||||
tmp = m_button_group(tmp)
|
||||
str += m_col(6, current_data[i].info.description +'<br><br>'+ tmp)
|
||||
}
|
||||
str += m_row_end();
|
||||
if (i != current_data.length -1) str += m_hr(0);
|
||||
}
|
||||
document.getElementById("plugin_list_div").innerHTML = str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$("body").on('click', '#plugin_install_btn', function(e){
|
||||
e.preventDefault();
|
||||
plugin_git = document.getElementById("plugin_git").value
|
||||
|
||||
console.log(plugin_git)
|
||||
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/plugin_install',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data:{"plugin_git": plugin_git},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
t = (data.ret == 'success') ? 'success' : 'warning'
|
||||
$.notify('<strong>'+data.log+'</strong>', {
|
||||
type: t
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("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'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
32
lib/system/templates/system_restart.html
Executable file
32
lib/system/templates/system_restart.html
Executable file
@@ -0,0 +1,32 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div>
|
||||
<h4>
|
||||
{% if sub == 'restart' %}
|
||||
시스템 재시작 중입니다. <br>
|
||||
완료시 이전 페이지로 이동합니다.
|
||||
|
||||
{% elif sub == 'shutdown' %}
|
||||
시스템이 종료되었습니다.
|
||||
{% endif %}
|
||||
</h4>
|
||||
</div>
|
||||
{% if sub == 'restart' %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var referer = "{{referer}}"
|
||||
$('#loading').show();
|
||||
setTimeout(function(){
|
||||
// 1초 후 작동해야할 코드
|
||||
}, 2000);
|
||||
|
||||
var protocol = window.location.protocol;
|
||||
var socket2 = io.connect(protocol + "//" + document.domain + ":" + location.port + "/system_restart");
|
||||
socket2.on('on_connect', function(data){
|
||||
//window.location.href = protocol + "//" + document.domain + ":" + location.port;
|
||||
window.location.href = referer;
|
||||
});
|
||||
})
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
85
lib/system/templates/system_setting_auth.html
Executable file
85
lib/system/templates/system_setting_auth.html
Executable file
@@ -0,0 +1,85 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div>
|
||||
{{ macros.m_button_group([['global_setting_save_btn', '설정 저장']])}}
|
||||
{{ macros.m_row_start('5') }}
|
||||
{{ macros.m_row_end() }}
|
||||
<nav>
|
||||
{{ macros.m_tab_head_start() }}
|
||||
{{ macros.m_tab_head2('normal', '웹 로그인', true) }}
|
||||
{{ macros.m_tab_head2('api', 'API & 홈페이지 인증', false) }}
|
||||
{{ 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('use_login', '로그인 사용', value=arg['use_login']) }}
|
||||
<div id="use_login_div" class="collapse">
|
||||
{{ macros.setting_input_text('id', '로그인 ID', value=arg['id'], desc=['초기값은 sjva입니다.'], col='3') }}
|
||||
{{ macros.setting_input_text('pw', '로그인 암호', value=arg['pw'], col='3', type='password', desc=['초기값은 sjva입니다.']) }}
|
||||
{{ macros.setting_checkbox('hide_menu', '로그인 화면 메뉴 표시 안함', value=arg['hide_menu']) }}
|
||||
</div>
|
||||
{{ macros.m_tab_content_end() }}
|
||||
|
||||
{{ macros.m_tab_content_start('api', false) }}
|
||||
{{ macros.setting_checkbox('auth_use_apikey', 'APIKEY 사용', value=arg['auth_use_apikey'], desc=['On : 모든 API 요청시 apikey 값을 입력해야합니다.', '없거나 틀릴 경우 에러코드 403리턴']) }}
|
||||
{{ macros.setting_input_text_and_buttons('auth_apikey', 'APIKEY', [['generate_btn', '자동생성']], col='4', value=arg['auth_apikey']) }}
|
||||
{{ macros.m_hr() }}
|
||||
{{ macros.setting_input_text('sjva_me_user_id', 'sjva.me 홈페이지 ID', value=arg['sjva_me_user_id'], desc=['ID변경, APIKEY 변경시 재인증해야합니다.'], col='3') }}
|
||||
{{ macros.info_text('sjva_id', 'SJVA ID', value=arg['sjva_id'], desc=['SJVA별로 자동 생성되는 값입니다. 수정불가'] ) }}
|
||||
{{ macros.info_text_and_buttons('auth_result', '인증상태', [['do_auth_btn', '인증하기']], value=arg['auth_result']['desc'], desc=['APIKEY, 홈페이지ID 값을 저장한 후에 시도하세요.']) }}
|
||||
|
||||
{{ 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("use_login");
|
||||
use_collapse("auth_use_apikey");
|
||||
});
|
||||
|
||||
$('#use_login').change(function() {
|
||||
use_collapse('use_login');
|
||||
});
|
||||
|
||||
$("body").on('click', '#generate_btn', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/'+sub+'/apikey_generate',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
document.getElementById("auth_apikey").value = ret
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#do_auth_btn', function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/'+sub+'/do_auth',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.ret) {
|
||||
$.notify('<strong>인증되었습니다. 재시작하세요.<br>'+data.msg+'</strong><br>', {type: 'success'});
|
||||
} else {
|
||||
$.notify('<strong>인증에 실패하였습니다.<br>'+data.msg+'</strong><br>', {type: 'warning'});
|
||||
$.notify('<strong>설정을 먼저 저장하고 시도하세요.</strong><br>', {type: 'warning'});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
420
lib/system/templates/system_setting_basic.html
Executable file
420
lib/system/templates/system_setting_basic.html
Executable file
@@ -0,0 +1,420 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<style type="text/css">
|
||||
.my_hover:hover{
|
||||
background-color: #ffff00;
|
||||
transition: all 0.01s ease-in-out;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<nav>
|
||||
{{ macros.m_tab_head_start() }}
|
||||
{{ macros.m_tab_head2('normal', '일반', true) }}
|
||||
{{ macros.m_tab_head2('web', '웹', false) }}
|
||||
{{ macros.m_tab_head2('menu', '메뉴', false) }}
|
||||
{{ macros.m_tab_head2('link', '링크', false) }}
|
||||
{{ macros.m_tab_head2('download', '다운로드', false) }}
|
||||
{{ macros.m_tab_head_end() }}
|
||||
</nav>
|
||||
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
{{ macros.m_tab_content_start('normal', true) }}
|
||||
<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:// 로 시작해야합니다.', 'RSS, Plex Callback, KLive 등에서 URL생성시 사용합니다.', '테스트 버튼 클릭 후 버전을 확인 할 수 있어야 합니다.']) }}
|
||||
{{ macros.setting_input_text('auto_restart_hour', '자동 재시작 시간', value=arg['auto_restart_hour'], col='3', desc=['자동 재시작 간격(시간단위)이나 Cron 설정을 입력합니다.', '0이면 재시작 안함.']) }}
|
||||
{{ macros.setting_select('log_level', '로그 레벨', [['10', 'DEBUG'],['20', 'INFO'],['30', 'WARNING'],['40', 'ERROR'], ['50', 'CRITICAL'] ], value=arg['log_level'], col='3') }}
|
||||
{{ macros.setting_button([['setting_save', '저장']]) }}
|
||||
</form>
|
||||
</form>
|
||||
{{ macros.m_hr() }}
|
||||
{{ macros.setting_input_text_and_buttons('command_text', 'Command', [['command_run_btn', 'Run']], value='', desc='') }}
|
||||
{{ macros.m_tab_content_end() }}
|
||||
|
||||
|
||||
{{ macros.m_tab_content_start('web', false) }}
|
||||
<form id='setting2' name='setting2'>
|
||||
{{ macros.setting_select('theme', '테마 선택', [['Default','Default'], ['Cerulean','Cerulean'], ['Cosmo','Cosmo'], ['Cyborg','Cyborg'], ['Darkly','Darkly'], ['Flatly','Flatly'], ['Journal','Journal'], ['Litera','Litera'], ['Lumen','Lumen'], ['Lux','Lux'], ['Materia','Materia'], ['Minty','Minty'], ['Morph','Morph'],['Pulse','Pulse'], ['Quartz','Quartz'], ['Sandstone','Sandstone'], ['Simplex','Simplex'], ['Sketchy','Sketchy'], ['Slate','Slate'], ['Solar','Solar'], ['Spacelab','Spacelab'], ['Superhero','Superhero'], ['United','United'], ['Vapor','Vapor'], ['Yeti','Yeti'], ['Zephyr','Zephyr']], value=arg['theme'], desc=['https://bootswatch.com'], col='6') }}
|
||||
{{ macros.setting_input_text('web_title', '웹 타이틀', value=arg['web_title']) }}
|
||||
{{ macros.setting_button([['setting_save2', '저장']]) }}
|
||||
</form>
|
||||
{{ macros.m_tab_content_end() }}
|
||||
|
||||
|
||||
{{ macros.m_tab_content_start('menu', false) }}
|
||||
<form id='setting3' name='setting3'>
|
||||
{% if arg['use_category_vod'] == 'True' %}
|
||||
{{ macros.m_hr() }}
|
||||
{{ macros.setting_button_with_info([['menu_toggle_btn', 'Toggle', [{'key':'category', 'value':'vod'}]]], left='VOD', desc=None) }}
|
||||
<div id="menu_vod_div" class="collapse">
|
||||
{{ macros.setting_checkbox('use_plugin_ffmpeg', 'FFMPEG', value=arg['use_plugin_ffmpeg']) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if arg['use_category_file_process'] == 'True' %}
|
||||
{{ macros.m_hr() }}
|
||||
{{ macros.setting_button_with_info([['menu_toggle_btn', 'Toggle', [{'key':'category', 'value':'file_process'}]]], left='파일처리', desc=None) }}
|
||||
<div id="menu_file_process_div" class="collapse">
|
||||
{{ macros.setting_checkbox('use_plugin_ktv', '국내TV', value=arg['use_plugin_ktv']) }}
|
||||
{{ macros.setting_checkbox('use_plugin_fileprocess_movie', '영화', value=arg['use_plugin_fileprocess_movie']) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if arg['use_category_plex'] == 'True' %}
|
||||
{{ macros.m_hr() }}
|
||||
{{ macros.setting_button_with_info([['menu_toggle_btn', 'Toggle', [{'key':'category', 'value':'plex'}]]], left='PLEX', desc=None) }}
|
||||
<div id="menu_plex_div" class="collapse">
|
||||
{{ macros.setting_checkbox('use_plugin_plex', 'PLEX', value=arg['use_plugin_plex']) }}
|
||||
{{ macros.setting_checkbox('use_plugin_gdrive_scan', 'GDrive 스캔', value=arg['use_plugin_gdrive_scan']) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if arg['use_category_tool'] == 'True' %}
|
||||
{{ macros.m_hr() }}
|
||||
{{ macros.setting_button_with_info([['menu_toggle_btn', 'Toggle', [{'key':'category', 'value':'tool'}]]], left='툴', desc=None) }}
|
||||
<div id="menu_tool_div" class="collapse">
|
||||
{{ macros.setting_checkbox('use_plugin_rclone', 'RClone', value=arg['use_plugin_rclone']) }}
|
||||
{{ macros.setting_checkbox('use_plugin_daum_tv', 'Daum TV', value=arg['use_plugin_daum_tv']) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ macros.setting_button([['setting_save3', '저장']]) }}
|
||||
</form>
|
||||
{{ macros.m_tab_content_end() }}
|
||||
|
||||
|
||||
{{ macros.m_tab_content_start('link', false) }}
|
||||
{{ macros.m_button_group([['link_add_btn', '추가'], ['link_add_divider_btn', 'Divider Line 추가'], ['link_save_btn', '저장'], ['link_reset_btn', '초기화']])}}
|
||||
{{ macros.m_row_start('0') }}
|
||||
{{ macros.m_row_end() }}
|
||||
|
||||
{{ macros.m_hr_head_top() }}
|
||||
{{ macros.m_row_start('0') }}
|
||||
{{ macros.m_col(1, macros.m_strong('Idx')) }}
|
||||
{{ macros.m_col(4, macros.m_strong('Title')) }}
|
||||
{{ macros.m_col(4, macros.m_strong('URL')) }}
|
||||
{{ macros.m_col(3, macros.m_strong('Action')) }}
|
||||
{{ macros.m_row_end() }}
|
||||
{{ macros.m_hr_head_bottom() }}
|
||||
<form id="link_form" name="link_form">
|
||||
<div id="link_list_div"></div>
|
||||
</form>
|
||||
{{ macros.m_tab_content_end() }}
|
||||
|
||||
{{ macros.m_tab_content_start('download', false) }}
|
||||
{{ macros.setting_button_with_info([['global_link_btn', '다운로드', [{'key':'url', 'value':'https://github.com/soju6jan/soju6jan.github.io/blob/master/etc/hdhomerun_scan_191214.zip'}]], ['global_link_btn', '매뉴얼', [{'key':'url', 'value':'.'}]]], left='HDHomerun Scan Tool', desc=['HDHomerun 스캔하여 TVH용 프리셋 파일을 만들어주는 Windows용 프로그램', '8VSB 지원 케이블용']) }}
|
||||
<!--
|
||||
{{ macros.setting_button_with_info([['global_link_btn', '다운로드', [{'key':'url', 'value':'https://github.com/soju6jan/soju6jan.github.io/raw/master/etc/sjva_lc_0.1.1.apk'}]], ['global_link_btn', '매뉴얼', [{'key':'url', 'value':'.'}]]], left='SJVA for Live Channels', desc=['Android TV Live Channels 앱에 채널 소스를 제공하는 앱.', 'Klive, Plex 지원']) }}
|
||||
{{ macros.setting_button_with_info([['global_link_btn', '티빙 애드온', [{'key':'url', 'value':'https://github.com/soju6jan/soju6jan.github.io/blob/master/kodi_plugin/plugin.video.tving.zip'}]]], left='KODI', desc=None) }}
|
||||
-->
|
||||
{{ macros.m_tab_content_end() }}
|
||||
|
||||
</div><!--tab-content-->
|
||||
</div> <!--전체-->
|
||||
|
||||
<!-- 링크 모달 -->
|
||||
{{ macros.m_modal_start('link_edit_modal', '링크', 'modal-lg') }}
|
||||
<form id="link_form">
|
||||
<input type="hidden" id="link_edit_index" name="link_edit_index"/>
|
||||
{{ macros.setting_input_text('link_edit_title', '제목') }}
|
||||
{{ macros.setting_input_text('link_edit_url', 'URL') }}
|
||||
{{ macros.setting_button([['link_edit_confirm_btn', '확인'], ['link_edit_cancel_btn', '취소']]) }}
|
||||
</form>
|
||||
{{ macros.m_modal_end() }}
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var package_name = 'system';
|
||||
var current_data;
|
||||
var link_data;
|
||||
|
||||
$(document).ready(function(){
|
||||
$(function() {
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/get_link_list',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
link_data = data
|
||||
make_link_data();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function setting_save_func(formData, noti) {
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/setting_save_system',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: formData,
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret) {
|
||||
if (noti) {
|
||||
$.notify('<strong>설정을 저장하였습니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
window.location.href = "/"
|
||||
}
|
||||
} else {
|
||||
$.notify('<strong>설정 저장에 실패하였습니다.</strong>', {
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//설정 저장
|
||||
$("#setting_save").click(function(e) {
|
||||
e.preventDefault();
|
||||
var formData = get_formdata('#setting');
|
||||
setting_save_func(formData, true)
|
||||
});
|
||||
|
||||
//설정 저장
|
||||
$("#setting_save2").click(function(e) {
|
||||
e.preventDefault();
|
||||
var formData = get_formdata('#setting2');
|
||||
setting_save_func(formData, false)
|
||||
});
|
||||
|
||||
$("#setting_save4").click(function(e) {
|
||||
e.preventDefault();
|
||||
var formData = get_formdata('#setting4');
|
||||
setting_save_func(formData, true)
|
||||
});
|
||||
|
||||
$("#setting_save3").click(function(e) {
|
||||
e.preventDefault();
|
||||
var formData = get_formdata('#setting3');
|
||||
setting_save_func(formData, true)
|
||||
$.notify('<strong>재시작해야 적용됩니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#ddns_test_btn', function(e){
|
||||
e.preventDefault();
|
||||
ddns = document.getElementById('ddns').value;
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/ddns_test',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data:{ddns:ddns},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
console.log(data)
|
||||
if (data == 'fail') {
|
||||
$.notify('<strong>접속에 실패하였습니다.</strong>', {
|
||||
type: 'warning'
|
||||
});
|
||||
} else {
|
||||
$.notify('<strong>Version:'+ data+'</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$("body").on('click', '#menu_toggle_btn', function(e){
|
||||
e.preventDefault();
|
||||
category = $(this).data('category')
|
||||
var div_name = '#menu_'+category+'_div'
|
||||
$(div_name).collapse('toggle')
|
||||
});
|
||||
|
||||
$("body").on('click', '#command_run_btn', function(e){
|
||||
e.preventDefault();
|
||||
command_text = document.getElementById('command_text').value;
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/command_run',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data:{command_text:command_text},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.ret == 'success') {
|
||||
$.notify('<strong>성공 : '+ data.log +'</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
$.notify('<strong>실패 : ' + data.log+'</strong>', {
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// 링크
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// 화면 상단 버튼 START
|
||||
$("body").on('click', '#link_add_btn', function(e){
|
||||
e.preventDefault();
|
||||
document.getElementById("link_edit_index").value = -1;
|
||||
document.getElementById('link_edit_title').value = '';
|
||||
document.getElementById('link_edit_url').value = '';
|
||||
$('#link_edit_modal').modal();
|
||||
});
|
||||
|
||||
$("body").on('click', '#link_add_divider_btn', function(e){
|
||||
e.preventDefault();
|
||||
tmp = {}
|
||||
tmp['type'] = 'divider'
|
||||
link_data.splice(link_data.length, 0, tmp);
|
||||
make_link_data()
|
||||
});
|
||||
|
||||
$("body").on('click', '#link_save_btn', function(e){
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/link_save',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data:{link_data:JSON.stringify(link_data)},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
$.notify('<strong>저장 후 적용하였습니다.</strong>', {
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
$.notify('<strong>실패하였습니다.</strong>', {
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '#link_reset_btn', function(e){
|
||||
e.preventDefault();
|
||||
link_data = []
|
||||
make_link_data()
|
||||
});
|
||||
// 화면 상단 버튼 END
|
||||
|
||||
// 리스트 각 항목 별 버튼 START
|
||||
$("body").on('click', '#link_item_up_btn', function(e){
|
||||
e.preventDefault();
|
||||
target_id = $(this).data('index')
|
||||
target = link_data[target_id]
|
||||
if (target_id != 0) {
|
||||
link_data.splice(target_id, 1);
|
||||
link_data.splice(target_id-1, 0, target);
|
||||
}
|
||||
make_link_data()
|
||||
});
|
||||
|
||||
$("body").on('click', '#link_item_down_btn', function(e){
|
||||
e.preventDefault();
|
||||
target_id = $(this).data('index')
|
||||
target = link_data[target_id]
|
||||
if (link_data.length -1 != target_id) {
|
||||
link_data.splice(target_id, 1);
|
||||
link_data.splice(target_id+1, 0, target);
|
||||
}
|
||||
make_link_data()
|
||||
});
|
||||
|
||||
$("body").on('click', '#link_item_delete_btn', function(e){
|
||||
e.preventDefault();
|
||||
target_id = $(this).data('index')
|
||||
target = link_data[target_id]
|
||||
link_data.splice(target_id, 1);
|
||||
make_link_data()
|
||||
});
|
||||
|
||||
$("body").on('click', '#link_item_edit_btn', function(e){
|
||||
e.preventDefault();
|
||||
target_id = $(this).data('index')
|
||||
target = link_data[target_id]
|
||||
document.getElementById('link_edit_index').value = target_id
|
||||
document.getElementById('link_edit_title').value = target.title
|
||||
document.getElementById('link_edit_url').value = target.url
|
||||
$('#link_edit_modal').modal();
|
||||
});
|
||||
// 리스트 각 항목 별 버튼 END
|
||||
|
||||
// START 모달 버튼
|
||||
$("body").on('click', '#link_edit_confirm_btn', function(e){
|
||||
e.preventDefault();
|
||||
edit_index = parseInt(document.getElementById('link_edit_index').value)
|
||||
tmp = {}
|
||||
tmp['type'] = 'link'
|
||||
tmp['title'] = document.getElementById('link_edit_title').value
|
||||
tmp['url'] = document.getElementById('link_edit_url').value
|
||||
if (edit_index == -1) {
|
||||
link_data.splice(link_data.length, 0, tmp);
|
||||
} else {
|
||||
link_data.splice(target_id, 1);
|
||||
link_data.splice(target_id, 0, tmp);
|
||||
}
|
||||
make_link_data()
|
||||
$('#link_edit_modal').modal('hide');
|
||||
});
|
||||
|
||||
$("body").on('click', '#link_edit_cancel_btn', function(e){
|
||||
e.preventDefault();
|
||||
$('#link_edit_modal').modal('hide');
|
||||
});
|
||||
// END 모달 버튼
|
||||
|
||||
|
||||
|
||||
function make_link_data() {
|
||||
str = ''
|
||||
for (i in link_data) {
|
||||
//console.log(link_data[i])
|
||||
str += m_row_start_hover();
|
||||
str += m_col(1, parseInt(i)+1);
|
||||
|
||||
if (link_data[i].type == 'link') {
|
||||
str += m_col(4, link_data[i].title)
|
||||
str += m_col(4, link_data[i].url)
|
||||
} else {
|
||||
str += m_col(8, '---Divider Line---')
|
||||
}
|
||||
tmp = ''
|
||||
tmp += m_button('link_item_up_btn', 'UP', [{'key':'index', 'value':i}]);
|
||||
tmp += m_button('link_item_down_btn', 'DOWN', [{'key':'index', 'value':i}]);
|
||||
tmp += m_button('link_item_delete_btn', '삭제', [{'key':'index', 'value':i}]);
|
||||
if (link_data[i].type == 'link') {
|
||||
tmp += m_button('link_item_edit_btn', '편집', [{'key':'index', 'value':i}]);
|
||||
tmp += m_button('global_link_btn', 'Go', [{'key':'url', 'value':link_data[i].url}]);
|
||||
}
|
||||
tmp = m_button_group(tmp)
|
||||
str += m_col(3, tmp)
|
||||
str += m_row_end();
|
||||
if (i != link_data.length -1) str += m_hr(0);
|
||||
}
|
||||
document.getElementById("link_list_div").innerHTML = str;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$("body").on('click', '#go_filebrowser_btn', function(e){
|
||||
e.preventDefault();
|
||||
url = document.getElementById('url_filebrowser').value
|
||||
window.open(url, "_blank");
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user