2020-09-06 16:19:34 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								package cluster
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import (
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-28 18:21:11 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/groups"
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-06 16:19:34 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/node"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									clusters "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/clusterutils"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									"github.com/iwind/TeaGo"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								func init() {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									TeaGo.BeforeStart(func(server *TeaGo.Server) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										server.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Helper(helpers.NewUserMustAuth()).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Helper(clusters.NewClusterHelper()).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Prefix("/clusters/cluster").
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Get("", new(IndexAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-17 11:14:07 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											GetPost("/installNodes", new(InstallNodesAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-26 21:14:26 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											GetPost("/installRemote", new(InstallRemoteAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Post("/installStatus", new(InstallStatusAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-28 12:35:49 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											GetPost("/upgradeRemote", new(UpgradeRemoteAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Post("/upgradeStatus", new(UpgradeStatusAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-25 19:45:42 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											GetPost("/delete", new(DeleteAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-26 21:14:26 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											GetPost("/createNode", new(CreateNodeAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											GetPost("/createBatch", new(CreateBatchAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											GetPost("/updateNodeSSH", new(UpdateNodeSSHAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-28 12:47:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											GetPost("/installManual", new(InstallManualAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-06 16:19:34 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											// 节点相关
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Get("/node", new(node.NodeAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											GetPost("/node/update", new(node.UpdateAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											GetPost("/node/install", new(node.InstallAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Post("/node/updateInstallStatus", new(node.UpdateInstallStatusAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-13 20:37:07 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											Post("/node/status", new(node.StatusAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-09 11:07:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											Get("/node/logs", new(node.LogsAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-27 12:33:27 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											Post("/node/start", new(node.StartAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Post("/node/stop", new(node.StopAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-28 18:21:11 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											// 分组相关
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Get("/groups", new(groups.IndexAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											GetPost("/groups/createPopup", new(groups.CreatePopupAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											GetPost("/groups/updatePopup", new(groups.UpdatePopupAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Post("/groups/delete", new(groups.DeleteAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											Post("/groups/sort", new(groups.SortAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-28 20:00:27 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											Post("/groups/options", new(groups.OptionsAction)).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											GetPost("/groups/selectPopup", new(groups.SelectPopupAction)).
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-28 18:21:11 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-06 16:19:34 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
											EndAll()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 |