From 650b9f6b91a8d8d6b72a5887045be14245e726bd Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 5 Sep 2021 11:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=9F=BA=E6=9C=AC=E7=9A=84?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E7=9B=91=E6=8E=A7=E7=BB=88=E7=AB=AF=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/rpc/rpc_client.go | 4 +- .../js/components/common/source-code-box.js | 1 - web/views/@default/@layout.html | 3 + .../monitors/reporters/createPopup.html | 2 +- .../clusters/monitors/reporters/index.html | 59 ++++++++++++++- .../clusters/monitors/reporters/index.js | 24 +++++- .../reporters/reporter/@reporter_menu.html | 7 ++ .../monitors/reporters/reporter/index.html | 73 +++++++++++++++++++ .../index.js} | 0 .../monitors/reporters/reporter/logs.html | 3 + .../monitors/reporters/reporter/update.html | 48 ++++++++++++ .../monitors/reporters/reporter/update.js | 3 + .../@default/settings/authority/index.css | 4 + .../@default/settings/authority/index.css.map | 1 + .../@default/settings/authority/index.html | 9 +++ .../@default/settings/authority/index.less | 3 + 16 files changed, 235 insertions(+), 9 deletions(-) create mode 100644 web/views/@default/clusters/monitors/reporters/reporter/@reporter_menu.html create mode 100644 web/views/@default/clusters/monitors/reporters/reporter/index.html rename web/views/@default/clusters/monitors/reporters/{@reporter_menu.html => reporter/index.js} (100%) create mode 100644 web/views/@default/clusters/monitors/reporters/reporter/logs.html create mode 100644 web/views/@default/clusters/monitors/reporters/reporter/update.html create mode 100644 web/views/@default/clusters/monitors/reporters/reporter/update.js create mode 100644 web/views/@default/settings/authority/index.css create mode 100644 web/views/@default/settings/authority/index.css.map create mode 100644 web/views/@default/settings/authority/index.less diff --git a/internal/rpc/rpc_client.go b/internal/rpc/rpc_client.go index 1f5cf002..e13bf97e 100644 --- a/internal/rpc/rpc_client.go +++ b/internal/rpc/rpc_client.go @@ -300,8 +300,8 @@ func (this *RPCClient) IPListRPC() pb.IPListServiceClient { return pb.NewIPListServiceClient(this.pickConn()) } -func (this *RPCClient) ReporterRPC() pb.ReporterServiceClient { - return pb.NewReporterServiceClient(this.pickConn()) +func (this *RPCClient) ReportNodeRPC() pb.ReportNodeServiceClient { + return pb.NewReportNodeServiceClient(this.pickConn()) } func (this *RPCClient) IPItemRPC() pb.IPItemServiceClient { diff --git a/web/public/js/components/common/source-code-box.js b/web/public/js/components/common/source-code-box.js index a007a4f3..6ffc1e01 100644 --- a/web/public/js/components/common/source-code-box.js +++ b/web/public/js/components/common/source-code-box.js @@ -7,7 +7,6 @@ Vue.component("source-code-box", { if (typeof readOnly != "boolean") { readOnly = true } - console.log("readonly:", readOnly) // TODO let box = document.getElementById("source-code-box-" + this.index) let valueBox = document.getElementById(this.valueBoxId) let value = "" diff --git a/web/views/@default/@layout.html b/web/views/@default/@layout.html index 1c5c8981..3d6a5ecf 100644 --- a/web/views/@default/@layout.html +++ b/web/views/@default/@layout.html @@ -62,6 +62,9 @@ + + + 退出登录 diff --git a/web/views/@default/clusters/monitors/reporters/createPopup.html b/web/views/@default/clusters/monitors/reporters/createPopup.html index d431b467..20ecb7e1 100644 --- a/web/views/@default/clusters/monitors/reporters/createPopup.html +++ b/web/views/@default/clusters/monitors/reporters/createPopup.html @@ -15,7 +15,7 @@ - 地域 + 区域

终端所在地域。

diff --git a/web/views/@default/clusters/monitors/reporters/index.html b/web/views/@default/clusters/monitors/reporters/index.html index bfcb4c8b..00eb2e3a 100644 --- a/web/views/@default/clusters/monitors/reporters/index.html +++ b/web/views/@default/clusters/monitors/reporters/index.html @@ -3,4 +3,61 @@ [添加终端] - \ No newline at end of file + + +
+
+
+ +
+
+ +
+
+
+ + +

暂时还没有终端。

+ + + + + + + + + + + + + + + + + + + + +
终端名称区域网络提供商当前IP状态操作
+ {{reporter.name}} + + {{reporter.location}} + {{reporter.status.location}} + - + + {{reporter.isp}} + {{reporter.status.isp}} + - + + {{reporter.status.ip}} + - + + 禁用 + 离线 + 在线 + + 详情   + 删除 +
+ +
\ No newline at end of file diff --git a/web/views/@default/clusters/monitors/reporters/index.js b/web/views/@default/clusters/monitors/reporters/index.js index db2bab3e..eecdfe4b 100644 --- a/web/views/@default/clusters/monitors/reporters/index.js +++ b/web/views/@default/clusters/monitors/reporters/index.js @@ -1,9 +1,25 @@ Tea.context(function () { this.createReporter = function () { - teaweb.popup(".createPopup", function () { - teaweb.success("保存成功", function () { - teaweb.reload() - }) + teaweb.popup(".createPopup", { + callback: function () { + teaweb.success("保存成功", function () { + teaweb.reload() + }) + } + }) + } + + this.deleteReporter = function (reporterId) { + teaweb.confirm("确定要删除此终端吗?", function () { + this.$post(".reporter.delete") + .params({ + reporterId: reporterId + }) + .success(function () { + teaweb.success("删除成功", function () { + teaweb.reload() + }) + }) }) } }) \ No newline at end of file diff --git a/web/views/@default/clusters/monitors/reporters/reporter/@reporter_menu.html b/web/views/@default/clusters/monitors/reporters/reporter/@reporter_menu.html new file mode 100644 index 00000000..9b28f2c2 --- /dev/null +++ b/web/views/@default/clusters/monitors/reporters/reporter/@reporter_menu.html @@ -0,0 +1,7 @@ + + 所有终端 + | + "{{reporter.name}}"详情 + 运行日志 + 修改 + \ No newline at end of file diff --git a/web/views/@default/clusters/monitors/reporters/reporter/index.html b/web/views/@default/clusters/monitors/reporters/reporter/index.html new file mode 100644 index 00000000..3c414840 --- /dev/null +++ b/web/views/@default/clusters/monitors/reporters/reporter/index.html @@ -0,0 +1,73 @@ +{$layout} +{$template "/code_editor"} +{$template "reporter_menu"} + + + + + + + + + + + + + + + + + + + + + + +
名称 + {{reporter.name}} +
状态 + 禁用 + 离线 + 在线 +
区域 + {{reporter.location}} + {{reporter.status.location}} + 没有设置 +
网络提供商 + {{reporter.isp}} + {{reporter.status.isp}} + 没有设置 +
允许的终端IP +
+ {{ip}} +
+ 没有设置 +
+ +

安装信息

+ + + + + + + + + + + + + +
节点ID{{reporter.uniqueId}}
节点Secret{{reporter.secret}}
命令行 + 查看命令行 +
+
+

Linux、Mac OS X:

+ edge-reporter run -api=[API HOST] -node-id={{reporter.uniqueId}} -secret={{reporter.secret}} + +

Windows:

+ edge-reporter.exe run -api=[API HOST] -node-id={{reporter.uniqueId}} -secret={{reporter.secret}} + +

把上面命令行中的[API_HOST]换成你的API节点地址,包括协议、主机名端口。

+
+
\ No newline at end of file diff --git a/web/views/@default/clusters/monitors/reporters/@reporter_menu.html b/web/views/@default/clusters/monitors/reporters/reporter/index.js similarity index 100% rename from web/views/@default/clusters/monitors/reporters/@reporter_menu.html rename to web/views/@default/clusters/monitors/reporters/reporter/index.js diff --git a/web/views/@default/clusters/monitors/reporters/reporter/logs.html b/web/views/@default/clusters/monitors/reporters/reporter/logs.html new file mode 100644 index 00000000..6af3bd91 --- /dev/null +++ b/web/views/@default/clusters/monitors/reporters/reporter/logs.html @@ -0,0 +1,3 @@ +{$layout} +{$template "reporter_menu"} + diff --git a/web/views/@default/clusters/monitors/reporters/reporter/update.html b/web/views/@default/clusters/monitors/reporters/reporter/update.html new file mode 100644 index 00000000..e7bc01a3 --- /dev/null +++ b/web/views/@default/clusters/monitors/reporters/reporter/update.html @@ -0,0 +1,48 @@ +{$layout} +{$template "reporter_menu"} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
名称 * + +
区域 + +

终端所在地域。

+
网络提供商 + +

终端所属网络供应商。

+
允许的终端IP + +

如果不为空,则只有这些IP才能连接API。支持单个IP、CIDR格式的IP段和IP1-IP2这样的IP段。

+
是否启用 + +
+ +
\ No newline at end of file diff --git a/web/views/@default/clusters/monitors/reporters/reporter/update.js b/web/views/@default/clusters/monitors/reporters/reporter/update.js new file mode 100644 index 00000000..c96c613a --- /dev/null +++ b/web/views/@default/clusters/monitors/reporters/reporter/update.js @@ -0,0 +1,3 @@ +Tea.context(function () { + this.success = NotifySuccess("保存成功", Tea.url(".", {reporterId: this.reporter.id})) +}) \ No newline at end of file diff --git a/web/views/@default/settings/authority/index.css b/web/views/@default/settings/authority/index.css new file mode 100644 index 00000000..f0eefcb4 --- /dev/null +++ b/web/views/@default/settings/authority/index.css @@ -0,0 +1,4 @@ +.message .icon.gem { + font-size: 1.2em!important; +} +/*# sourceMappingURL=index.css.map */ \ No newline at end of file diff --git a/web/views/@default/settings/authority/index.css.map b/web/views/@default/settings/authority/index.css.map new file mode 100644 index 00000000..a55abce3 --- /dev/null +++ b/web/views/@default/settings/authority/index.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,QAAS,MAAK;EACb,0BAAA","file":"index.css"} \ No newline at end of file diff --git a/web/views/@default/settings/authority/index.html b/web/views/@default/settings/authority/index.html index 2b4b2344..34fa25fe 100644 --- a/web/views/@default/settings/authority/index.html +++ b/web/views/@default/settings/authority/index.html @@ -4,6 +4,15 @@ 认证之后,可以使用企业版功能,当前你还没有认证,
[在这里看认证方法]
+
+ +
+ +
+ 恭喜您已经成为尊贵的企业版用户。 +
+
+
diff --git a/web/views/@default/settings/authority/index.less b/web/views/@default/settings/authority/index.less new file mode 100644 index 00000000..2633a3b8 --- /dev/null +++ b/web/views/@default/settings/authority/index.less @@ -0,0 +1,3 @@ +.message .icon.gem { + font-size: 1.2em!important; +} \ No newline at end of file