调整界面

This commit is contained in:
GoEdgeLab
2020-10-25 19:45:42 +08:00
parent 9524a0d145
commit cccc64a629
11 changed files with 36 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
package clusters package cluster
import ( import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
@@ -9,6 +9,17 @@ type DeleteAction struct {
actionutils.ParentAction actionutils.ParentAction
} }
func (this *DeleteAction) Init() {
this.Nav("", "delete", "index")
this.SecondMenu("nodes")
}
func (this *DeleteAction) RunGet(params struct{}) {
this.Show()
}
func (this *DeleteAction) RunPost(params struct { func (this *DeleteAction) RunPost(params struct {
ClusterId int64 ClusterId int64
}) { }) {

View File

@@ -15,6 +15,7 @@ func init() {
Prefix("/clusters/cluster"). Prefix("/clusters/cluster").
Get("", new(IndexAction)). Get("", new(IndexAction)).
GetPost("/installNodes", new(InstallNodesAction)). GetPost("/installNodes", new(InstallNodesAction)).
GetPost("/delete", new(DeleteAction)).
// 节点相关 // 节点相关
Get("/node", new(node.NodeAction)). Get("/node", new(node.NodeAction)).

View File

@@ -51,6 +51,8 @@ func (this *ClusterHelper) BeforeAction(action *actions.ActionObject) {
tabbar.Add("集群列表", "", "/clusters", "", false) tabbar.Add("集群列表", "", "/clusters", "", false)
tabbar.Add("节点", "", "/clusters/cluster?clusterId="+clusterIdString, "server", selectedTabbar == "node") tabbar.Add("节点", "", "/clusters/cluster?clusterId="+clusterIdString, "server", selectedTabbar == "node")
tabbar.Add("设置", "", "/clusters/cluster/settings?clusterId="+clusterIdString, "setting", selectedTabbar == "setting") tabbar.Add("设置", "", "/clusters/cluster/settings?clusterId="+clusterIdString, "setting", selectedTabbar == "setting")
tabbar.Add("删除", "", "/clusters/cluster/delete?clusterId="+clusterIdString, "trash", selectedTabbar == "delete")
{ {
m := tabbar.Add("当前集群:"+cluster.Name, "", "/clusters/cluster?clusterId="+clusterIdString, "", false) m := tabbar.Add("当前集群:"+cluster.Name, "", "/clusters/cluster?clusterId="+clusterIdString, "", false)
m["right"] = true m["right"] = true

View File

@@ -15,7 +15,6 @@ func init() {
GetPost("/create", new(CreateAction)). GetPost("/create", new(CreateAction)).
Post("/sync", new(SyncAction)). Post("/sync", new(SyncAction)).
Post("/checkChange", new(CheckChangeAction)). Post("/checkChange", new(CheckChangeAction)).
Post("/delete", new(DeleteAction)).
EndAll() EndAll()
}) })
} }

View File

@@ -0,0 +1,5 @@
.buttons-box {
text-align: center;
margin-top: 2em;
}
/*# sourceMappingURL=delete.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["delete.less"],"names":[],"mappings":"AAAA;EACC,kBAAA;EACA,eAAA","file":"delete.css"}

View File

@@ -0,0 +1,5 @@
{$layout}
<div class="buttons-box">
<button class="ui button red" type="button" @click.prevent="deleteCluster(clusterId)">删除当前集群</button>
</div>

View File

@@ -2,11 +2,13 @@ Tea.context(function () {
this.deleteCluster = function (clusterId) { this.deleteCluster = function (clusterId) {
let that = this let that = this
teaweb.confirm("确定要删除此集群吗?", function () { teaweb.confirm("确定要删除此集群吗?", function () {
that.$post("/clusters/delete") that.$post("/clusters/cluster/delete")
.params({ .params({
clusterId: clusterId clusterId: clusterId
}) })
.refresh() .success(function () {
window.location = "/clusters"
})
}) })
} }
}) })

View File

@@ -0,0 +1,4 @@
.buttons-box {
text-align: center;
margin-top: 2em;
}

View File

@@ -28,8 +28,7 @@
<span v-else class="disabled">N</span> <span v-else class="disabled">N</span>
</td> </td>
<td> <td>
<a :href="'/clusters/cluster?clusterId=' + cluster.id">详情</a> &nbsp; <a :href="'/clusters/cluster?clusterId=' + cluster.id">详情</a>
<a href="" @click.prevent="deleteCluster(cluster.id)">删除</a>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -1,6 +1,6 @@
{$layout} {$layout}
{$template "/left_menu"} {$template "/left_menu"}
<div class="right-box"> <div class="right-box">
<button class="ui button red" type="button" @click.prevent="deleteServer(serverId)">删除当前服务</button> <button class="ui button red" type="button" @click.prevent="deleteServer(serverId)">删除当前服务</button>
</div> </div>