@kne/fastify-app-manager 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/libs/services/app.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -589,6 +589,8 @@ data: {"progressId":"p-1","step":"ready","status":"done","detail":null,"message"
|
|
|
589
589
|
|
|
590
590
|
返回脱敏后的应用对象,另带 `deployment`:最近一次部署尚未结束(未出错、就绪阶段未完成)时为 `{ progressId, versionId, version, startedAt, step, detail }`,否则为 `null`。准备部署包阶段应用仍是旧的 `status` 与 `currentVersionId`,用它判断哪个版本正在部署。`app/list` 的每个元素同样带该字段。
|
|
591
591
|
|
|
592
|
+
详情另带 `pm2Defaults`:宿主生效的全局 PM2 默认(即插件选项 `pm2Defaults`),供管理端展示应用 `pm2Config` 未覆盖项的实际取值。
|
|
593
|
+
|
|
592
594
|
##### POST `{prefix}/app/start` | `stop` | `restart` | `remove`
|
|
593
595
|
|
|
594
596
|
| 参数名 | 类型 | 必填 | 说明 |
|
package/libs/services/app.js
CHANGED
|
@@ -296,7 +296,11 @@ module.exports = fp(async (fastify, options) => {
|
|
|
296
296
|
|
|
297
297
|
const detail = async ({ name }) => {
|
|
298
298
|
const app = await getByName(name);
|
|
299
|
-
return Object.assign(toPublicApp(app), {
|
|
299
|
+
return Object.assign(toPublicApp(app), {
|
|
300
|
+
pm2Defaults: options.pm2Defaults || {},
|
|
301
|
+
deployment: deployProgress.active(app.name),
|
|
302
|
+
lastDeployment: await lastDeployment(app.name)
|
|
303
|
+
});
|
|
300
304
|
};
|
|
301
305
|
|
|
302
306
|
const versionSqlDir = ver => path.join(ver.artifactPath, 'server', ver.migrationPath || options.sqlPath || 'sql');
|