|
@@ -1,5 +1,8 @@
|
|
|
package cn.reghao.oss.web.account.controller;
|
|
package cn.reghao.oss.web.account.controller;
|
|
|
|
|
|
|
|
|
|
+import cn.reghao.jutil.jdk.jvm.JVM;
|
|
|
|
|
+import cn.reghao.jutil.jdk.jvm.model.JvmInfo;
|
|
|
|
|
+import cn.reghao.jutil.jdk.machine.id.MachineIdLinux;
|
|
|
import cn.reghao.oss.web.account.model.constant.RoleType;
|
|
import cn.reghao.oss.web.account.model.constant.RoleType;
|
|
|
import cn.reghao.oss.web.account.model.po.Menu;
|
|
import cn.reghao.oss.web.account.model.po.Menu;
|
|
|
import cn.reghao.oss.web.account.model.po.User;
|
|
import cn.reghao.oss.web.account.model.po.User;
|
|
@@ -23,10 +26,14 @@ import java.util.Map;
|
|
|
@Api(tags = "登录页和首页")
|
|
@Api(tags = "登录页和首页")
|
|
|
@Controller
|
|
@Controller
|
|
|
public class AccountAuthController {
|
|
public class AccountAuthController {
|
|
|
|
|
+ private final JVM jvm;
|
|
|
|
|
+ private final MachineIdLinux machineId;
|
|
|
private final HomeService homeService;
|
|
private final HomeService homeService;
|
|
|
private final SysMessageRepository sysMessageRepository;
|
|
private final SysMessageRepository sysMessageRepository;
|
|
|
|
|
|
|
|
public AccountAuthController(HomeService homeService, SysMessageRepository sysMessageRepository) {
|
|
public AccountAuthController(HomeService homeService, SysMessageRepository sysMessageRepository) {
|
|
|
|
|
+ this.jvm = new JVM();
|
|
|
|
|
+ this.machineId = new MachineIdLinux();
|
|
|
this.homeService = homeService;
|
|
this.homeService = homeService;
|
|
|
this.sysMessageRepository = sysMessageRepository;
|
|
this.sysMessageRepository = sysMessageRepository;
|
|
|
}
|
|
}
|
|
@@ -68,7 +75,7 @@ public class AccountAuthController {
|
|
|
/*String commitId = NotAvailable.na.getDesc();
|
|
/*String commitId = NotAvailable.na.getDesc();
|
|
|
if (appVersion != null) {
|
|
if (appVersion != null) {
|
|
|
commitId = appVersion.getCommitId();
|
|
commitId = appVersion.getCommitId();
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
JvmInfo jvmInfo = jvm.info();
|
|
JvmInfo jvmInfo = jvm.info();
|
|
|
//JvmStat jvmStat = jvm.stat();
|
|
//JvmStat jvmStat = jvm.stat();
|
|
@@ -76,15 +83,15 @@ public class AccountAuthController {
|
|
|
String jvmInfo1 = String.format("%s %s", jvmInfo.getJvmName(), jvmInfo.getJvmVersion());
|
|
String jvmInfo1 = String.format("%s %s", jvmInfo.getJvmName(), jvmInfo.getJvmVersion());
|
|
|
int pid = jvmInfo.getJvmPid();
|
|
int pid = jvmInfo.getJvmPid();
|
|
|
String startAt = jvmInfo.getJvmStartTime();
|
|
String startAt = jvmInfo.getJvmStartTime();
|
|
|
- String ipv4 = network.detail().get(0).getIpv4();*/
|
|
|
|
|
|
|
+ String ipv4 = machineId.ipv4();
|
|
|
|
|
|
|
|
- model.addAttribute("managerVersion", "commitId");
|
|
|
|
|
- model.addAttribute("hostAddr", "ipv4");
|
|
|
|
|
- model.addAttribute("osInfo", "osInfo");
|
|
|
|
|
- model.addAttribute("jvmInfo", "jvmInfo1");
|
|
|
|
|
- model.addAttribute("pid", "pid");
|
|
|
|
|
- model.addAttribute("startAt", "startAt");
|
|
|
|
|
|
|
+ model.addAttribute("hostAddr", ipv4);
|
|
|
|
|
+ model.addAttribute("osInfo", osInfo);
|
|
|
|
|
+ model.addAttribute("jvmInfo", jvmInfo1);
|
|
|
|
|
+ model.addAttribute("pid", pid);
|
|
|
|
|
+ model.addAttribute("startAt", startAt);
|
|
|
//model.addAttribute("jvmStat", jvmStat);
|
|
//model.addAttribute("jvmStat", jvmStat);
|
|
|
|
|
+
|
|
|
String template = "/home/index";
|
|
String template = "/home/index";
|
|
|
template = "/home/index1";
|
|
template = "/home/index1";
|
|
|
return template;
|
|
return template;
|