mirror of https://github.com/halo-dev/halo
Create /api/admin/is_installed api.
parent
648becf111
commit
f7c3ca8020
|
@ -149,7 +149,8 @@ public class HaloConfiguration {
|
|||
"/api/admin/login",
|
||||
"/api/admin/refresh/*",
|
||||
"/api/admin/installations",
|
||||
"/api/admin/recoveries/migrations/*"
|
||||
"/api/admin/recoveries/migrations/*",
|
||||
"/api/admin/is_installed"
|
||||
);
|
||||
adminAuthenticationFilter.setFailureHandler(
|
||||
failureHandler);
|
||||
|
|
|
@ -8,9 +8,11 @@ import run.halo.app.cache.lock.CacheLock;
|
|||
import run.halo.app.model.dto.EnvironmentDTO;
|
||||
import run.halo.app.model.dto.StatisticDTO;
|
||||
import run.halo.app.model.params.LoginParam;
|
||||
import run.halo.app.model.properties.PrimaryProperties;
|
||||
import run.halo.app.model.support.BaseResponse;
|
||||
import run.halo.app.security.token.AuthToken;
|
||||
import run.halo.app.service.AdminService;
|
||||
import run.halo.app.service.OptionService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
|
@ -28,25 +30,17 @@ public class AdminController {
|
|||
|
||||
private final AdminService adminService;
|
||||
|
||||
public AdminController(AdminService adminService) {
|
||||
private final OptionService optionService;
|
||||
|
||||
public AdminController(AdminService adminService, OptionService optionService) {
|
||||
this.adminService = adminService;
|
||||
this.optionService = optionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get some statistics about the count of posts, the count of comments, etc.
|
||||
*
|
||||
* @return counts
|
||||
*/
|
||||
@GetMapping("counts")
|
||||
@ApiOperation("Gets count info")
|
||||
public StatisticDTO getCount() {
|
||||
return adminService.getCount();
|
||||
}
|
||||
|
||||
@GetMapping("environments")
|
||||
@ApiOperation("Gets environments info")
|
||||
public EnvironmentDTO getEnvironments() {
|
||||
return adminService.getEnvironments();
|
||||
@GetMapping(value = "/is_installed")
|
||||
@ApiOperation("Check install status")
|
||||
public boolean isInstall() {
|
||||
return optionService.getByPropertyOrDefault(PrimaryProperties.IS_INSTALLED, Boolean.class, false);
|
||||
}
|
||||
|
||||
@PostMapping("login")
|
||||
|
@ -70,6 +64,23 @@ public class AdminController {
|
|||
return adminService.refreshToken(refreshToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get some statistics about the count of posts, the count of comments, etc.
|
||||
*
|
||||
* @return counts
|
||||
*/
|
||||
@GetMapping("counts")
|
||||
@ApiOperation("Gets count info")
|
||||
public StatisticDTO getCount() {
|
||||
return adminService.getCount();
|
||||
}
|
||||
|
||||
@GetMapping("environments")
|
||||
@ApiOperation("Gets environments info")
|
||||
public EnvironmentDTO getEnvironments() {
|
||||
return adminService.getEnvironments();
|
||||
}
|
||||
|
||||
@PutMapping("halo-admin")
|
||||
@ApiOperation("Updates halo-admin manually")
|
||||
public void updateAdmin() {
|
||||
|
|
|
@ -116,10 +116,6 @@ see https://gitee.com/yadong.zhang/DBlog/blob/master/blog-web/src/main/java/com/
|
|||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Reference in New Issue