|
|
@@ -43,8 +43,8 @@ import java.util.stream.Collectors;
|
|
|
@Controller
|
|
|
@RequestMapping("/machine")
|
|
|
public class MachinePageController {
|
|
|
- private MachineInfoCrud infoCrud;
|
|
|
private MachineInfoQuery infoQuery;
|
|
|
+ private MachineInfoCrud infoCrud;
|
|
|
private MachineHostQuery hostQuery;
|
|
|
private MachineStatQuery statQuery;
|
|
|
private NotifyGroupRepository receiverRepository;
|
|
|
@@ -95,17 +95,19 @@ public class MachinePageController {
|
|
|
model.addAttribute("list", pageList.getList());
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "机器通知设置页面")
|
|
|
- @GetMapping("/notify/{machineId}")
|
|
|
- public String machineNotifyPage(@PathVariable("machineId") String machineId, Model model) {
|
|
|
- MachineHost machineHost = hostQuery.findByMachineId(machineId);
|
|
|
- Set<NotifyGroup> currentSet = new HashSet<>(machineHost.getNotifyGroups());
|
|
|
- List<NotifyGroup> list = receiverRepository.findAll();
|
|
|
+ @ApiOperation(value = "机器所属环境设置页面")
|
|
|
+ @GetMapping("/env/{machineId}")
|
|
|
+ public String hostEditPage(@PathVariable("machineId") String machineId, Model model) {
|
|
|
+ List<KeyValue> envs = new ArrayList<>();
|
|
|
+ for (EnvList envList : EnvList.values()) {
|
|
|
+ envs.add(new KeyValue(envList.name(), envList.name()));
|
|
|
+ }
|
|
|
|
|
|
+ MachineHost machineHost = hostQuery.findByMachineId(machineId);
|
|
|
model.addAttribute("machineId", machineId);
|
|
|
- model.addAttribute("currentSet", currentSet);
|
|
|
- model.addAttribute("list", list);
|
|
|
- return "/machine/machinenotify";
|
|
|
+ model.addAttribute("environments", envs);
|
|
|
+ model.addAttribute("env", machineHost.getEnv());
|
|
|
+ return "/machine/edit";
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "SSH 认证设置页面")
|
|
|
@@ -119,6 +121,19 @@ public class MachinePageController {
|
|
|
return "/machine/sshauth";
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "机器通知设置页面")
|
|
|
+ @GetMapping("/notify/{machineId}")
|
|
|
+ public String machineNotifyPage(@PathVariable("machineId") String machineId, Model model) {
|
|
|
+ MachineHost machineHost = hostQuery.findByMachineId(machineId);
|
|
|
+ Set<NotifyGroup> currentSet = new HashSet<>(machineHost.getNotifyGroups());
|
|
|
+ List<NotifyGroup> list = receiverRepository.findAll();
|
|
|
+
|
|
|
+ model.addAttribute("machineId", machineId);
|
|
|
+ model.addAttribute("currentSet", currentSet);
|
|
|
+ model.addAttribute("list", list);
|
|
|
+ return "/machine/machinenotify";
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "SSH 控制台页面")
|
|
|
@GetMapping("/webssh/{machineId}")
|
|
|
public String webSshPage(@PathVariable("machineId") String machineId, Model model) {
|
|
|
@@ -140,23 +155,8 @@ public class MachinePageController {
|
|
|
return "/machine/webssh";
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "机器额外信息编辑页面")
|
|
|
- @GetMapping("/host/edit/{machineId}")
|
|
|
- public String hostEditPage(@PathVariable("machineId") String machineId, Model model) {
|
|
|
- List<KeyValue> envs = new ArrayList<>();
|
|
|
- for (EnvList envList : EnvList.values()) {
|
|
|
- envs.add(new KeyValue(envList.name(), envList.name()));
|
|
|
- }
|
|
|
-
|
|
|
- MachineHost machineHost = hostQuery.findByMachineId(machineId);
|
|
|
- model.addAttribute("machineId", machineId);
|
|
|
- model.addAttribute("environments", envs);
|
|
|
- model.addAttribute("env", machineHost.getEnv());
|
|
|
- return "/machine/edit";
|
|
|
- }
|
|
|
-
|
|
|
@ApiOperation(value = "机器信息详情页面")
|
|
|
- @GetMapping("/host/detail/{machineId}")
|
|
|
+ @GetMapping("/detail/{machineId}")
|
|
|
public String hostDetailPage(@PathVariable("machineId") String machineId, Model model) {
|
|
|
MachineInfo machineInfo = infoQuery.findByMachineId(machineId);
|
|
|
model.addAttribute("machine", machineInfo);
|