|
|
@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@@ -40,6 +41,7 @@ public class PackerPageController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "打包配置页面")
|
|
|
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@GetMapping
|
|
|
public String packerPage(Model model) {
|
|
|
PageRequest pageRequest = PageSort.pageRequest();
|
|
|
@@ -50,6 +52,8 @@ public class PackerPageController {
|
|
|
return "/devops/build/packer/index";
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "打包添加页面")
|
|
|
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@GetMapping("/add")
|
|
|
public String addPackerPage(Model model) {
|
|
|
List<KeyValue> registryList = dockerRegistryRepository.findAll()
|
|
|
@@ -66,6 +70,8 @@ public class PackerPageController {
|
|
|
return "/devops/build/packer/add";
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "打包更新页面")
|
|
|
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@GetMapping("/edit/{id}")
|
|
|
public String editPackerPage(@PathVariable("id") PackerConfig packerConfig, Model model) {
|
|
|
model.addAttribute("packer", packerConfig);
|
|
|
@@ -82,6 +88,8 @@ public class PackerPageController {
|
|
|
model.addAttribute("machineIpv4", Machine.IPV4);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "打包详情页面")
|
|
|
+ @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@GetMapping("/detail/{id}")
|
|
|
public String packerDetailPage(@PathVariable("id") PackerConfig packerConfig, Model model) {
|
|
|
model.addAttribute("packer", packerConfig);
|