summaryrefslogtreecommitdiff
path: root/src/server/api
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2021-01-03 22:38:32 +0900
committersyuilo <syuilotan@yahoo.co.jp>2021-01-03 22:38:32 +0900
commitc6fe79809286ca4a886a2a8e01efb4201bb5a2c1 (patch)
tree1c8bf0d7749e453e1113afead08fe6e433e9abb9 /src/server/api
parentFix CSS injection at MFM speed (#7051) (diff)
downloadsharkey-c6fe79809286ca4a886a2a8e01efb4201bb5a2c1.tar.gz
sharkey-c6fe79809286ca4a886a2a8e01efb4201bb5a2c1.tar.bz2
sharkey-c6fe79809286ca4a886a2a8e01efb4201bb5a2c1.zip
サーバー情報ウィジェット
Diffstat (limited to 'src/server/api')
-rw-r--r--src/server/api/endpoints/server-info.ts35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/server/api/endpoints/server-info.ts b/src/server/api/endpoints/server-info.ts
new file mode 100644
index 0000000000..4e636d331c
--- /dev/null
+++ b/src/server/api/endpoints/server-info.ts
@@ -0,0 +1,35 @@
+import * as os from 'os';
+import * as si from 'systeminformation';
+import define from '../define';
+
+export const meta = {
+ requireCredential: false as const,
+
+ desc: {
+ },
+
+ tags: ['meta'],
+
+ params: {
+ },
+};
+
+export default define(meta, async () => {
+ const memStats = await si.mem();
+ const fsStats = await si.fsSize();
+
+ return {
+ machine: os.hostname(),
+ cpu: {
+ model: os.cpus()[0].model,
+ cores: os.cpus().length
+ },
+ mem: {
+ total: memStats.total
+ },
+ fs: {
+ total: fsStats[0].size,
+ used: fsStats[0].used,
+ },
+ };
+});