update modules

This commit is contained in:
2025-11-24 17:49:16 +08:00
parent e5f46e8fe3
commit 8e3273d8f1
10 changed files with 2623 additions and 1649 deletions

View File

@@ -1,7 +0,0 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

View File

@@ -1,16 +1,14 @@
{
"name": "@kevisual/center",
"private": true,
"version": "0.0.11",
"version": "0.0.12",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build:sky": "cross-env CENTER_ENV=sky vite build",
"dev:kv": "cross-env VITE_USE_KV=true vite",
"lint": "eslint .",
"preview": "vite preview",
"pub": "envision deploy ./dist -k center -v 0.0.11 -u -o root",
"pub": "envision deploy ./dist -k center -v 0.0.12 -u",
"turbo:dev": "turbo dev:lib",
"dev:lib": "turbo dev:lib",
"dev:query": "turbo dev:lib --filter=@kevisual/query",
@@ -28,7 +26,6 @@
"@kevisual/components": "workspace:*",
"@kevisual/container": "1.0.0",
"@kevisual/query": "^0.0.29",
"@kevisual/query-config": "workspace:*",
"@kevisual/query-upload": "workspace:*",
"@kevisual/resources": "workspace:*",
"@monaco-editor/react": "^4.7.0",
@@ -69,7 +66,7 @@
"@types/node": "^24.10.1",
"@types/path-browserify": "^1.0.3",
"@types/qrcode": "^1.5.6",
"@types/react": "^19.2.6",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-basic-ssl": "^2.1.0",
"@vitejs/plugin-react": "^5.1.1",

View File

@@ -18,26 +18,26 @@
"type": "module",
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@kevisual/components": "workspace:*",
"@kevisual/query-upload": "workspace:*",
"@kevisual/router": "^0.0.22",
"@kevisual/router": "^0.0.33",
"@kevisual/store": "^0.0.9",
"@mui/material": "^7.1.1",
"@vitejs/plugin-basic-ssl": "^2.0.0",
"dayjs": "^1.11.13",
"immer": "^10.1.1",
"@mui/material": "^7.3.5",
"@vitejs/plugin-basic-ssl": "^2.1.0",
"dayjs": "^1.11.19",
"immer": "^11.0.0",
"lodash-es": "^4.17.21",
"lucide-react": "^0.516.0",
"nanoid": "^5.1.5",
"lucide-react": "^0.554.0",
"nanoid": "^5.1.6",
"nprogress": "^0.2.0",
"pretty-bytes": "^7.0.0",
"react": "19.1.0",
"react-datepicker": "^8.4.0",
"react-dom": "19.1.0",
"pretty-bytes": "^7.1.0",
"react": "19.2.0",
"react-datepicker": "^8.9.0",
"react-dom": "19.2.0",
"react-dropzone": "^14.3.8",
"react-toastify": "^11.0.5",
"zustand": "^5.0.5"
"zustand": "^5.0.8"
},
"devDependencies": {
"@kevisual/types": "^0.0.10",

4082
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,5 +2,7 @@ packages:
- packages/*
- '!packages/webshell/webshell-node'
- submodules/*
onlyBuiltDependencies:
- '@tailwindcss/oxide'
- esbuild

View File

@@ -86,7 +86,7 @@ export const useUserAppStore = create<UserAppStore>((set, get) => {
const res = await query.post({
path: 'user-app',
key: 'get',
id,
payload: { id }
});
if (res.code === 200) {
set({ userApp: res.data });

View File

@@ -1,7 +1,7 @@
import { create } from 'zustand';
import { query } from '@/modules/query';
import { toast } from 'react-toastify';
import { QueryConfig } from '@kevisual/query-config';
import { QueryConfig } from '@/query/query-config';
export const queryConfig = new QueryConfig({ query: query as any });
@@ -64,7 +64,7 @@ export const useConfigStore = create<ConfigStore>((set, get) => ({
},
onOpenKey: async (key: string) => {
const { setFormData, setShowEdit, getConfigList } = get();
const res = await queryConfig.getConfigByKey(key);
const res = await queryConfig.getConfigByKey(key as any);
if (res.code === 200) {
const data = res.data;
setFormData(data);

View File

@@ -0,0 +1,134 @@
import { Query } from '@kevisual/query';
import type { Result } from '@kevisual/query/query';
type QueryConfigOpts = {
query?: Query;
};
export type Config<T = any> = {
id?: string;
title?: string;
key?: string;
description?: string;
data?: T;
createdAt?: string;
updatedAt?: string;
};
export type UploadConfig = {
key?: string;
version?: string;
};
type PostOpts = {
token?: string;
};
export const defaultConfigKeys = ['upload.json', 'workspace.json', 'ai.json', 'user.json', 'vip.json'] as const;
type DefaultConfigKey = (typeof defaultConfigKeys)[number];
export class QueryConfig {
query: Query;
constructor(opts?: QueryConfigOpts) {
this.query = opts?.query || new Query();
}
async post<T = Config>(data: any) {
return this.query.post<T>({ path: 'config', ...data });
}
async getConfig({ id, key }: { id?: string; key?: string }, opts?: PostOpts) {
return this.post({
key: 'get',
data: {
id,
key,
},
...opts,
});
}
async updateConfig(data: Config, opts?: PostOpts) {
return this.post({
key: 'update',
data,
...opts,
});
}
async deleteConfig(id: string, opts?: PostOpts) {
return this.post({
key: 'delete',
data: { id },
});
}
async listConfig(opts?: PostOpts) {
return this.post<{ list: Config[] }>({
key: 'list',
...opts,
});
}
/**
* 获取上传配置
* @returns
*/
async getUploadConfig(opts?: PostOpts) {
return this.post<Result<Config<UploadConfig>>>({
key: 'getUploadConfig',
...opts,
});
}
/**
* 更新上传配置
* @param data
* @returns
*/
async updateUploadConfig(data: Config, opts?: PostOpts) {
return this.post<Result<Config<UploadConfig>>>({
key: 'updateUploadConfig',
data,
...opts,
});
}
/**
* 检测配置是否存在
* @param id
* @returns
*/
async detectConfig(opts?: PostOpts) {
return this.post<{ updateList: Config[] }>({
key: 'detect',
...opts,
});
}
/**
* 获取配置, 获取默认的配置项
* @param key
* @returns
*/
async getConfigByKey(key: DefaultConfigKey, opts?: PostOpts) {
return this.post<Result<Config>>({
key: 'defaultConfig',
configKey: key,
...opts,
});
}
}
/**
* 会员配置, 获取 admin 账户的配置项
*
*/
export class VipQueryConfig extends QueryConfig {
constructor(opts?: QueryConfigOpts) {
super(opts);
}
/**
* 获取会员配置, 是否开启会员,会员等级配置。
* 请求数量配置
* 资源上传配置
*
* @returns
*/
async getVipConfig() {
return this.post<Result<Config<UploadConfig>>>({
key: 'shareConfig',
data: {
type: 'vip',
username: 'root',
},
});
}
}

View File

@@ -6,11 +6,7 @@ const isDev = process.env.NODE_ENV === 'development';
const centerEnv = process.env.CENTER_ENV;
const plugins: any[] = [];
plugins.push(tailwindcss());
const devBackend = 'https://kevisual.silkyai.cn';
const meBackend = 'https://kevisual.xiongxiao.me';
// const meBackend = 'https://kevisual.cn';
// const backend = isDev ? devBackend : meBackend;
const backendWss = devBackend.replace(/^https:/, 'wss:');
const backend = meBackend;
let proxy = {};
if (true) {