update
This commit is contained in:
@@ -14,7 +14,8 @@ class ModuleHome(PluginModuleBase):
|
||||
default_route_socketio_module(self)
|
||||
|
||||
def process_menu(self, page, req):
|
||||
return render_template(f'{__package__}_{name}.html', info=self.get_info('static'))
|
||||
arg = {'changelog':F.config['DEFINE']['CHANGELOG']}
|
||||
return render_template(f'{__package__}_{name}.html', info=self.get_info('static'), arg=arg)
|
||||
|
||||
def process_command(self, command, arg1, arg2, arg3, req):
|
||||
if command == 'recent_version':
|
||||
|
||||
@@ -17,7 +17,7 @@ class ModuleSetting(PluginModuleBase):
|
||||
'ddns' : 'http://localhost:9999',
|
||||
'use_login' : 'False',
|
||||
'web_id': 'admin',
|
||||
'web_pw': 'Vm51JgZqhpwXc/UPc9CAN1lhj4s65+4ikv7GzNmvN6c=',
|
||||
'web_pw': '21232f297a57a5a743894a0e4a801fc3',
|
||||
'web_title': 'Home',
|
||||
'use_apikey': 'False',
|
||||
'apikey': ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10)),
|
||||
@@ -175,6 +175,11 @@ class ModuleSetting(PluginModuleBase):
|
||||
F.socketio.emit("refresh", {}, namespace='/framework', broadcast=True)
|
||||
elif 'notify.yaml' in change_list:
|
||||
SupportFile.write_file(F.config['notify_yaml_filepath'], SystemModelSetting.get('notify.yaml'))
|
||||
elif 'web_pw' in change_list:
|
||||
import hashlib
|
||||
enc = hashlib.md5()
|
||||
enc.update(SystemModelSetting.get('web_pw').encode())
|
||||
SystemModelSetting.set('web_pw', enc.hexdigest())
|
||||
|
||||
|
||||
def __set_restart_scheduler(self):
|
||||
|
||||
@@ -5,39 +5,21 @@ from .setup import *
|
||||
name = 'tool'
|
||||
|
||||
class ModuleTool(PluginModuleBase):
|
||||
def __init__(self, P):
|
||||
super(ModuleTool, self).__init__(P, name=name, first_menu='upload')
|
||||
self.set_page_list([PageUpload])
|
||||
|
||||
|
||||
class PageUpload(PluginPageBase):
|
||||
db_default = {
|
||||
'path_upload': os.path.join(F.config['path_data'], 'upload'),
|
||||
}
|
||||
|
||||
|
||||
def __init__(self, P):
|
||||
super(ModuleTool, self).__init__(P, name=name, first_menu='upload')
|
||||
|
||||
|
||||
def process_menu(self, page, req):
|
||||
arg = P.ModelSetting.to_dict()
|
||||
try:
|
||||
return render_template(f'{__package__}_{name}_{page}.html', arg=arg)
|
||||
except Exception as e:
|
||||
P.logger.error(f'Exception:{str(e)}')
|
||||
P.logger.error(traceback.format_exc())
|
||||
return render_template('sample.html', title=f"{__package__}/{name}/{page}")
|
||||
def __init__(self, P, parent):
|
||||
super(PageUpload, self).__init__(P, parent, name='upload')
|
||||
|
||||
|
||||
def process_command(self, command, arg1, arg2, arg3, req):
|
||||
ret = {'ret':'success'}
|
||||
if command == 'plugin_install':
|
||||
ret = F.PluginManager.plugin_install(arg1)
|
||||
|
||||
return jsonify(ret)
|
||||
|
||||
|
||||
def plugin_load(self):
|
||||
try:
|
||||
pass
|
||||
except Exception as e:
|
||||
P.logger.error(f'Exception:{str(e)}')
|
||||
P.logger.error(traceback.format_exc())
|
||||
|
||||
|
||||
|
||||
class PageCrypt(PluginPageBase):
|
||||
def __init__(self, P, parent):
|
||||
super(PageCrypt, self).__init__(P, parent, name='crypt')
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{{ macros.info_text_and_buttons('python_version', 'Python', [['globalLinkBtn', '패키지 관리', [('url','/system/python')]]], info['python_version']) }}
|
||||
{{ macros.info_text('platform', 'Platform', info['platform']) }}
|
||||
{{ macros.info_text('processor', 'Processor', info['processor']) }}
|
||||
{{ macros.info_text_and_buttons('version_str', '버전', [['globalOpenBtn', '업데이트 내역', [('url','https://sjva.me/wiki/public/changelog')]], ['recent_version_btn', '최신버전 확인']], info['version']) }}
|
||||
{{ macros.info_text_and_buttons('version_str', '버전', [['globalOpenBtn', '업데이트 내역', [('url',arg['changelog'])]], ['recent_version_btn', '최신버전 확인']], info['version']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ function make_plugin_list(data) {
|
||||
str += m_col_wide(2, '');
|
||||
str += m_col_wide(2, data[i].package_name);
|
||||
str += m_col_wide(5, '');
|
||||
tmp = m_button_small('uninstall_btn', '삭제', [{'key':'package_name', 'value':data[i].package_name}]);
|
||||
tmp = m_button('uninstall_btn', '삭제', {'package_name':data[i].package_name}, 'danger', false, true);
|
||||
} else {
|
||||
str += m_col_wide(2, data[i].title);
|
||||
|
||||
@@ -59,9 +59,9 @@ function make_plugin_list(data) {
|
||||
|
||||
tmp = ''
|
||||
|
||||
tmp += m_button_small('globalOpenBtn', '홈페이지', [{'key':'url', 'value':data[i].home}], 'primary');
|
||||
tmp += m_button_small('uninstall_btn', '삭제', [{'key':'package_name', 'value':data[i].package_name}, {'key':'title', 'value':data[i].title}]);
|
||||
tmp += m_button_small('json_btn', 'JSON', [{'key':'idx', 'value':i}], 'info');
|
||||
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 = m_button_group(tmp)
|
||||
str += m_col_wide(2, tmp, 'right')
|
||||
|
||||
@@ -34,10 +34,12 @@ var running_type = "{{arg['running_type']}}";
|
||||
|
||||
$(document).ready(function(){
|
||||
console.log(running_type);
|
||||
/*
|
||||
if (running_type.startsWith('docker')) {
|
||||
$('#celery_start_by_web').bootstrapToggle('off');
|
||||
$('#celery_start_by_web').prop('disabled', true);
|
||||
}
|
||||
*/
|
||||
});
|
||||
|
||||
$("body").on('click', '#celery_excute_btn', function(e){
|
||||
|
||||
Reference in New Issue
Block a user