From d46e3c7e8bcf9d50ec58ee8cb169ffb9391323ef Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 13 Sep 2021 19:19:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9func.js=E5=8F=8A=E6=A0=87?= =?UTF-8?q?=E6=B3=A8=E7=B3=BB=E7=BB=9F=E7=9A=84=E6=B6=88=E6=81=AF=E9=98=9F?= =?UTF-8?q?=E5=88=97=E4=BD=BF=E7=94=A8=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E5=BC=8F=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- modules/labelmsg/redismsgsender.go | 12 ++++-------- modules/setting/setting.go | 10 ++++++++++ public/self/func.js | 8 ++------ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/modules/labelmsg/redismsgsender.go b/modules/labelmsg/redismsgsender.go index c9fa07271..8b2eae772 100644 --- a/modules/labelmsg/redismsgsender.go +++ b/modules/labelmsg/redismsgsender.go @@ -2,14 +2,10 @@ package labelmsg import ( "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/setting" ) // 方法名 -const ( - LabelTaskName = "LabelRedisQueue" - LabelDatasetDeleteQueue = "LabelDatasetDeleteQueue" - DecompressOBSTaskName = "LabelDecompressOBSQueue" -) func SendAddAttachToLabelSys(attach string) error { @@ -18,7 +14,7 @@ func SendAddAttachToLabelSys(attach string) error { //记得销毁本次链连接 defer redisclient.Close() - _, err := redisclient.Do("Publish", LabelTaskName, attach) + _, err := redisclient.Do("Publish", setting.LabelTaskName, attach) if err != nil { log.Critical("redis Publish failed.") } @@ -35,7 +31,7 @@ func SendDeleteAttachToLabelSys(attach string) error { //记得销毁本次链连接 defer redisclient.Close() - _, err := redisclient.Do("Publish", LabelDatasetDeleteQueue, attach) + _, err := redisclient.Do("Publish", setting.LabelDatasetDeleteQueue, attach) if err != nil { log.Critical("redis Publish failed.") } @@ -51,7 +47,7 @@ func SendDecompressAttachToLabelOBS(attach string) error { //记得销毁本次链连接 defer redisclient.Close() - _, err := redisclient.Do("Publish", DecompressOBSTaskName, attach) + _, err := redisclient.Do("Publish", setting.DecompressOBSTaskName, attach) if err != nil { log.Critical("redis Publish failed.") } diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 687f02605..0fbc9f909 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -431,6 +431,11 @@ var ( AuthUser string AuthPassword string + //labelsystem config + LabelTaskName string + LabelDatasetDeleteQueue string + DecompressOBSTaskName string + //cloudbrain config CBAuthUser string CBAuthPassword string @@ -1145,6 +1150,11 @@ func NewContext() { AuthUser = sec.Key("USER").MustString("cW4cMtH24eoWPE7X") AuthPassword = sec.Key("PASSWORD").MustString("4BPmgvK2hb2Eywwyp4YZRY4B7yQf4DAC") + sec = Cfg.Section("labelsystem") + LabelTaskName = sec.Key("LabelTaskName").MustString("LabelRedisQueue") + LabelDatasetDeleteQueue = sec.Key("LabelDatasetDeleteQueue").MustString("LabelDatasetDeleteQueue") + DecompressOBSTaskName = sec.Key("DecompressOBSTaskName").MustString("LabelDecompressOBSQueue") + sec = Cfg.Section("cloudbrain") CBAuthUser = sec.Key("USER").MustString("cW4cMtH24eoWPE7X") CBAuthPassword = sec.Key("PWD").MustString("4BPmgvK2hb2Eywwyp4YZRY4B7yQf4DAC") diff --git a/public/self/func.js b/public/self/func.js index 23dfeceb3..d16ca1b05 100644 --- a/public/self/func.js +++ b/public/self/func.js @@ -1,11 +1,7 @@ function getIp(){ - - //return "http://192.168.62.129:8000"; - - //return "http://192.168.62.129"; - return "http://192.168.62.129:8010"; - //return "http://111.231.109.64:8000"; + return "/labelsystem"; + }