temp: add eco

This commit is contained in:
2024-12-03 23:22:39 +08:00
parent eba5e4988e
commit a5d0e66b3c
12 changed files with 149 additions and 93 deletions

View File

@@ -18,11 +18,15 @@ app
const file = files[0];
console.log('File', files);
const { path, name, hash, size } = file;
const tags = [];
if (collection?.tags) {
tags.push(...collection.tags);
}
const microApp = await MicroAppModel.create({
title: name,
description: '',
description: collection?.readme || '',
type: 'micro-app',
tags: [],
tags: tags,
data: {
file: {
path,
@@ -52,7 +56,7 @@ app
description: 'Deploy micro app',
})
.define(async (ctx) => {
const { id, key} = ctx.query?.data;
const { id, key } = ctx.query?.data;
// const id = '10f03411-85fc-4d37-a4d3-e32b15566a6c';
// const key = 'envision-cli';
// const id = '7c54a6de-9171-4093-926d-67a035042c6c';

View File

@@ -8,9 +8,10 @@ type MicroAppData = {
path: string;
size: number;
hash: string;
name: string;
};
data?: any;
collection?: any;
collection?: any; // 上传的信息汇总
};
export class MicroAppModel extends Model {
declare id: string;

View File

@@ -36,6 +36,11 @@ export const deleteFileAppInfo = async (key: string) => {
fs.rmSync(directory, { recursive: true });
};
/**
* @deprecated
* @param key
* @returns
*/
export const loadApp = async (key: string) => {
const { mainEntry, app } = await loadFileAppInfo(key);
// 1. 查询数据库获取app信息查看是否运行中

View File

@@ -1,4 +1,4 @@
import { getSession } from '@/app.ts';
import { getSession } from '@/modules/neo4j.ts';
export async function fetchData() {
const session = getSession();
try {