|
|
@@ -23,6 +23,7 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -42,7 +43,7 @@ public class CompilerPageController {
|
|
|
this.compilerConfigService = compilerConfigService;
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "编译配置页面", notes = "N")
|
|
|
+ @ApiOperation(value = "编译配置列表页面", notes = "N")
|
|
|
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@GetMapping
|
|
|
public String compilerConfigPage(Model model) {
|
|
|
@@ -62,14 +63,6 @@ public class CompilerPageController {
|
|
|
return "/devops/build/compiler/add";
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "编译更新页面", notes = "N")
|
|
|
- @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
- @GetMapping("/edit/{id}")
|
|
|
- public String editCompilerPage(@PathVariable("id") CompilerConfig compilerConfig, Model model) {
|
|
|
- model.addAttribute("compiler", compilerConfig);
|
|
|
- return "/devops/build/compiler/edit";
|
|
|
- }
|
|
|
-
|
|
|
private void setCompilerModel(Model model) {
|
|
|
List<KeyValue> compileTypes = new ArrayList<>();
|
|
|
for (CompileType compileType : CompileType.values()) {
|
|
|
@@ -80,40 +73,26 @@ public class CompilerPageController {
|
|
|
model.addAttribute("machineIpv4", Machine.IPV4);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "编译详情页面", notes = "N")
|
|
|
- @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
- @GetMapping("/detail/{id}")
|
|
|
- public String compilerDetailPage(@PathVariable("id") CompilerConfig compilerConfig, Model model) {
|
|
|
- model.addAttribute("compiler", compilerConfig);
|
|
|
- return "/devops/build/compiler/detail";
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "编译器版本页面", notes = "N")
|
|
|
- @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
- @GetMapping("/version/{id}")
|
|
|
- public String compilerVersionPage(@PathVariable("id") int id, Model model) {
|
|
|
- String result = compilerConfigService.getCompilerVersion(id);
|
|
|
- model.addAttribute("content", result);
|
|
|
- return "/devops/build/compiler/version";
|
|
|
- }
|
|
|
-
|
|
|
@ApiOperation(value = "docker 编译器映射目录页面", notes = "N")
|
|
|
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@GetMapping("/bind/{id}")
|
|
|
public String compilerBindPage(@PathVariable("id") int id, Model model) {
|
|
|
CompilerConfig compilerConfig = compilerConfigRepository.findById(id).orElse(null);
|
|
|
+ boolean dockerType = true;
|
|
|
+ List<CompilerBind> list;
|
|
|
if (compilerConfig != null && compilerConfig.getType().equals(CompileType.docker.getName())) {
|
|
|
- List<CompilerBind> list = compilerConfig.getCompilerBinds();
|
|
|
- model.addAttribute("list", list);
|
|
|
- return "/devops/build/compiler/bind";
|
|
|
+ list = compilerConfig.getCompilerBinds();
|
|
|
} else {
|
|
|
- String content = "not docker type";
|
|
|
- model.addAttribute("content", content);
|
|
|
- return "/devops/build/compiler/version";
|
|
|
+ dockerType = false;
|
|
|
+ list = new ArrayList<>();
|
|
|
}
|
|
|
+
|
|
|
+ model.addAttribute("dockerType", dockerType);
|
|
|
+ model.addAttribute("list", list);
|
|
|
+ return "/devops/build/compiler/bind";
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "添加/修改应用编译配置", notes = "N")
|
|
|
+ @ApiOperation(value = "添加编译配置", notes = "N")
|
|
|
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
@ResponseBody
|