[*] 日常优化
This commit is contained in:
@@ -3237,7 +3237,7 @@ class Taoyao extends RemoteClient {
|
|||||||
/**
|
/**
|
||||||
* 重启系统信令
|
* 重启系统信令
|
||||||
*
|
*
|
||||||
* @returns 重启系统
|
* @returns 重启系统结果
|
||||||
*/
|
*/
|
||||||
async systemReboot() {
|
async systemReboot() {
|
||||||
return await this.request(protocol.buildMessage("system::reboot", {}));
|
return await this.request(protocol.buildMessage("system::reboot", {}));
|
||||||
@@ -3246,7 +3246,7 @@ class Taoyao extends RemoteClient {
|
|||||||
/**
|
/**
|
||||||
* 关闭系统信令
|
* 关闭系统信令
|
||||||
*
|
*
|
||||||
* @returns 关闭系统
|
* @returns 关闭系统结果
|
||||||
*/
|
*/
|
||||||
async systemShutdown() {
|
async systemShutdown() {
|
||||||
return await this.request(protocol.buildMessage("system::shutdown", {}));
|
return await this.request(protocol.buildMessage("system::shutdown", {}));
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ public class SystemInfoProtocol extends ProtocolClientAdapter {
|
|||||||
final Map<String, Object> info = new HashMap<>();
|
final Map<String, Object> info = new HashMap<>();
|
||||||
// 硬盘
|
// 硬盘
|
||||||
final List<Diskspace> diskspace = new ArrayList<>();
|
final List<Diskspace> diskspace = new ArrayList<>();
|
||||||
// File.listRoots();
|
|
||||||
// FileSystems.getDefault().getFileStores();
|
// FileSystems.getDefault().getFileStores();
|
||||||
Stream.of(File.listRoots()).forEach(v -> {
|
Stream.of(File.listRoots()).forEach(v -> {
|
||||||
diskspace.add(new Diskspace(v.getPath(), v.getFreeSpace(), v.getTotalSpace()));
|
diskspace.add(new Diskspace(v.getPath(), v.getFreeSpace(), v.getTotalSpace()));
|
||||||
@@ -69,18 +68,18 @@ public class SystemInfoProtocol extends ProtocolClientAdapter {
|
|||||||
info.put("diskspace", diskspace);
|
info.put("diskspace", diskspace);
|
||||||
// 内存
|
// 内存
|
||||||
final Runtime runtime = Runtime.getRuntime();
|
final Runtime runtime = Runtime.getRuntime();
|
||||||
info.put("maxMemory", runtime.maxMemory());
|
info.put("maxMemory", runtime.maxMemory());
|
||||||
info.put("freeMemory", runtime.freeMemory());
|
info.put("freeMemory", runtime.freeMemory());
|
||||||
info.put("totalMemory", runtime.totalMemory());
|
info.put("totalMemory", runtime.totalMemory());
|
||||||
info.put("maxMemoryGracefully", FileUtils.formatSize(runtime.maxMemory()));
|
info.put("maxMemoryGracefully", FileUtils.formatSize(runtime.maxMemory()));
|
||||||
info.put("freeMemoryGracefully", FileUtils.formatSize(runtime.freeMemory()));
|
info.put("freeMemoryGracefully", FileUtils.formatSize(runtime.freeMemory()));
|
||||||
info.put("totalMemoryGracefully", FileUtils.formatSize(runtime.totalMemory()));
|
info.put("totalMemoryGracefully", FileUtils.formatSize(runtime.totalMemory()));
|
||||||
// 其他
|
// 其他
|
||||||
info.put("osArch", System.getProperty("os.arch"));
|
info.put("osArch", System.getProperty("os.arch"));
|
||||||
info.put("osName", System.getProperty("os.name"));
|
info.put("osName", System.getProperty("os.name"));
|
||||||
info.put("osVersion", System.getProperty("os.version"));
|
info.put("osVersion", System.getProperty("os.version"));
|
||||||
info.put("javaVmName", System.getProperty("java.vm.name"));
|
info.put("javaVmName", System.getProperty("java.vm.name"));
|
||||||
info.put("javaVersion", System.getProperty("java.version"));
|
info.put("javaVersion", System.getProperty("java.version"));
|
||||||
info.put("cpuProcessors", runtime.availableProcessors());
|
info.put("cpuProcessors", runtime.availableProcessors());
|
||||||
// 响应
|
// 响应
|
||||||
message.setBody(info);
|
message.setBody(info);
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Description(
|
@Description(
|
||||||
|
memo = "重启系统",
|
||||||
flow = {
|
flow = {
|
||||||
"信令服务+)终端",
|
"信令服务+)终端",
|
||||||
"终端->信令服务+)终端",
|
|
||||||
"终端=>信令服务+)终端"
|
"终端=>信令服务+)终端"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user