diff --git a/resource/static/theme-mdui/mdui.css b/resource/static/theme-mdui/mdui.css new file mode 100644 index 0000000..2b381fb --- /dev/null +++ b/resource/static/theme-mdui/mdui.css @@ -0,0 +1,34 @@ +.mdui-appbar{box-shadow:0 -1px 10px 0 rgb(32 33 36 / 28%)} +.mdui-card,.mdui-btn-raised,.mdui-panel-item{box-shadow:0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);} +.mdui-drawer{box-shadow:-1px 10px 10px 0 rgb(60 64 67 / 30%), 0 1px 3px 1px rgb(60 64 67 / 15%);} +footer{box-shadow:5px 0px 5px 0 rgb(60 64 67 / 30%), 0 1px 3px 1px rgb(60 64 67 / 15%);} +st{font-weight:600;color:#475bca;} +at{font-weight:600;color:#FF4081;} +gt{font-weight:600;color:#00C853;} +yt{font-weight:600;color:#ffbb00;} + +.mdui-theme-layout-dark st{color:#9aa9ff;} +.mdui-theme-layout-dark at{color:#f7a4b9;} +.mt{margin-top:15px;} +.mt-s{margin-top:3px;} +.mdui-card ul.mdui-list{padding-left: 0;} +.text{font-size:20px;} +.text_s{font-size:17px;} +.mdui-switch{height:20px;line-height:20px;} +.stop{background:#b6b6b6;}.stop td{color:#fff;font-weight:bold;} +.ccp:hover,.poh:hover{cursor: pointer;} + +.mdui-drawer, footer{ + /* background-color: #fdfdfdda; */ + backdrop-filter: blur(15px) brightness(110%); +} +.mdui-card{ + border-radius: 6px; + backdrop-filter:blur(7px); + /* background-color: #ffffff8a; */ +} +.btn{ + border-radius: 5px; + font-weight: bold;font-size: 15px; +} + diff --git a/resource/static/theme-mdui/mdui.js b/resource/static/theme-mdui/mdui.js new file mode 100644 index 0000000..29dd6cb --- /dev/null +++ b/resource/static/theme-mdui/mdui.js @@ -0,0 +1,33 @@ +function showConfirm(title, content, callFn, extData) { + mdui.confirm(content, title, + function(){ + callFn(extData); + }); +} + +function logout(id) { + $.post("/api/logout", JSON.stringify({ id: id })) + .done(function (resp) { + if (resp.code == 200) { + mdui.snackbar({ + message: '注销成功', + timeout: 2000, + position: 'top', + }); + window.location.reload(); + } else { + mdui.snackbar({ + message: '注销失败(Error ' + resp.code + '): ' + resp.message, + timeout: 5000, + position: 'top', + }); + } + }) + .fail(function (err) { + mdui.snackbar({ + message: '网络错误: ' + err.responseText, + timeout: 5000, + position: 'top', + }); + }); +} diff --git a/resource/template/dashboard/setting.html b/resource/template/dashboard/setting.html index aaf1b7b..533af98 100644 --- a/resource/template/dashboard/setting.html +++ b/resource/template/dashboard/setting.html @@ -21,6 +21,7 @@ JackieSung DayNight +
@@ -102,4 +103,4 @@ $('.checkbox').checkbox('set checked') {{ end }} -{{end}} \ No newline at end of file +{{end}} diff --git a/resource/template/theme-mdui/home-card.png b/resource/template/theme-mdui/home-card.png new file mode 100644 index 0000000..7f174e6 Binary files /dev/null and b/resource/template/theme-mdui/home-card.png differ diff --git a/resource/template/theme-mdui/home-table.png b/resource/template/theme-mdui/home-table.png new file mode 100644 index 0000000..e98537d Binary files /dev/null and b/resource/template/theme-mdui/home-table.png differ diff --git a/resource/template/theme-mdui/home.html b/resource/template/theme-mdui/home.html new file mode 100644 index 0000000..8420eab --- /dev/null +++ b/resource/template/theme-mdui/home.html @@ -0,0 +1,299 @@ +{{define "theme-mdui/home"}} + + + + + + + {{.Title}} + + + + + + + {{if ts .CustomCode}} + {{.CustomCode|safe}} + {{end}} + + + + +
+
+ {{if .IsAdminPage}} + computer主机 + accessibility服务 + access_time任务 + notifications报警 + settings设置 + {{else}} + home首页 + accessibility服务 + {{end}} +
+ {{if .Admin}} + {{if .IsAdminPage}} + arrow_back返回前台 + {{else}} + arrow_forward管理后台 + {{end}} + directions_run注销登录 + {{else}} + person登录 + {{end}} +
+
+ +
+
+ +
+
+
+
+
+
@#server.Name#@
+
+
+ info_outline +
+
+
    +
  • + memory +
    + CPU @#server.live?parseInt(server.State.CPU):'NaN'#@% +
    +
    +
    +
    +
    +
    +
  • +
  • + straighten +
    + MEM @#parseInt(server.State?server.State.MemUsed/server.Host.MemTotal*100:0)#@% +
    +
    +
    +
    +
  • +
  • + swap_vert +
    +
    上行
    +
    + @#formatNetByteSize(server.State.NetOutSpeed)#@ +
    +
    +
    +
    下行
    +
    + @#formatNetByteSize(server.State.NetInSpeed)#@ +
    +
    +
  • +
  • + swap_horiz +
    +
    总上行
    +
    + @#formatByteSize(server.State.NetOutTransfer)#@ +
    +
    +
    +
    总下行
    +
    + @#formatByteSize(server.State.NetInTransfer)#@ +
    +
    +
  • +
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDNameUpDownTotal UpTotal DownCPURAMOnline
@#server.ID#@@#server.Name#@@#formatNetByteSize(server.State.NetOutSpeed)#@@#formatNetByteSize(server.State.NetInSpeed)#@@#formatByteSize(server.State.NetOutTransfer)#@@#formatByteSize(server.State.NetInTransfer)#@ +
+
+ @#server.live?parseInt(server.State.CPU):'NaN'#@% +
+
+
+
+
+ @#parseInt(server.State?server.State.MemUsed/server.Host.MemTotal*100:0)#@% +
+
+
@#secondToDate(server.State.Uptime)#@
+
+ +
+
+ + + + + + + + + + + +{{end}} diff --git a/resource/template/theme-mdui/service.html b/resource/template/theme-mdui/service.html new file mode 100644 index 0000000..03e66f0 --- /dev/null +++ b/resource/template/theme-mdui/service.html @@ -0,0 +1,124 @@ +{{define "theme-mdui/service"}} + + + + + + + {{.Title}} + + + + + + {{if ts .CustomCode}} + {{.CustomCode|safe}} + {{end}} + + + + +
+
+ {{if .IsAdminPage}} + computer主机 + accessibility服务 + access_time任务 + notifications报警 + settings设置 + {{else}} + home首页 + accessibility服务 + {{end}} +
+ {{if .Admin}} + {{if .IsAdminPage}} + arrow_back返回前台 + {{else}} + arrow_forward管理后台 + {{end}} + directions_run注销登录 + {{else}} + 登录 + {{end}} +
+
+ + +
+
+ + + + + + + + + + + {{range $service := .Services}} + + + + + + + {{end}} + +
NameSLADetails of Last 30 DaysNow
{{$service.Monitor.Name}}{{float32f (divU64 $service.TotalUp (addU64 $service.TotalUp $service.TotalDown))}}% + {{range $i,$d := $service.Delay}} + {{$percent := (div (index $service.Up $i) (add (index $service.Up $i) (index $service.Down $i)))}} + {{if eq $percent 0.0}} + favorite_border + {{else if ge $percent 95.0}} + favorite + {{else if ge $percent 80.0}} + favorite + {{else}} + favorite + {{end}} + {{end}} + + {{$percent := (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}} + {{if eq $percent 0.0}} + sentiment_neutral +

{{statusName (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}

+ {{else if ge $percent 95.0}} +
+

{{statusName (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}

+ {{else if ge $percent 80.0}} + sentiment_dissatisfied +

{{statusName (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}

+ {{else}} + sentiment_very_dissatisfied +

{{statusName (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}

+ {{end}} +
+
+
+ + + + + + + + + + + +{{end}} diff --git a/resource/template/theme-mdui/service.png b/resource/template/theme-mdui/service.png new file mode 100644 index 0000000..51365fe Binary files /dev/null and b/resource/template/theme-mdui/service.png differ diff --git a/resource/template/theme-mdui/viewpassword.html b/resource/template/theme-mdui/viewpassword.html new file mode 100644 index 0000000..f0d71de --- /dev/null +++ b/resource/template/theme-mdui/viewpassword.html @@ -0,0 +1,88 @@ +{{define "theme-mdui/viewpassword"}} + + + + + + + {{.Title}} + + + + + {{if ts .CustomCode}} + {{.CustomCode|safe}} + {{end}} + + + +
+
+ + + + + + +{{end}}