fix: add manager config assistant-apps-config
This commit is contained in:
parent
1f4404fa5c
commit
6ef9e1218c
14
package.json
14
package.json
@ -24,9 +24,9 @@
|
||||
"deploy:sky": "rsync -avz --delete ./dist/ sky:~/kevisual/dist",
|
||||
"deploy:envision": "rsync -avz --delete ./dist/ envision:~/kevisual/dist",
|
||||
"clean": "rm -rf dist",
|
||||
"reload": "ssh light pm2 restart codecenter",
|
||||
"reload:sky": "ssh sky pm2 restart codecenter",
|
||||
"reload:envision": "ssh envision pm2 restart codecenter",
|
||||
"reload": "ssh light pm2 restart code-center",
|
||||
"reload:sky": "ssh sky pm2 restart code-center",
|
||||
"reload:envision": "ssh envision pm2 restart code-center",
|
||||
"pub:me": "npm run build && npm run deploy && npm run reload",
|
||||
"pub:sky": "npm run build && npm run deploy:sky && npm run reload:sky",
|
||||
"pub:envision": "npm run build && npm run deploy:envision && npm run reload:envision",
|
||||
@ -54,10 +54,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kevisual/code-center-module": "workspace:*",
|
||||
"@kevisual/local-app-manager": "0.1.19",
|
||||
"@kevisual/logger": "^0.0.3",
|
||||
"@kevisual/local-app-manager": "0.1.20",
|
||||
"@kevisual/logger": "^0.0.4",
|
||||
"@kevisual/oss": "workspace:*",
|
||||
"@kevisual/permission": "workspace:*",
|
||||
"@kevisual/permission": "^0.0.3",
|
||||
"@kevisual/router": "0.0.20",
|
||||
"@kevisual/types": "^0.0.10",
|
||||
"@kevisual/use-config": "^1.0.17",
|
||||
@ -108,7 +108,7 @@
|
||||
"turbo": "^2.5.3",
|
||||
"typescript": "^5.8.3",
|
||||
"uuid": "^11.1.0",
|
||||
"zod": "^3.25.1"
|
||||
"zod": "^3.25.7"
|
||||
},
|
||||
"resolutions": {
|
||||
"inflight": "latest",
|
||||
|
38
pnpm-lock.yaml
generated
38
pnpm-lock.yaml
generated
@ -39,17 +39,17 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:submodules/code-center-module
|
||||
'@kevisual/local-app-manager':
|
||||
specifier: 0.1.19
|
||||
version: 0.1.19
|
||||
specifier: 0.1.20
|
||||
version: 0.1.20
|
||||
'@kevisual/logger':
|
||||
specifier: ^0.0.3
|
||||
version: 0.0.3
|
||||
specifier: ^0.0.4
|
||||
version: 0.0.4
|
||||
'@kevisual/oss':
|
||||
specifier: workspace:*
|
||||
version: link:submodules/oss
|
||||
'@kevisual/permission':
|
||||
specifier: workspace:*
|
||||
version: link:submodules/permission
|
||||
specifier: ^0.0.3
|
||||
version: 0.0.3
|
||||
'@kevisual/router':
|
||||
specifier: 0.0.20
|
||||
version: 0.0.20
|
||||
@ -186,8 +186,8 @@ importers:
|
||||
specifier: ^11.1.0
|
||||
version: 11.1.0
|
||||
zod:
|
||||
specifier: ^3.25.1
|
||||
version: 3.25.1
|
||||
specifier: ^3.25.7
|
||||
version: 3.25.7
|
||||
|
||||
submodules/code-center-module:
|
||||
dependencies:
|
||||
@ -641,18 +641,21 @@ packages:
|
||||
'@kevisual/load@0.0.6':
|
||||
resolution: {integrity: sha512-+3YTFehRcZ1haGel5DKYMUwmi5i6f2psyaPZlfkKU/cOXgkpwoG9/BEqPCnPjicKqqnksEpixVRkyHJ+5bjLVA==}
|
||||
|
||||
'@kevisual/local-app-manager@0.1.19':
|
||||
resolution: {integrity: sha512-B5wzzN4DM2yNOLnJmXOSOvu+uNE7bv/CGV5fkgCE4X0JUGGx/vKgDUHwJnMg8kH7++knoic8QAjTEBwD5FhPzw==}
|
||||
'@kevisual/local-app-manager@0.1.20':
|
||||
resolution: {integrity: sha512-PQf1wL9vQazTYvxhTqnhno3ZYccFGmgjkPEqKUY9IUpc2vP7srX73TGn/3e7S5dysO1urzgif4dciGe0yPbxAg==}
|
||||
|
||||
'@kevisual/logger@0.0.1':
|
||||
resolution: {integrity: sha512-xxCWIhx48fsRZnh/zF9hW58v/vtJWUN7ZobpJiARFW3wgRpvZNAM6v66O2QuVkDoLfSm+M9wRxEJ7dlvcB4BPg==}
|
||||
|
||||
'@kevisual/logger@0.0.3':
|
||||
resolution: {integrity: sha512-8emqxg+ab62WAK6VY4FQqetXPSSVKFAjGctD1NDbdnxt7YWuI/PyuDltCpsVz+uvWpV1dO5OKZOoHU7ow59Omw==}
|
||||
'@kevisual/logger@0.0.4':
|
||||
resolution: {integrity: sha512-+fpr92eokSxoGOW1SIRl/27lPuO+zyY+feR5o2Q4YCNlAdt2x64NwC/w8r/3NEC5QenLgd4K0azyKTI2mHbARw==}
|
||||
|
||||
'@kevisual/mark@0.0.7':
|
||||
resolution: {integrity: sha512-PiEEy4yvWEpixw76PzgrIWeNelzm+FrhtzFmqJU92o5GkgawaFwighcvIxqcVZRKeEFF4uvlTjFrGeQvXw6F4A==}
|
||||
|
||||
'@kevisual/permission@0.0.3':
|
||||
resolution: {integrity: sha512-8JsA/5O5Ax/z+M+MYpFYdlioHE6jNmWMuFSokBWYs9CCAHNiSKMR01YLkoVDoPvncfH/Y8F5K/IEXRCbptuMNA==}
|
||||
|
||||
'@kevisual/rollup-tools@0.0.1':
|
||||
resolution: {integrity: sha512-TdCN+IU0fyHudiiqYvobXQ8r5MltfM/cKmSS59iopyL8YYwXwcipOS4S24NWA79g7uwJfSUNk5lg3yVhom79fQ==}
|
||||
hasBin: true
|
||||
@ -3496,6 +3499,9 @@ packages:
|
||||
zod@3.25.1:
|
||||
resolution: {integrity: sha512-bkxUGQiqWDTXHSgqtevYDri5ee2GPC9szPct4pqpzLEpswgDQmuseDz81ZF0AnNu1xsmnBVmbtv/t/WeUIHlpg==}
|
||||
|
||||
zod@3.25.7:
|
||||
resolution: {integrity: sha512-YGdT1cVRmKkOg6Sq7vY7IkxdphySKnXhaUmFI4r4FcuFVNgpCb9tZfNwXbT6BPjD5oz0nubFsoo9pIqKrDcCvg==}
|
||||
|
||||
snapshots:
|
||||
|
||||
'@babel/code-frame@7.26.2':
|
||||
@ -3647,7 +3653,7 @@ snapshots:
|
||||
dependencies:
|
||||
eventemitter3: 5.0.1
|
||||
|
||||
'@kevisual/local-app-manager@0.1.19':
|
||||
'@kevisual/local-app-manager@0.1.20':
|
||||
dependencies:
|
||||
pm2: 6.0.6
|
||||
transitivePeerDependencies:
|
||||
@ -3657,7 +3663,7 @@ snapshots:
|
||||
|
||||
'@kevisual/logger@0.0.1': {}
|
||||
|
||||
'@kevisual/logger@0.0.3': {}
|
||||
'@kevisual/logger@0.0.4': {}
|
||||
|
||||
'@kevisual/mark@0.0.7(dotenv@16.5.0)(esbuild@0.25.0)(sqlite3@5.1.7)':
|
||||
dependencies:
|
||||
@ -3685,6 +3691,8 @@ snapshots:
|
||||
- tedious
|
||||
- utf-8-validate
|
||||
|
||||
'@kevisual/permission@0.0.3': {}
|
||||
|
||||
'@kevisual/rollup-tools@0.0.1(esbuild@0.25.0)':
|
||||
dependencies:
|
||||
'@rollup/plugin-alias': 5.1.1(rollup@4.41.0)
|
||||
@ -6892,3 +6900,5 @@ snapshots:
|
||||
readable-stream: 4.5.2
|
||||
|
||||
zod@3.25.1: {}
|
||||
|
||||
zod@3.25.7: {}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { app } from '@/app.ts';
|
||||
import { AppModel } from '../module/index.ts';
|
||||
import { ConfigPermission } from '@kevisual/permission';
|
||||
|
||||
// curl http://localhost:4005/api/router?path=app&key=public-list
|
||||
// TODO:
|
||||
@ -9,15 +10,28 @@ app
|
||||
key: 'public-list',
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const list = await AppModel.findAll({
|
||||
const { username = 'root', status = 'running', page = 1, pageSize = 100, order = 'DESC' } = ctx.query.data || {};
|
||||
const { rows, count } = await AppModel.findAndCountAll({
|
||||
where: {
|
||||
status: 'running',
|
||||
status,
|
||||
user: username,
|
||||
},
|
||||
// attributes: {
|
||||
// exclude: ['data'],
|
||||
// },
|
||||
attributes: {
|
||||
exclude: [],
|
||||
},
|
||||
order: [['updatedAt', order]],
|
||||
limit: pageSize,
|
||||
offset: (page - 1) * pageSize,
|
||||
distinct: true,
|
||||
logging: false,
|
||||
});
|
||||
ctx.body = list;
|
||||
ctx.body = {
|
||||
list: rows.map((item) => {
|
||||
return ConfigPermission.getDataPublicPermission(item.toJSON());
|
||||
}),
|
||||
pagination: {
|
||||
total: count,
|
||||
},
|
||||
};
|
||||
})
|
||||
.addTo(app);
|
||||
|
@ -1,5 +1,9 @@
|
||||
// import { app } from '@/app.ts';
|
||||
import { manager, loadManager, app as ManagerApp } from '@kevisual/local-app-manager';
|
||||
import { fileIsExist } from '@kevisual/use-config/env';
|
||||
import path from 'path';
|
||||
const assistantAppsConfig = path.join(process.cwd(), 'assistant-apps-config.json');
|
||||
const isExist = fileIsExist(assistantAppsConfig);
|
||||
export const existDenpend = [
|
||||
'sequelize', // commonjs
|
||||
'pg', // commonjs
|
||||
@ -16,7 +20,11 @@ export { manager };
|
||||
// console.log('app', app, );
|
||||
// console.log('app2 context', global.context);
|
||||
// console.log('app equal', app === ManagerApp);
|
||||
if (!isExist) {
|
||||
loadManager({ runtime: 'server', configFilename: 'assistant-apps-config.json' });
|
||||
} else {
|
||||
loadManager({ runtime: 'server' });
|
||||
}
|
||||
|
||||
// middleware: ['auth-admin']
|
||||
/*
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit f8e2f74d5e4ac68e2a78db66b25246074f2675bd
|
||||
Subproject commit dc56548cdfeb48f17781f27183c02b20402f038f
|
Loading…
x
Reference in New Issue
Block a user