diff --git a/internal/web/actions/default/dashboard/index.go b/internal/web/actions/default/dashboard/index.go
index 7ffdaf66..bcc9e744 100644
--- a/internal/web/actions/default/dashboard/index.go
+++ b/internal/web/actions/default/dashboard/index.go
@@ -92,5 +92,27 @@ func (this *IndexAction) RunGet(params struct{}) {
this.Data["dailyTrafficStats"] = statMaps
}
+ // 版本升级
+ this.Data["nodeUpgradeInfo"] = maps.Map{
+ "count": resp.NodeUpgradeInfo.CountNodes,
+ "version": resp.NodeUpgradeInfo.NewVersion,
+ }
+ this.Data["monitorNodeUpgradeInfo"] = maps.Map{
+ "count": resp.MonitorNodeUpgradeInfo.CountNodes,
+ "version": resp.MonitorNodeUpgradeInfo.NewVersion,
+ }
+ this.Data["apiNodeUpgradeInfo"] = maps.Map{
+ "count": resp.ApiNodeUpgradeInfo.CountNodes,
+ "version": resp.ApiNodeUpgradeInfo.NewVersion,
+ }
+ this.Data["userNodeUpgradeInfo"] = maps.Map{
+ "count": resp.UserNodeUpgradeInfo.CountNodes,
+ "version": resp.UserNodeUpgradeInfo.NewVersion,
+ }
+ this.Data["authorityNodeUpgradeInfo"] = maps.Map{
+ "count": resp.AuthorityNodeUpgradeInfo.CountNodes,
+ "version": resp.AuthorityNodeUpgradeInfo.NewVersion,
+ }
+
this.Show()
}
diff --git a/web/views/@default/dashboard/index.css b/web/views/@default/dashboard/index.css
index fcc61a58..6a894a18 100644
--- a/web/views/@default/dashboard/index.css
+++ b/web/views/@default/dashboard/index.css
@@ -1,3 +1,8 @@
+.ui.message .icon {
+ position: absolute;
+ right: 1em;
+ top: 1.8em;
+}
.grid {
margin-top: 2em !important;
margin-left: 2em !important;
diff --git a/web/views/@default/dashboard/index.css.map b/web/views/@default/dashboard/index.css.map
index 5a8fcaa7..4bc232da 100644
--- a/web/views/@default/dashboard/index.css.map
+++ b/web/views/@default/dashboard/index.css.map
@@ -1 +1 @@
-{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACC,0BAAA;EACA,2BAAA;;AAFD,KAIC;EACC,kBAAA;EACA,4BAAA;;AANF,KAIC,QAIC,IAAG;EACF,iBAAA;;AATH,KAIC,QAIC,IAAG,MAGF;EACC,cAAA;EACA,mBAAA;;AAbJ,KAkBC,QAAO;EACN,eAAA;;AAnBF,KAsBC,GACC;EACC,aAAA;;AAxBH,KA4BC,QAAO,MACN;EACC,eAAA;;AAMH;EACC,YAAA","file":"index.css"}
\ No newline at end of file
+{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG,QACF;EACC,kBAAA;EACA,UAAA;EACA,UAAA;;AAIF;EACC,0BAAA;EACA,2BAAA;;AAFD,KAIC;EACC,kBAAA;EACA,4BAAA;;AANF,KAIC,QAIC,IAAG;EACF,iBAAA;;AATH,KAIC,QAIC,IAAG,MAGF;EACC,cAAA;EACA,mBAAA;;AAbJ,KAkBC,QAAO;EACN,eAAA;;AAnBF,KAsBC,GACC;EACC,aAAA;;AAxBH,KA4BC,QAAO,MACN;EACC,eAAA;;AAMH;EACC,YAAA","file":"index.css"}
\ No newline at end of file
diff --git a/web/views/@default/dashboard/index.html b/web/views/@default/dashboard/index.html
index 6dd1205b..5a8a1042 100644
--- a/web/views/@default/dashboard/index.html
+++ b/web/views/@default/dashboard/index.html
@@ -5,6 +5,14 @@
{$end}
+
+
+
+
+
+
+
+
集群
diff --git a/web/views/@default/dashboard/index.js b/web/views/@default/dashboard/index.js
index c8c946e7..5746611c 100644
--- a/web/views/@default/dashboard/index.js
+++ b/web/views/@default/dashboard/index.js
@@ -1,131 +1,145 @@
Tea.context(function () {
- this.trafficTab = "hourly"
+ this.trafficTab = "hourly"
- this.$delay(function () {
- this.reloadHourlyTrafficChart()
+ this.$delay(function () {
+ this.reloadHourlyTrafficChart()
- let that = this
- window.addEventListener("resize", function () {
- if (that.trafficTab == "hourly") {
- that.resizeHourlyTrafficChart()
- }
- if (that.trafficTab == "daily") {
- that.resizeDailyTrafficChart()
- }
- })
- })
+ let that = this
+ window.addEventListener("resize", function () {
+ if (that.trafficTab == "hourly") {
+ that.resizeHourlyTrafficChart()
+ }
+ if (that.trafficTab == "daily") {
+ that.resizeDailyTrafficChart()
+ }
+ })
+ })
- this.selectTrafficTab = function (tab) {
- this.trafficTab = tab
- if (tab == "hourly") {
- this.$delay(function () {
- this.reloadHourlyTrafficChart()
- })
- } else if (tab == "daily") {
- this.$delay(function () {
- this.reloadDailyTrafficChart()
- })
- }
- }
+ this.selectTrafficTab = function (tab) {
+ this.trafficTab = tab
+ if (tab == "hourly") {
+ this.$delay(function () {
+ this.reloadHourlyTrafficChart()
+ })
+ } else if (tab == "daily") {
+ this.$delay(function () {
+ this.reloadDailyTrafficChart()
+ })
+ }
+ }
- this.resizeHourlyTrafficChart = function () {
- let chartBox = document.getElementById("hourly-traffic-chart-box")
- let chart = echarts.init(chartBox)
- chart.resize()
- }
+ this.resizeHourlyTrafficChart = function () {
+ let chartBox = document.getElementById("hourly-traffic-chart-box")
+ let chart = echarts.init(chartBox)
+ chart.resize()
+ }
- this.reloadHourlyTrafficChart = function () {
- let chartBox = document.getElementById("hourly-traffic-chart-box")
- let chart = echarts.init(chartBox)
- let option = {
- xAxis: {
- data: this.hourlyTrafficStats.map(function (v) {
- return v.hour;
- })
- },
- yAxis: {},
- tooltip: {
- show: true,
- trigger: "item",
- formatter: "{c} GB"
- },
- grid: {
- left: 40,
- top: 10,
- right: 20
- },
- series: [
- {
- name: "流量",
- type: "line",
- data: this.hourlyTrafficStats.map(function (v) {
- return v.count;
- }),
- itemStyle: {
- color: "#9DD3E8"
- },
- lineStyle: {
- color: "#9DD3E8"
- },
- areaStyle: {
- color: "#9DD3E8"
- }
- }
- ],
- animation: false
- }
- chart.setOption(option)
- chart.resize()
- }
+ this.reloadHourlyTrafficChart = function () {
+ let chartBox = document.getElementById("hourly-traffic-chart-box")
+ let chart = echarts.init(chartBox)
+ let option = {
+ xAxis: {
+ data: this.hourlyTrafficStats.map(function (v) {
+ return v.hour;
+ })
+ },
+ yAxis: {},
+ tooltip: {
+ show: true,
+ trigger: "item",
+ formatter: "{c} GB"
+ },
+ grid: {
+ left: 40,
+ top: 10,
+ right: 20
+ },
+ series: [
+ {
+ name: "流量",
+ type: "line",
+ data: this.hourlyTrafficStats.map(function (v) {
+ return v.count;
+ }),
+ itemStyle: {
+ color: "#9DD3E8"
+ },
+ lineStyle: {
+ color: "#9DD3E8"
+ },
+ areaStyle: {
+ color: "#9DD3E8"
+ }
+ }
+ ],
+ animation: false
+ }
+ chart.setOption(option)
+ chart.resize()
+ }
- this.resizeDailyTrafficChart = function () {
- let chartBox = document.getElementById("daily-traffic-chart-box")
- let chart = echarts.init(chartBox)
- chart.resize()
- }
+ this.resizeDailyTrafficChart = function () {
+ let chartBox = document.getElementById("daily-traffic-chart-box")
+ let chart = echarts.init(chartBox)
+ chart.resize()
+ }
- this.reloadDailyTrafficChart = function () {
- let chartBox = document.getElementById("daily-traffic-chart-box")
- let chart = echarts.init(chartBox)
- let option = {
- xAxis: {
- data: this.dailyTrafficStats.map(function (v) {
- return v.day;
- })
- },
- yAxis: {},
- tooltip: {
- show: true,
- trigger: "item",
- formatter: "{c} GB"
- },
- grid: {
- left: 40,
- top: 10,
- right: 20
- },
- series: [
- {
- name: "流量",
- type: "line",
- data: this.dailyTrafficStats.map(function (v) {
- return v.count;
- }),
- itemStyle: {
- color: "#9DD3E8"
- },
- lineStyle: {
- color: "#9DD3E8"
- },
- areaStyle: {
- color: "#9DD3E8"
- }
- }
- ],
- animation: false
- }
- chart.setOption(option)
- chart.resize()
- }
+ this.reloadDailyTrafficChart = function () {
+ let chartBox = document.getElementById("daily-traffic-chart-box")
+ let chart = echarts.init(chartBox)
+ let option = {
+ xAxis: {
+ data: this.dailyTrafficStats.map(function (v) {
+ return v.day;
+ })
+ },
+ yAxis: {},
+ tooltip: {
+ show: true,
+ trigger: "item",
+ formatter: "{c} GB"
+ },
+ grid: {
+ left: 40,
+ top: 10,
+ right: 20
+ },
+ series: [
+ {
+ name: "流量",
+ type: "line",
+ data: this.dailyTrafficStats.map(function (v) {
+ return v.count;
+ }),
+ itemStyle: {
+ color: "#9DD3E8"
+ },
+ lineStyle: {
+ color: "#9DD3E8"
+ },
+ areaStyle: {
+ color: "#9DD3E8"
+ }
+ }
+ ],
+ animation: false
+ }
+ chart.setOption(option)
+ chart.resize()
+ }
+
+ /**
+ * 升级提醒
+ */
+ this.closeMessage = function (e) {
+ let target = e.target
+ while (true) {
+ target = target.parentNode
+ if (target.tagName.toUpperCase() == "DIV") {
+ target.style.cssText = "display: none"
+ break
+ }
+ }
+ }
})
diff --git a/web/views/@default/dashboard/index.less b/web/views/@default/dashboard/index.less
index a6361eac..3466d0fc 100644
--- a/web/views/@default/dashboard/index.less
+++ b/web/views/@default/dashboard/index.less
@@ -1,3 +1,11 @@
+.ui.message {
+ .icon {
+ position: absolute;
+ right: 1em;
+ top: 1.8em;
+ }
+}
+
.grid {
margin-top: 2em !important;
margin-left: 2em !important;