Skip to content

Commit

Permalink
同步代码
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaobangyu committed Oct 7, 2023
1 parent f6b830e commit 6d34e40
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 198 deletions.
5 changes: 0 additions & 5 deletions server/robot/accord/accord_conf.lua

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- luacheck: ignore
return [[
<html>
Expand Down Expand Up @@ -530,6 +531,7 @@ var DataUtils = {
});
}
}
var scope = null
var http = null
var app = angular.module('robot', [])
Expand Down Expand Up @@ -1667,7 +1669,7 @@ var DataUtils = {
</html>
<style>
pre {
pre {
outline: 1px solid #ccc;
}
Expand Down Expand Up @@ -2678,4 +2680,5 @@ body {
.pre-text {
white-space: pre-wrap;
}
</style>]]
</style>
]]
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- luacheck: ignore
return [[
<html>

<head>
Expand Down Expand Up @@ -364,9 +366,10 @@ <h3 class="container-title first-ctitle">
</div>
</body>
<script>
/* codeBlock=data_utils.js */
/* codeBlock=format_utils.js */
/* codeBlock=net_utils.js */
{{%= DATA_UTILS_JS %}}
{{%= FORMAT_UTILS_JS %}}
{{%= NET_UTILS_JS %}}

var scope = null
var http = null
var app = angular.module('robot', [])
Expand Down Expand Up @@ -1504,5 +1507,6 @@ <h3 class="container-title first-ctitle">
</html>

<style>
/* codeBlock=style.css */
</style>
{{%= STYLE_CSS %}}
</style>
]]
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions server/robot/accord/src_conf.lua

This file was deleted.

41 changes: 4 additions & 37 deletions server/robot/accord_mgr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local json_pretty = json.pretty
local tinsert = table.insert

local HttpServer = import("network/http_server.lua")
local src_conf = import("robot/accord/src_conf.lua")

local robot_mgr = quanta.get("robot_mgr")
local update_mgr = quanta.get("update_mgr")
Expand All @@ -21,13 +20,10 @@ local AccordMgr = singleton()
local prop = property(AccordMgr)
prop:reader("http_server", nil)
prop:reader("accord_html", "") -- html
prop:reader("accord_css", "") -- css
prop:reader("accord_js", {}) -- js
prop:reader("server_list", {}) -- 服务列表
prop:reader("accord_list", {}) -- 协议列表(添加的数据)
prop:reader("case_group", {}) -- 用例分组
prop:reader("load_db_status", false)
prop:reader("src_map", {}) -- 资源映射

function AccordMgr:__init()
-- 创建HTTP服务器
Expand All @@ -38,9 +34,6 @@ function AccordMgr:__init()
server:register_post("/destory", "on_destory", self)
server:register_post("/run", "on_run", self)

server:register_get("/src_list", "on_src_list", self)
server:register_get("/load_src", "on_load_src", self)

-- 服务器操作
server:register_post("/server_list", "on_server_list", self)
server:register_post("/server_edit", "on_server_edit", self)
Expand Down Expand Up @@ -123,25 +116,21 @@ function AccordMgr:load_db_data()
end

-- 加载资源
function AccordMgr:load_src()
for _,name in pairs(src_conf.src_list) do
local file_path = name
local file = import(file_path)
self.src_map[self:get_src_name(file_path)] = file
end
function AccordMgr:load_html()
self.accord_html = import("../server/robot/accord/index.lua")
end

-- 定时更新
function AccordMgr:on_second5()
self:load_src()
self:load_html()
end

-- http 回调
----------------------------------------------------------------------
-- accord_html
function AccordMgr:on_accord_page(url, body)
if self.load_db_status then
return self.src_map["bundle"], {
return self.accord_html, {
["Access-Control-Allow-Origin"] = "*"
}
end
Expand All @@ -165,28 +154,6 @@ function AccordMgr:get_src_name(src_path)
return src_name
end

-- 资源列表
function AccordMgr:on_src_list(url, params)
local src_list = {}
for _,name in pairs(src_conf.src_list) do
local src_name = self:get_src_name(name)
if src_name then
tinsert(src_list, src_name)
end
end
return src_list, {
["Access-Control-Allow-Origin"] = "*"
}
end

-- 加载资源
function AccordMgr:on_load_src(url, params)
local name = params.name
return self.src_map[name], {
["Access-Control-Allow-Origin"] = "*"
}
end

-- 拉取日志
function AccordMgr:on_message(url, params)
-- log_debug("[AccordMgr][on_message] open_id: %s", params.open_id)
Expand Down
136 changes: 0 additions & 136 deletions tools/accord/src_pack.lua

This file was deleted.

8 changes: 0 additions & 8 deletions tools/accord_pack.bat

This file was deleted.

13 changes: 13 additions & 0 deletions tools/accordbuild.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off
set DATA_UTILS_JS=../server/robot/accord/page/data_utils.js
set FORMAT_UTILS_JS=../server/robot/accord/page/format_utils.js
set NET_UTILS_JS=../server/robot/accord/page/net_utils.js
set STYLE_CSS=../server/robot/accord/page/style.css
set TPL=../server/robot/accord/page/index.html
set OUT=../server/robot/accord/index.lua
set SCRIPT=../extend/lmake/ltemplate.lua

..\bin\lua.exe %SCRIPT% %TPL% %OUT% DATA_UTILS_JS %DATA_UTILS_JS% FORMAT_UTILS_JS %FORMAT_UTILS_JS% NET_UTILS_JS %NET_UTILS_JS% STYLE_CSS %STYLE_CSS%

pause

0 comments on commit 6d34e40

Please sign in to comment.