|
|
@@ -3,9 +3,8 @@ package cn.reghao.autodop.dmaster.app.controller.page;
|
|
|
import cn.reghao.autodop.common.msg.rpc.dto.app.PackType;
|
|
|
import cn.reghao.autodop.dmaster.app.model.constant.AppType;
|
|
|
import cn.reghao.autodop.dmaster.app.model.constant.EnvList;
|
|
|
-import cn.reghao.autodop.dmaster.app.model.po.config.deploy.DeployConfig;
|
|
|
+import cn.reghao.autodop.dmaster.app.model.po.config.DeployConfig;
|
|
|
import cn.reghao.autodop.dmaster.machine.db.query.MachineHostQuery;
|
|
|
-import cn.reghao.autodop.dmaster.machine.model.po.MachineHost;
|
|
|
import cn.reghao.autodop.dmaster.notification.model.po.NotifyGroup;
|
|
|
import cn.reghao.autodop.dmaster.notification.model.po.NotifyType;
|
|
|
import cn.reghao.autodop.dmaster.app.db.query.config.AppQuery;
|
|
|
@@ -13,8 +12,7 @@ import cn.reghao.autodop.dmaster.app.db.query.config.ProjQuery;
|
|
|
import cn.reghao.autodop.dmaster.app.db.query.config.build.CompilerQuery;
|
|
|
import cn.reghao.autodop.dmaster.app.db.query.config.build.PackerQuery;
|
|
|
import cn.reghao.autodop.dmaster.app.db.query.config.build.RepoAuthQuery;
|
|
|
-import cn.reghao.autodop.dmaster.app.model.po.config.AppOrchestration;
|
|
|
-import cn.reghao.autodop.dmaster.app.model.po.config.ProjOrchestration;
|
|
|
+import cn.reghao.autodop.dmaster.app.model.po.config.AppConfig;
|
|
|
import cn.reghao.autodop.dmaster.app.model.vo.KeyValue;
|
|
|
import cn.reghao.autodop.dmaster.notification.db.repository.NotifyGroupRepository;
|
|
|
import cn.reghao.autodop.dmaster.util.db.PageList;
|
|
|
@@ -37,9 +35,9 @@ import java.util.stream.Collectors;
|
|
|
* @date 2019-08-30 18:49:15
|
|
|
*/
|
|
|
@Slf4j
|
|
|
-@Api(tags = "应用配置页面接口")
|
|
|
+@Api(tags = "应用配置页面")
|
|
|
@Controller
|
|
|
-@RequestMapping("/app/config")
|
|
|
+@RequestMapping("/app/config/app")
|
|
|
public class AppConfigPageController {
|
|
|
private final AppQuery appQuery;
|
|
|
private final ProjQuery projQuery;
|
|
|
@@ -49,9 +47,9 @@ public class AppConfigPageController {
|
|
|
private final MachineHostQuery hostQuery;
|
|
|
private final NotifyGroupRepository receiverRepository;
|
|
|
|
|
|
- public AppConfigPageController(AppQuery appQuery, ProjQuery projQuery,
|
|
|
- RepoAuthQuery repoAuthQuery, CompilerQuery compilerQuery, PackerQuery packerQuery,
|
|
|
- MachineHostQuery hostQuery, NotifyGroupRepository receiverRepository) {
|
|
|
+ public AppConfigPageController(AppQuery appQuery, ProjQuery projQuery, RepoAuthQuery repoAuthQuery,
|
|
|
+ CompilerQuery compilerQuery, PackerQuery packerQuery, MachineHostQuery hostQuery,
|
|
|
+ NotifyGroupRepository receiverRepository) {
|
|
|
this.appQuery = appQuery;
|
|
|
this.projQuery = projQuery;
|
|
|
this.repoAuthQuery = repoAuthQuery;
|
|
|
@@ -62,7 +60,7 @@ public class AppConfigPageController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "应用配置页面")
|
|
|
- @GetMapping("/app")
|
|
|
+ @GetMapping
|
|
|
public String appConfigPage(@RequestParam(value = "env", required = false) String env,
|
|
|
@RequestParam(value = "appName", required = false) String appName, Model model) {
|
|
|
if (env == null) {
|
|
|
@@ -72,9 +70,9 @@ public class AppConfigPageController {
|
|
|
if (appName != null) {
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("appName", appName);
|
|
|
- List<AppOrchestration> list = appQuery.query(map);
|
|
|
- Page<AppOrchestration> page = new PageImpl<>(list);
|
|
|
- PageList<AppOrchestration> pageList = PageList.pageList(page);
|
|
|
+ List<AppConfig> list = appQuery.query(map);
|
|
|
+ Page<AppConfig> page = new PageImpl<>(list);
|
|
|
+ PageList<AppConfig> pageList = PageList.pageList(page);
|
|
|
|
|
|
model.addAttribute("env", env);
|
|
|
model.addAttribute("page", page);
|
|
|
@@ -83,8 +81,8 @@ public class AppConfigPageController {
|
|
|
}
|
|
|
|
|
|
PageRequest pageRequest = PageSort.pageRequest();
|
|
|
- Page<AppOrchestration> appPage = appQuery.findByEnv(env, pageRequest);
|
|
|
- PageList<AppOrchestration> pageList = PageList.pageList(appPage);
|
|
|
+ Page<AppConfig> appPage = appQuery.findByEnv(env, pageRequest);
|
|
|
+ PageList<AppConfig> pageList = PageList.pageList(appPage);
|
|
|
|
|
|
model.addAttribute("env", env);
|
|
|
model.addAttribute("page", appPage);
|
|
|
@@ -92,7 +90,7 @@ public class AppConfigPageController {
|
|
|
return "/app/config/app/index";
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/app/add")
|
|
|
+ @GetMapping("/add")
|
|
|
public String addAppConfigPage(Model model) {
|
|
|
setAppModel(model);
|
|
|
return "/app/config/app/add";
|
|
|
@@ -165,29 +163,29 @@ public class AppConfigPageController {
|
|
|
model.addAttribute("packers", packers);
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/app/edit/{id}")
|
|
|
- public String editAppConfigPage(@PathVariable("id") AppOrchestration app, Model model) {
|
|
|
+ @GetMapping("/edit/{id}")
|
|
|
+ public String editAppConfigPage(@PathVariable("id") AppConfig app, Model model) {
|
|
|
setAppModel(model);
|
|
|
model.addAttribute("app", app);
|
|
|
return "/app/config/app/add";
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/app/copy/{id}")
|
|
|
- public String copyAppConfigPage(@PathVariable("id") AppOrchestration app, Model model) {
|
|
|
+ @GetMapping("/copy/{id}")
|
|
|
+ public String copyAppConfigPage(@PathVariable("id") AppConfig app, Model model) {
|
|
|
model.addAttribute("app", app);
|
|
|
return "/app/config/app/copy";
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/app/detail/{appId}")
|
|
|
+ @GetMapping("/detail/{appId}")
|
|
|
public String appConfigPage(@PathVariable("appId") String appId, Model model) {
|
|
|
- AppOrchestration app = appQuery.findByAppId(appId);
|
|
|
+ AppConfig app = appQuery.findByAppId(appId);
|
|
|
model.addAttribute("app", app);
|
|
|
return "/app/config/app/detail";
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "通知配置页面")
|
|
|
- @GetMapping("/app/notify/{id}")
|
|
|
- public String receiverIdsPage(@PathVariable("id") AppOrchestration app, Model model) {
|
|
|
+ @GetMapping("/notify/{id}")
|
|
|
+ public String receiverIdsPage(@PathVariable("id") AppConfig app, Model model) {
|
|
|
Set<NotifyGroup> currentSet = new HashSet<>(app.getNotifyGroups());
|
|
|
List<NotifyGroup> list = receiverRepository.findAll();
|
|
|
|
|
|
@@ -198,8 +196,8 @@ public class AppConfigPageController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "部署配置页面")
|
|
|
- @GetMapping("/app/deploy/{id}")
|
|
|
- public String deployConfigPage(@PathVariable("id") AppOrchestration app, Model model) {
|
|
|
+ @GetMapping("/deploy/{id}")
|
|
|
+ public String deployConfigPage(@PathVariable("id") AppConfig app, Model model) {
|
|
|
int id = app.getId();
|
|
|
List<DeployConfig> list = app.getDeployConfigs();
|
|
|
if (list == null) {
|
|
|
@@ -218,55 +216,4 @@ public class AppConfigPageController {
|
|
|
model.addAttribute("list", list);
|
|
|
return "/app/config/app/deploy";
|
|
|
}
|
|
|
-
|
|
|
- @ApiOperation(value = "项目配置页面")
|
|
|
- @GetMapping("/proj")
|
|
|
- public String projConfigPage(@RequestParam(value = "projName", required = false) String projName, Model model) {
|
|
|
-
|
|
|
- /*if (projName != null) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
- map.put("projName", projName);
|
|
|
- List<AppOrchestration> list = appConfigQuery.query(map);
|
|
|
- Page<AppOrchestration> page = new PageImpl<>(list);
|
|
|
- PageList<AppOrchestration> pageList = PageList.pageList(page);
|
|
|
-
|
|
|
- model.addAttribute("page", page);
|
|
|
- model.addAttribute("list", pageList.getList());
|
|
|
- return "/app/config/app/index";
|
|
|
- }*/
|
|
|
-
|
|
|
- PageRequest pageRequest = PageSort.pageRequest();
|
|
|
- Page<ProjOrchestration> page = projQuery.findByIsDeleteFalse(pageRequest);
|
|
|
- PageList<ProjOrchestration> pageList = PageList.pageList(page);
|
|
|
-
|
|
|
- model.addAttribute("page", page);
|
|
|
- model.addAttribute("list", pageList.getList());
|
|
|
- return "/app/config/proj/index";
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/proj/add")
|
|
|
- public String addProjConfigPage(Model model) {
|
|
|
- setCommon(model);
|
|
|
- return "/app/config/proj/add";
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/proj/edit/{id}")
|
|
|
- public String editProjConfigPage(@PathVariable("id") ProjOrchestration proj, Model model) {
|
|
|
- setCommon(model);
|
|
|
- model.addAttribute("proj", proj);
|
|
|
- return "/app/config/proj/add";
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/proj/copy/{id}")
|
|
|
- public String copyProjConfigPage(@PathVariable("id") ProjOrchestration proj, Model model) {
|
|
|
- model.addAttribute("proj", proj);
|
|
|
- return "/app/config/proj/copy";
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/proj/detail/{projId}")
|
|
|
- public String projConfigDetailPage(@PathVariable("projId") String projId, Model model) {
|
|
|
- ProjOrchestration proj = projQuery.findByIsDeleteFalseAndProjId(projId);
|
|
|
- model.addAttribute("proj", proj);
|
|
|
- return "/app/config/proj/detail";
|
|
|
- }
|
|
|
}
|