chore: 项目环境升级为 JDK25,Spring 4.1,项目重构为多模块
This commit is contained in:
14
web-ui/apps/web/index.html
Normal file
14
web-ui/apps/web/index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="color-scheme" content="light" />
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||||
<title>智造申报 Agent</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
21
web-ui/apps/web/package.json
Normal file
21
web-ui/apps/web/package.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "@manuagent/web",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"typecheck": "vue-tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.node.json",
|
||||
"dev": "vite --host 127.0.0.1",
|
||||
"build": "vite build"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "3.5.41",
|
||||
"vue-router": "^4.6.3",
|
||||
"element-plus": "2.14.5",
|
||||
"@element-plus/icons-vue": "^2.3.2",
|
||||
"markstream-vue": "2.0.6",
|
||||
"@manuagent/common": "0.1.0",
|
||||
"@manuagent/admin": "0.1.0",
|
||||
"@manuagent/agent": "0.1.0"
|
||||
}
|
||||
}
|
||||
4
web-ui/apps/web/public/favicon.svg
Normal file
4
web-ui/apps/web/public/favicon.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||
<rect width="32" height="32" rx="6" fill="#1769e8"/>
|
||||
<path d="M7 9h7l2 2h9v12H7z" fill="none" stroke="#fff" stroke-width="2" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 223 B |
35
web-ui/apps/web/src/App.vue
Normal file
35
web-ui/apps/web/src/App.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { Box, Folder, MagicStick } from '@element-plus/icons-vue'
|
||||
import { ProjectSidebar } from '@manuagent/agent'
|
||||
|
||||
const route = useRoute()
|
||||
const sidebar = ref<InstanceType<typeof ProjectSidebar> | null>(null)
|
||||
const isLogin = computed(() => route.path === '/login')
|
||||
const projectRoute = computed(() => route.path.startsWith('/projects'))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RouterView v-if="isLogin" />
|
||||
<div v-else class="app-shell">
|
||||
<nav class="rail" aria-label="主导航">
|
||||
<div class="brand"><Folder /></div>
|
||||
<RouterLink to="/projects" :class="{ active: projectRoute }" aria-label="项目">
|
||||
<Folder /><span>项目</span>
|
||||
</RouterLink>
|
||||
<RouterLink to="/models" :class="{ active: route.path === '/models' }" aria-label="模型">
|
||||
<Box /><span>模型</span>
|
||||
</RouterLink>
|
||||
<RouterLink to="/skills" :class="{ active: route.path === '/skills' }" aria-label="Skills">
|
||||
<MagicStick /><span>Skills</span>
|
||||
</RouterLink>
|
||||
</nav>
|
||||
|
||||
<ProjectSidebar v-if="projectRoute" ref="sidebar" />
|
||||
|
||||
<main class="main-view"><RouterView @projects-changed="sidebar?.loadProjects()" /></main>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
34
web-ui/apps/web/src/main.ts
Normal file
34
web-ui/apps/web/src/main.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { createApp } from 'vue'
|
||||
import {
|
||||
ElButton,
|
||||
ElDialog,
|
||||
ElForm,
|
||||
ElFormItem,
|
||||
ElIcon,
|
||||
ElInput,
|
||||
ElInputNumber,
|
||||
ElOption,
|
||||
ElRadioButton,
|
||||
ElRadioGroup,
|
||||
ElSelect,
|
||||
ElSwitch,
|
||||
ElTabPane,
|
||||
ElTabs,
|
||||
ElUpload
|
||||
} from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import 'markstream-vue/index.css'
|
||||
import '@manuagent/common/styles.css'
|
||||
import { setUnauthorizedHandler } from '@manuagent/common'
|
||||
import App from './App.vue'
|
||||
import { router } from './router'
|
||||
|
||||
setUnauthorizedHandler(() => location.assign('/login'))
|
||||
const app = createApp(App)
|
||||
for (const component of [
|
||||
ElButton, ElDialog, ElForm, ElFormItem, ElIcon, ElInput,
|
||||
ElInputNumber, ElOption, ElRadioButton, ElRadioGroup, ElSelect,
|
||||
ElSwitch, ElTabPane, ElTabs, ElUpload
|
||||
]) app.component(component.name!, component)
|
||||
app.use(router)
|
||||
void router.isReady().then(() => app.mount('#app'))
|
||||
11
web-ui/apps/web/src/router.ts
Normal file
11
web-ui/apps/web/src/router.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { agentRoutes } from '@manuagent/agent'
|
||||
|
||||
export const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: [
|
||||
{ path: '/login', component: () => import('@manuagent/admin').then(module => module.LoginPage), props: { destination: '/projects' }, meta: { public: true } },
|
||||
{ path: '/', redirect: '/projects' },
|
||||
...agentRoutes
|
||||
]
|
||||
})
|
||||
7
web-ui/apps/web/tsconfig.json
Normal file
7
web-ui/apps/web/tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.vue"
|
||||
]
|
||||
}
|
||||
11
web-ui/apps/web/tsconfig.node.json
Normal file
11
web-ui/apps/web/tsconfig.node.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"allowImportingTsExtensions": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
22
web-ui/apps/web/vite.config.ts
Normal file
22
web-ui/apps/web/vite.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
resolve: { dedupe: ['vue', 'vue-router'] },
|
||||
server: {
|
||||
port: 15173,
|
||||
proxy: {
|
||||
'/api': 'http://127.0.0.1:8080'
|
||||
}
|
||||
},
|
||||
build: {
|
||||
target: 'es2022',
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: { vue: ['vue', 'vue-router'] }
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user