lrf402788946 há 4 anos atrás
pai
commit
f5ea428310
2 ficheiros alterados com 5 adições e 2 exclusões
  1. 2 0
      app/model/top.js
  2. 3 2
      package.json

+ 2 - 0
app/model/top.js

@@ -1,4 +1,5 @@
 'use strict';
+const moment = require('moment');
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 
@@ -16,6 +17,7 @@ const TopSchema = {
   mem: { type: String, required: false }, // 可用物理内存百分比
   time: { type: String, required: false, maxLength: 100 }, // 任务启动后到现在所使用的全部CPU时间
   command: { type: String, required: false, maxLength: 100 }, // 运行进程所使用的命令
+  date: { type: String, required: false, maxLength: 100, default: moment().format('YYYY-MM-DD') }, // 运行进程所使用的命令
 };
 
 

+ 3 - 2
package.json

@@ -8,15 +8,16 @@
   },
   "dependencies": {
     "egg": "^2.15.1",
+    "egg-naf-amqp": "0.0.13",
     "egg-scripts": "^2.11.0",
     "jsonwebtoken": "^8.5.1",
     "lodash": "^4.17.15",
+    "moment": "^2.29.1",
     "naf-framework-mongoose": "^0.6.12",
     "query-lines-reader": "^0.2.3",
     "readline": "^1.3.0",
     "ssh2": "^0.8.9",
-    "ssh2shell": "^1.9.4",
-    "egg-naf-amqp": "0.0.13"
+    "ssh2shell": "^1.9.4"
   },
   "devDependencies": {
     "autod": "^3.0.1",