This commit is contained in:
midoks
2023-02-15 21:55:21 +08:00
parent 0efb700cee
commit 376f0f0a4e
3 changed files with 13 additions and 5 deletions
+2 -2
View File
@@ -228,11 +228,11 @@ label.checkbox_label span {
</div>
<div class="mtb20">
<span class="panel_setp_span">接收数据的面板地址</span>
<input type="text" class="bt-input-text" name="psync_url" value="" placeholder="接收数据面板地址,如: http://127.0.0.1:8888">
<input type="text" class="bt-input-text" name="sync_url" value="" placeholder="接收数据面板地址,如: http://127.0.0.1:8888">
</div>
<div class="mtb20">
<span class="panel_setp_span">接收数据的面板API</span>
<input type="text" class="bt-input-text" name="psync_token" value="" placeholder="接收数据面板API密钥" />
<input type="text" class="bt-input-text" name="sync_token" value="" placeholder="接收数据面板API密钥" />
<a href="#" target="_blank" class="btlink ml5">获取API秘钥</a>
</div>
<div class="mtb20">
+8 -2
View File
@@ -5,6 +5,7 @@ import io
import os
import time
import re
import json
sys.path.append(os.getcwd() + "/class/core")
import mw
@@ -42,7 +43,7 @@ def getCfgData():
if not os.path.exists(path):
mw.writeFile(path, '{}')
t = mw.returnJson(path)
t = mw.readFile(path)
return json.loads(t)
@@ -82,6 +83,11 @@ def initDreplace():
def stepOne():
args = getArgs()
data = checkArgs(args, ['url', 'token'])
if not data[0]:
return data[1]
data = getCfgData()
print(data)
@@ -97,6 +103,6 @@ if __name__ == "__main__":
elif func == 'stop':
print(stop())
elif func == 'step_one':
print(saveConf())
print(stepOne())
else:
print('error')
+3 -1
View File
@@ -59,7 +59,9 @@ function maPostCallbak(method, args, callback){
function initStep1(){
maPost('step_one',{}, function(rdata){
var url = $('input[name="sync_url"]').val();
var token = $('input[name="sync_token"]').val();
maPost('step_one',{url:url,token:token}, function(rdata){
console.log(rdata);
});
}