From 3979820eaef9c9780ba6f126ecfa179dee726962 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 10 Jan 2024 00:19:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/config_api.py | 9 +------- route/static/app/config.js | 34 +++++++++-------------------- route/templates/default/config.html | 9 +------- 3 files changed, 12 insertions(+), 40 deletions(-) diff --git a/class/core/config_api.py b/class/core/config_api.py index 6ee222574..aa8835876 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -28,7 +28,7 @@ from flask import request class config_api: - __version = '0.16.2.3' + __version = '0.16.2.4' __api_addr = 'data/api.json' def __init__(self): @@ -936,13 +936,6 @@ class config_api: sformat = 'date +"%Y-%m-%d %H:%M:%S %Z %z"' data['systemdate'] = mw.execShell(sformat)[0].strip() - # 获取时区 - import datetime - import pytz - now = datetime.datetime.now() - tz_name = now.astimezone().tzinfo - data['systemdatezone'] = tz_name - data['port'] = mw.getHostPort() data['ip'] = mw.getHostAddr() diff --git a/route/static/app/config.js b/route/static/app/config.js index 521ab65d8..fa389c7fd 100755 --- a/route/static/app/config.js +++ b/route/static/app/config.js @@ -338,16 +338,6 @@ function setUserName(a) { }) } - -function syncDate(){ - var loadT = layer.msg('正在同步时间...',{icon:16,time:0,shade: [0.3, '#000']}); - $.post('/config/sync_date','',function(rdata){ - layer.close(loadT); - layer.msg(rdata.msg,{icon:rdata.status?1:2}); - setTimeout(function(){window.location.reload();},1500); - },'json'); -} - function setTimezone(){ layer.open({ type: 1, @@ -356,7 +346,7 @@ function setTimezone(){ closeBtn: 1, shift: 5, shadeClose: false, - btn:["确定","取消"], + btn:["确定","取消","同步"], content: "
\
\ 时区\ @@ -366,26 +356,14 @@ function setTimezone(){
\
", success:function(){ - var tbody = ''; $.post('/config/get_timezone_list', {}, function (rdata) { - for (var i = 0; i < rdata.length; i++) { tbody += ''; } $('select[name="timezone"]').append(tbody); - },'json'); - - // for(i in msg_list){ - // if (msg_list[i]['code'] == ''){ - // tbody += ''; - // } else{ - // tbody += ''; - // } - // } - - }, + }, yes:function(index){ var loadT = layer.msg("正在设置时区...", { icon: 16, time: 0, shade: [0.3, '#000'] }); var timezone = $('select[name="timezone"]').val(); @@ -396,6 +374,14 @@ function setTimezone(){ location.reload(); },{ icon: rdata.status ? 1 : 2 }, 2000); },'json'); + }, + btn3:function(){ + var loadT = layer.msg('正在同步时间...',{icon:16,time:0,shade: [0.3, '#000']}); + $.post('/config/sync_date','',function(rdata){ + layer.close(loadT); + layer.msg(rdata.msg,{icon:rdata.status?1:2}); + setTimeout(function(){window.location.reload();},1500); + },'json'); } }) } diff --git a/route/templates/default/config.html b/route/templates/default/config.html index aa24edf59..6a3793ac0 100755 --- a/route/templates/default/config.html +++ b/route/templates/default/config.html @@ -83,15 +83,8 @@

服务器时间 - - 同步当前服务器时间 -

- -

- 服务器时区 - - 设置当前服务器时区 + 同步当前服务器时间

面板用户