Compare commits
106 Commits
324d47891f
...
feature/wo
| Author | SHA1 | Date | |
|---|---|---|---|
| 10519e7500 | |||
| 79d0a2a9fe | |||
| 20bf8138a8 | |||
| 1c0e966b7a | |||
| 57ca523b5a | |||
| f72508aa83 | |||
| 61577be41f | |||
| 1baef251ab | |||
| b25a1457af | |||
| 85845b0d38 | |||
| 075bf22add | |||
| 52340fcd94 | |||
| 10d6ce2b0d | |||
| 58d5713ec1 | |||
| cb6c881365 | |||
| ffaf04982a | |||
| 28d81d86bd | |||
| 0b958a0ebb | |||
| c13e01c902 | |||
| c8ad78ab44 | |||
| 04a8912307 | |||
| 495fde42ca | |||
| 5363613a7d | |||
| fc54bcd3d6 | |||
| 4a8bc3cb7a | |||
| 367cd98018 | |||
| ee8ba0a5d9 | |||
| 56e1517743 | |||
| eea5874dbf | |||
| 6ef063ac09 | |||
| c37710af3d | |||
| c52d31c16e | |||
| 48a4636a81 | |||
| 9c03013c44 | |||
| 05a0e35891 | |||
| 937d1e9373 | |||
| af3f0678b8 | |||
| 68d9767bd8 | |||
| ccbf6de863 | |||
| d3a315525e | |||
| 38e15ed562 | |||
| c7fba23e3b | |||
| b60583008b | |||
| 542895c61c | |||
| 538e153473 | |||
| 78d1fd93c8 | |||
| 032f258912 | |||
| 9bd4a44ab6 | |||
| 4174c424fc | |||
| 0d946c050e | |||
| 95f020047d | |||
| 7fe519df28 | |||
| f0e36381d3 | |||
| 2c4d52ef63 | |||
| ded04de609 | |||
| 5152121c33 | |||
| 470474c189 | |||
| bf5635f8e3 | |||
| 7903c0c133 | |||
| 694577f2a6 | |||
| 6db7f5ed8c | |||
| 3bf2732906 | |||
| 4cade1ab94 | |||
| 27de8213f2 | |||
| a48924d27c | |||
| a64dd22538 | |||
| 2c435446c4 | |||
| d6d5cba95a | |||
| 885ea3e743 | |||
| b941ab73ed | |||
| 72134d6004 | |||
| f5ff8164a9 | |||
| 12d091d366 | |||
| 5771e196f9 | |||
| 5e9553d43b | |||
| 3370dde8cb | |||
| 5ec36b5b15 | |||
| dedabb332e | |||
| 61a6c143ad | |||
| a8fb18a3e5 | |||
| 172659369c | |||
| c327ad6c1d | |||
| 354ab26232 | |||
| 274b921b9a | |||
| 9cab1b2fcf | |||
| 887d681bbf | |||
| c93f651bf4 | |||
| cda75d1e6d | |||
| 7316d551ce | |||
| 301b03e97f | |||
| cd6e56e09d | |||
| aa3a609783 | |||
| bcef0f9bc1 | |||
| e9d088fa8d | |||
| 86a7ff1573 | |||
| cb7e36ad03 | |||
| 7c60e34de0 | |||
| 38166cb0b8 | |||
| ce70f86000 | |||
| e357f93779 | |||
| 010db1e7bc | |||
| f4626987f1 | |||
| b1ba7f9e13 | |||
| 672258d486 | |||
| 3b1e6ac061 | |||
| d3322323ac |
@@ -38,10 +38,10 @@ module.exports = {
|
||||
'@typescript-eslint/no-redeclare': 'error',
|
||||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
'warn',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_|props|watch',
|
||||
caughtErrorsIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
@@ -64,6 +64,11 @@ module.exports = {
|
||||
'vue/no-parsing-error': 'off',
|
||||
'vue/no-deprecated-v-on-native-modifier': 'off',
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'vue/no-reserved-component-names': 'off',
|
||||
'vue/no-v-for-template-key': 'off',
|
||||
'vue/no-unused-vars': 'off',
|
||||
'vue/no-mutating-props': 'off',
|
||||
'no-mixed-spaces-and-tabs': 'off',
|
||||
'no-useless-escape': 'off',
|
||||
'no-sparse-arrays': 'off',
|
||||
'no-prototype-builtins': 'off',
|
||||
@@ -77,8 +82,8 @@ module.exports = {
|
||||
'no-unused-vars': 'off',
|
||||
'no-v-model-argument': 'off',
|
||||
'no-case-declarations': 'off',
|
||||
'no-console': 'error',
|
||||
'no-debugger': 'error',
|
||||
'no-console': 'off',
|
||||
'no-debugger': 'warn',
|
||||
'no-redeclare': 'off',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,47 +1,18 @@
|
||||
name: 全局K3s部署
|
||||
name: 部署 admin-ui 到 K3s
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
K3S_HOST: 121.37.117.181
|
||||
APP_NAME: ${{ gitea.repo_name }}
|
||||
REGISTRY: 你的镜像仓库地址 # 比如 docker.io/你的用户名
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: 拉取代码
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# 1. 初始化 Docker Buildx
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# 2. 登录镜像仓库(按需)
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PWD }}
|
||||
|
||||
# 3. 构建+推送,启用缓存
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ env.REGISTRY }}/${{ env.APP_NAME }}:${{ gitea.sha }}
|
||||
# 缓存配置:推送到镜像仓库
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.APP_NAME }}:buildcache
|
||||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.APP_NAME }}:buildcache,mode=max
|
||||
|
||||
# 4. 你原来的 SSH 部署步骤不变
|
||||
- name: SSH部署K3s
|
||||
- name: 部署到 K3s
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.K3S_PEM_KEY }}" > k3s.pem
|
||||
chmod 600 k3s.pem
|
||||
ssh -i k3s.pem -o StrictHostKeyChecking=no root@${K3S_HOST} << CMD
|
||||
kubectl apply -f /k8s/deploy.yaml
|
||||
kubectl rollout restart deployment ${APP_NAME}
|
||||
CMD
|
||||
kubectl apply -f k8s/
|
||||
kubectl rollout restart deployment admin-ui
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,8 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
# Vue language service / accidental transpile artifacts
|
||||
src/**/*.vue.js
|
||||
|
||||
|
||||
|
||||
230
CLAUDE.md
Normal file
230
CLAUDE.md
Normal file
@@ -0,0 +1,230 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
This is the **GFast UI** project (`gfast-ui`), a Vue 3 admin management system based on the vue-next-admin template, customized for a digital advertising/trading platform.
|
||||
|
||||
## Commands
|
||||
|
||||
- `npm install` - Install dependencies (use `npm install --registry=https://registry.npmmirror.com` for China mainland)
|
||||
- `npm run dev` - Start development server
|
||||
- `npm run build` - Build for production
|
||||
- `npm run lint` - Run ESLint check
|
||||
- `npm run lint-fix` - Fix ESLint issues automatically
|
||||
- `npm run type-check` - Run TypeScript type checking
|
||||
- `npm run quality` - Run both lint and type-check
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
**Tech Stack:**
|
||||
- Vue 3 with Composition API (script setup)
|
||||
- TypeScript
|
||||
- Vite
|
||||
- Element Plus (UI framework)
|
||||
- Pinia (state management)
|
||||
- Vue Router (with hash mode)
|
||||
- Axios (HTTP client)
|
||||
- i18n (internationalization)
|
||||
- mitt (event bus)
|
||||
|
||||
**Directory Structure:**
|
||||
- `src/api/` - API client methods organized by business domain (ads, assets, cid, customerService, digitalHuman, knowledge, login, menu, settings, system, etc.)
|
||||
- `src/components/` - Reusable Vue components
|
||||
- `src/directives/` - Custom Vue directives
|
||||
- `src/i18n/` - Internationalization configuration
|
||||
- `src/layout/` - Main layout components
|
||||
- `src/router/` - Route configuration
|
||||
- `index.ts` - Router setup and guard
|
||||
- `backEnd.ts` - Backend-controlled route initialization
|
||||
- `frontEnd.ts` - Frontend-controlled route initialization
|
||||
- `route.ts` - Static route definitions
|
||||
- `src/stores/` - Pinia state stores
|
||||
- `themeConfig.ts` - Theme and global configuration
|
||||
- `userInfo.ts` - User information
|
||||
- `routesList.ts` - Dynamic route management
|
||||
- `keepAliveNames.ts` - keep-alive cache management
|
||||
- `src/theme/` - Theme related styles
|
||||
- `src/types/` - TypeScript type definitions
|
||||
- `src/utils/` - Utility functions
|
||||
- `request.ts` - Axios instance with interceptors, error handling, and token management
|
||||
- `storage.ts` - Session storage wrapper
|
||||
- `gfast.ts` - GFast-specific helpers (file URL construction, tree building, date formatting)
|
||||
- `diffUtils.ts` - Field change detection for PUT requests
|
||||
- `src/views/` - Page components organized by business module
|
||||
|
||||
**Key Patterns:**
|
||||
|
||||
1. **Routing**: Supports both frontend and backend controlled routing. When backend control is enabled (`isRequestRoutes: true` in themeConfig), routes are fetched from the backend and dynamically added.
|
||||
|
||||
2. **API Requests**:
|
||||
- API methods are organized by domain in `src/api/` (each subdomain has its own directory structure)
|
||||
- The Axios instance in `src/utils/request.ts` is pre-configured with:
|
||||
- 50 second request timeout
|
||||
- `qs` serialization of query parameters with dot notation for nested objects
|
||||
- Automatically adds Bearer token (from cookies via Session utility) to all requests
|
||||
- Automatically sends only changed fields for PUT requests (diff comparison with original data via `_originalData` field)
|
||||
- Handles token expiration globally with redirect to login (prevents multiple overlapping popups)
|
||||
- Provides error message extraction from multiple response formats (`message`, `msg`, `error`, `detail`)
|
||||
- Error throttling: maximum one error message every 2 seconds
|
||||
- Supports error mode configuration via `requestOptions.errorMode`:
|
||||
- `global`: (default) Global error popup with backend message
|
||||
- `page`: No automatic popup, reject the error for page-level handling
|
||||
- `silent`: Completely silent, no error display
|
||||
- Special handling for `code === 402`: Triggers module not enabled subscription flow (except for specific asset endpoints)
|
||||
- Response format expects `code`, `message`/`msg`, and data. Known success codes: `0`, `200`.
|
||||
- Use `getApiErrorMessage(error)` from `/@/utils/request` to extract user-friendly error messages in catch blocks when using `page` or `silent` mode.
|
||||
|
||||
3. **Global Properties & Components**:
|
||||
- Helpers registered globally for template use:
|
||||
- `getUpFileUrl`, `handleTree`, `useDict`, `selectDictLabel`, `parseTime`, `getItems`, `setItems`, `getOptionValue`, `isEmpty`
|
||||
- Global components:
|
||||
- `pagination` - Reusable pagination component
|
||||
- Global plugins registered:
|
||||
- `vue-simple-uploader` - Large file upload component
|
||||
- Global event bus via mitt: `app.config.globalProperties.mittBus`
|
||||
|
||||
4. **Authentication**:
|
||||
- Token is stored in cookies via `js-cookie` (through the `Session` utility). Other user session data is stored in `sessionStorage`.
|
||||
- The `Session.clearAuth()` method only clears authentication-related keys (`token`, `userInfo`, `userMenu`, `permissions`), preserving other local preferences.
|
||||
- 401 responses (HTTP or business code) containing token expiration signals trigger automatic logout with a single confirmation popup.
|
||||
|
||||
5. **Keep-alive**: Route components can be cached via keep-alive, managed by the `useKeepALiveNames` store.
|
||||
|
||||
## Repository Collaboration Rules
|
||||
|
||||
These rules capture long-term repository preferences confirmed by the user and should be applied in future sessions unless the user explicitly overrides them.
|
||||
|
||||
### Pagination Rules
|
||||
|
||||
- Prefer the project global `pagination` component by default.
|
||||
- Pagination should be fixed and visible as part of the page or dialog layout, not conditionally hidden only because the dataset is small.
|
||||
- In single-page scenarios, the UI should still show total count together with the pagination area.
|
||||
- Avoid designs where pagination only appears after data exceeds one page.
|
||||
|
||||
### Dialog Layout Rules
|
||||
|
||||
- For dialogs that contain searchable tabular data, prefer this structure:
|
||||
1. search area
|
||||
2. table/content area
|
||||
3. pagination area placed under the table inside the dialog body
|
||||
4. footer action buttons
|
||||
- The pagination area should remain visually stable and should not be omitted just because the current result set is small.
|
||||
|
||||
### Theme and Style Rules
|
||||
|
||||
- When functionality and existing theme style conflict, prioritize making the feature clearly visible and usable first.
|
||||
- After ensuring usability, align the implementation with the repository's existing theme and style system as much as possible.
|
||||
- Be cautious about global theme styles that may affect local pagination, dialog, or table layouts.
|
||||
|
||||
### Problem-solving Workflow
|
||||
|
||||
- For repeated UI issues, analyze in this order:
|
||||
1. interface/request data and returned structure
|
||||
2. component logic and render conditions
|
||||
3. theme and style coverage/conflicts
|
||||
4. then decide whether a rewrite is necessary
|
||||
- Do not jump straight to a rewrite before checking interface behavior and style interference.
|
||||
|
||||
### Execution Workflow Rules
|
||||
|
||||
- When modifying a feature, locate it in this order: usage location, component definition, API definition, then at least one similar implementation in the project.
|
||||
- For common UI features such as pagination, dialogs, and tables, align with an existing similar implementation before making changes.
|
||||
- Prefer componentization. If a page or Vue SFC is already large, or a block has a clear independent responsibility, split it into components instead of continuing to extend the same file.
|
||||
- For very long files such as complex page-level `index.vue` files, treat further component splitting as the default direction rather than the exception.
|
||||
- Before editing large files or complex Vue SFCs, first read the target context; if a replacement fails once, do not repeat the same replacement blindly, and instead expand the context or switch to smaller targeted edits.
|
||||
- After UI or interaction changes, verify not only lint status for edited files but also render conditions, interface fields, and possible style impact.
|
||||
- If the same issue is not resolved after one attempt, pause and ask the user before continuing with more speculative changes.
|
||||
- Do not proactively rewrite a component unless the user explicitly asks for a rewrite.
|
||||
- At the start of a new conversation, read `CLAUDE.md` before making changes.
|
||||
- When code changes appear not to take effect, check in this order: compile/HMR status, render conditions, API data, then style overrides.
|
||||
- Turn repeated low-level mistakes into explicit workflow checks and follow those checks in future edits.
|
||||
|
||||
### Environment and Tool Selection Rules
|
||||
|
||||
- Before running environment-dependent commands, first follow the known runtime context already provided by the IDE, such as OS and default shell.
|
||||
- On Windows projects with PowerShell as the active shell, prefer PowerShell-native commands and scripts by default.
|
||||
- Do not assume Python, bash, sed, awk, or other non-default tooling is installed locally unless the user or repository explicitly indicates that they are available.
|
||||
- For reading and editing repository files, prefer dedicated file tools first; use shell-based text replacement only when file tools are not suitable for the change.
|
||||
- When a replacement fails once, do not keep retrying the same method blindly. Re-read the exact target content and switch to a smaller or more reliable edit strategy that matches the current environment.
|
||||
- Avoid trial-and-error probing for basic tooling when the available environment is already known from context.
|
||||
|
||||
### Componentization and Structure Rules
|
||||
|
||||
- If a view block has an independent responsibility, prefer extracting it into a component instead of keeping it inside a large page file.
|
||||
- When a file is already long, or a new feature would further expand responsibilities, proactively split it into components.
|
||||
- Child components may keep their own local logic when that logic belongs clearly to the child’s responsibility; only shared state and necessary events should stay in the parent.
|
||||
- For complex pages, small-scale components can stay in `component/`, while larger feature areas may be grouped by responsibility in subdirectories.
|
||||
- For very long page files, prefer keeping the parent focused on composition, state orchestration, and data flow, while moving feature UI and local behavior into child components.
|
||||
- When extracting new child components from a large file, move their related local styles with them to avoid continued growth of the parent file.
|
||||
|
||||
### API and Data Handling Rules
|
||||
|
||||
- Follow the project’s common response structure by default, but add moderate component-side compatibility handling when equivalent APIs return slightly inconsistent fields.
|
||||
- For page-level error handling, use global handling by default, but use page-level or silent handling when the interaction requires local control.
|
||||
- Prefer a unified parameter-building entry for request params instead of assembling the same parameters across multiple functions.
|
||||
|
||||
### Form and Interaction Rules
|
||||
|
||||
- Follow the project’s existing form behavior style: required fields should be clearly validated on submit, while avoiding unnecessarily disruptive validation during input.
|
||||
- For shared create/edit forms, initialize, patch, and reset form state through a unified initialization path to avoid stale state.
|
||||
- Search interactions should behave consistently across button click, Enter key, and clear actions, and should reset to the first page by default.
|
||||
|
||||
### Dialog and Selector Rules
|
||||
|
||||
- Dialogs should clear temporary internal state on close by default; any state that needs to persist should be explicitly provided back by the parent.
|
||||
- Selector components should follow a consistent pattern: `v-model` for visibility, a default value prop, and a `confirm` event for returning the selected result.
|
||||
- For temporary selectors and lightweight dialogs, prefer `destroy-on-close`; for more complex stateful forms, decide deliberately rather than applying it blindly.
|
||||
|
||||
### Styling Rules
|
||||
|
||||
- Prefer local scoped style changes first; only modify global theme styles after confirming the issue is truly shared across multiple places.
|
||||
- When overriding Element Plus internals, prefer local `:deep()` overrides before considering global style changes.
|
||||
- Use semantic, area-based class names instead of short or overly generic names.
|
||||
|
||||
### Debugging and Validation Rules
|
||||
|
||||
- Minimal temporary debugging is allowed when necessary, but all temporary debugging code must be removed before final delivery.
|
||||
- Temporary `console` output is acceptable only when debugging is genuinely needed and must be removed before final delivery.
|
||||
- For UI and interaction changes, verify lint, key render conditions, interface fields, and style impact before considering the task complete.
|
||||
|
||||
### Change Scope and Consistency Rules
|
||||
|
||||
- Prefer the smallest necessary change set, but do not pretend a local-only fix is sufficient when the real root cause is elsewhere in the chain.
|
||||
- Only fix nearby issues when they are strongly related to the current task; otherwise ask the user before expanding the scope.
|
||||
- Within the current modification scope, move code toward repository rules when practical, but avoid broad unrelated refactors.
|
||||
|
||||
### Communication and Risk Rules
|
||||
|
||||
- 默认使用中文进行回复、说明、提问与思考表达;如果用户明确要求使用其他语言,再按用户要求切换。
|
||||
- Before changing code, confirm with the user when a change involves a rewrite, global side effects, unclear requirements, or a second attempt that still has not solved the issue.
|
||||
- After changes, explain what changed, why it was changed that way, and any remaining risks or points worth confirming.
|
||||
- When a requirement still depends on a meaningful assumption, ask the user first instead of silently choosing a direction.
|
||||
|
||||
### Repository Memory Rules
|
||||
|
||||
- When collaboration reveals a repeated problem pattern, proactively suggest turning it into an explicit repository rule in `CLAUDE.md`.
|
||||
- Project-specific experience or pitfall notes may be added when they become necessary, but do not expand them prematurely without clear recurring value.
|
||||
|
||||
### Rule Documentation Style
|
||||
|
||||
- Keep long-term repository rules concise and practical.
|
||||
- Prefer short rule lists with a small amount of explanation over overly long documentation.
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- `.env.development` - Development environment settings
|
||||
- `.env.production` - Production environment settings
|
||||
- `VITE_API_URL` - Backend API base URL
|
||||
- `VITE_PORT` - Dev server port
|
||||
- `VITE_PUBLIC_PATH` - Public base path for production build
|
||||
- `VITE_OPEN_CDN` - Enable CDN for external dependencies
|
||||
|
||||
## Development Notes
|
||||
|
||||
- The project uses `/@` alias for `src/`
|
||||
- Components use the Composition API with `<script setup lang="ts">`
|
||||
- Styling is done with SCSS
|
||||
- ESLint enforces code quality
|
||||
- Node version requirement: `>=16.0.0` (supported: v16.x ~ v20.x)
|
||||
10
Dockerfile
10
Dockerfile
@@ -1,12 +1,6 @@
|
||||
FROM gitea/gitea:latest
|
||||
# 拷贝预设工作流模板到容器内仓库模板目录
|
||||
COPY ./workflow_template/.gitea /data/gitea/templates/repo/.gitea
|
||||
|
||||
# ==================== 第一阶段:构建前端 ====================
|
||||
FROM node:18-alpine AS builder
|
||||
|
||||
FROM docker.m.daocloud.io/node:18-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# 配置Alpine国内镜像源
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
@@ -19,7 +13,7 @@ COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# ==================== 第二阶段:部署到Nginx ====================
|
||||
FROM nginx:alpine
|
||||
FROM docker.m.daocloud.io/nginx:alpine
|
||||
|
||||
# 复制构建产物
|
||||
COPY --from=builder /app/dist/ /usr/share/nginx/html/
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
FROM node:18-alpine
|
||||
|
||||
# 配置Alpine国内镜像源(加速apk)
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install --registry=https://registry.npmmirror.com
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["npm", "run", "dev"]
|
||||
26
k8s/deployment.yaml
Normal file
26
k8s/deployment.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: admin-ui
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: admin-ui
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: admin-ui
|
||||
spec:
|
||||
containers:
|
||||
- name: admin-ui
|
||||
image: 116.204.74.41:3000/red-future/admin-ui:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 80
|
||||
- containerPort: 443
|
||||
resources:
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
20
k8s/ingress.yaml
Normal file
20
k8s/ingress.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: admin-ui
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||||
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
|
||||
spec:
|
||||
tls:
|
||||
- secretName: admin-ui-tls
|
||||
rules:
|
||||
- http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: admin-ui
|
||||
port:
|
||||
number: 443
|
||||
15
k8s/service.yaml
Normal file
15
k8s/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: admin-ui
|
||||
spec:
|
||||
selector:
|
||||
app: admin-ui
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 80
|
||||
- name: https
|
||||
port: 443
|
||||
targetPort: 443
|
||||
type: ClusterIP
|
||||
91
ngnix.conf
91
ngnix.conf
@@ -1,4 +1,25 @@
|
||||
# Nginx 静态文件服务 + 智能代理
|
||||
# Nginx 静态文件服务 + 智能代理 + 自定义 404 页面
|
||||
|
||||
# Gitea 域名转发(HTTP)
|
||||
server {
|
||||
listen 80;
|
||||
server_name gitea.redpowerfuture.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
# MinIO 域名转发(HTTP)
|
||||
server {
|
||||
listen 80;
|
||||
server_name minio.redpowerfuture.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
# HTTP 重定向到 HTTPS(其他域名)
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
# 静态资源根目录(dist)
|
||||
@@ -7,16 +28,32 @@ server {
|
||||
|
||||
# SSL 配置
|
||||
listen 443 ssl;
|
||||
ssl_certificate /etc/nginx/ssl/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
|
||||
ssl_certificate /etc/nginx/ssl/scs1779764972146_redpowerfuture.com_server.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/scs1779764972146_redpowerfuture.com_server.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
# 自定义 404 页面,保持 404 状态码
|
||||
error_page 404 /404.html;
|
||||
|
||||
location = /404.html {
|
||||
internal;
|
||||
}
|
||||
|
||||
# 根路径默认进入网页端
|
||||
location = / {
|
||||
return 302 /web/index.html;
|
||||
}
|
||||
|
||||
# 兼容无斜杠访问
|
||||
location = /web {
|
||||
return 302 /web/;
|
||||
}
|
||||
|
||||
location = /sys {
|
||||
return 302 /sys/;
|
||||
}
|
||||
|
||||
# 网页端(public/web/index.html -> dist/web/index.html)
|
||||
location /web/ {
|
||||
alias /usr/share/nginx/html/web/;
|
||||
@@ -26,7 +63,7 @@ server {
|
||||
# 后台管理端(dist/index.html,前缀 /sys/)
|
||||
location /sys/ {
|
||||
alias /usr/share/nginx/html/;
|
||||
try_files $uri $uri/ /sys/index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# 1. 先尝试作为静态文件查找
|
||||
@@ -53,3 +90,49 @@ server {
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
# Gitea 域名转发(HTTPS)
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name gitea.redpowerfuture.com;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/gitea.redpowerfuture.com.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/gitea.redpowerfuture.com.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
proxy_pass http://gitea.redpowerfuture.com:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
# MinIO 域名转发(HTTPS)
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name minio.redpowerfuture.com;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/minio.redpowerfuture.com.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/minio.redpowerfuture.com.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
proxy_pass http://minio.redpowerfuture.com:9000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
201
package-lock.json
generated
201
package-lock.json
generated
@@ -14,6 +14,10 @@
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@logicflow/core": "^2.2.1",
|
||||
"@logicflow/extension": "^2.2.1",
|
||||
"@vue-flow/background": "^1.3.2",
|
||||
"@vue-flow/controls": "^1.1.3",
|
||||
"@vue-flow/core": "^1.48.2",
|
||||
"@vue-flow/minimap": "^1.5.4",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"axios": "1.8.2",
|
||||
"codemirror": "^6.0.1",
|
||||
@@ -2243,6 +2247,98 @@
|
||||
"vscode-uri": "^3.0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue-flow/background": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@vue-flow/background/-/background-1.3.2.tgz",
|
||||
"integrity": "sha512-eJPhDcLj1wEo45bBoqTXw1uhl0yK2RaQGnEINqvvBsAFKh/camHJd5NPmOdS1w+M9lggc9igUewxaEd3iCQX2w==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@vue-flow/core": "^1.23.0",
|
||||
"vue": "^3.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue-flow/controls": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@vue-flow/controls/-/controls-1.1.3.tgz",
|
||||
"integrity": "sha512-XCf+G+jCvaWURdFlZmOjifZGw3XMhN5hHlfMGkWh9xot+9nH9gdTZtn+ldIJKtarg3B21iyHU8JjKDhYcB6JMw==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@vue-flow/core": "^1.23.0",
|
||||
"vue": "^3.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue-flow/core": {
|
||||
"version": "1.48.2",
|
||||
"resolved": "https://registry.npmjs.org/@vue-flow/core/-/core-1.48.2.tgz",
|
||||
"integrity": "sha512-raxhgKWE+G/mcEvXJjGFUDYW9rAI3GOtiHR3ZkNpwBWuIaCC1EYiBmKGwJOoNzVFgwO7COgErnK7i08i287AFA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vueuse/core": "^10.5.0",
|
||||
"d3-drag": "^3.0.0",
|
||||
"d3-interpolate": "^3.0.1",
|
||||
"d3-selection": "^3.0.0",
|
||||
"d3-zoom": "^3.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue-flow/core/node_modules/@types/web-bluetooth": {
|
||||
"version": "0.0.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
|
||||
"integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@vue-flow/core/node_modules/@vueuse/core": {
|
||||
"version": "10.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.11.1.tgz",
|
||||
"integrity": "sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/web-bluetooth": "^0.0.20",
|
||||
"@vueuse/metadata": "10.11.1",
|
||||
"@vueuse/shared": "10.11.1",
|
||||
"vue-demi": ">=0.14.8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antfu"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue-flow/core/node_modules/@vueuse/metadata": {
|
||||
"version": "10.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.11.1.tgz",
|
||||
"integrity": "sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antfu"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue-flow/core/node_modules/@vueuse/shared": {
|
||||
"version": "10.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.11.1.tgz",
|
||||
"integrity": "sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"vue-demi": ">=0.14.8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antfu"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue-flow/minimap": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@vue-flow/minimap/-/minimap-1.5.4.tgz",
|
||||
"integrity": "sha512-l4C+XTAXnRxsRpUdN7cAVFBennC1sVRzq4bDSpVK+ag7tdMczAnhFYGgbLkUw3v3sY6gokyWwMl8CDonp8eB2g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"d3-selection": "^3.0.0",
|
||||
"d3-zoom": "^3.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue-flow/core": "^1.23.0",
|
||||
"vue": "^3.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-core": {
|
||||
"version": "3.5.25",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.25.tgz",
|
||||
@@ -2950,6 +3046,111 @@
|
||||
"node": ">=0.12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-color": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
|
||||
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-dispatch": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
|
||||
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-drag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
|
||||
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-selection": "3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-ease": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
|
||||
"integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-interpolate": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
|
||||
"integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-color": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-selection": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
|
||||
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-timer": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
|
||||
"integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-transition": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz",
|
||||
"integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-color": "1 - 3",
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-ease": "1 - 3",
|
||||
"d3-interpolate": "1 - 3",
|
||||
"d3-timer": "1 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"d3-selection": "2 - 3"
|
||||
}
|
||||
},
|
||||
"node_modules/d3-zoom": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",
|
||||
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"d3-dispatch": "1 - 3",
|
||||
"d3-drag": "2 - 3",
|
||||
"d3-interpolate": "1 - 3",
|
||||
"d3-selection": "2 - 3",
|
||||
"d3-transition": "2 - 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/dayjs": {
|
||||
"version": "1.11.19",
|
||||
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@logicflow/core": "^2.2.1",
|
||||
"@logicflow/extension": "^2.2.1",
|
||||
"@vue-flow/background": "^1.3.2",
|
||||
"@vue-flow/controls": "^1.1.3",
|
||||
"@vue-flow/core": "^1.48.2",
|
||||
"@vue-flow/minimap": "^1.5.4",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"axios": "1.8.2",
|
||||
"codemirror": "^6.0.1",
|
||||
|
||||
212
public/404.html
Normal file
212
public/404.html
Normal file
@@ -0,0 +1,212 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>404 - 页面不存在</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg-start: #f5f7fa;
|
||||
--bg-end: #e8ecf3;
|
||||
--card-bg: rgba(255, 255, 255, 0.92);
|
||||
--text-primary: #1f2d3d;
|
||||
--text-secondary: #6b7280;
|
||||
--accent: #409eff;
|
||||
--accent-hover: #66b1ff;
|
||||
--border: rgba(64, 158, 255, 0.12);
|
||||
--shadow: 0 20px 50px rgba(31, 45, 61, 0.12);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
|
||||
background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.error-page {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 32px;
|
||||
}
|
||||
|
||||
.error-card {
|
||||
width: min(960px, 100%);
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 24px;
|
||||
box-shadow: var(--shadow);
|
||||
backdrop-filter: blur(10px);
|
||||
display: flex;
|
||||
gap: 48px;
|
||||
align-items: center;
|
||||
padding: 56px;
|
||||
}
|
||||
|
||||
.error-content {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.error-code {
|
||||
margin: 0;
|
||||
font-size: clamp(64px, 12vw, 110px);
|
||||
line-height: 1;
|
||||
color: var(--accent);
|
||||
letter-spacing: 4px;
|
||||
}
|
||||
|
||||
.error-title {
|
||||
margin: 20px 0 12px;
|
||||
font-size: 30px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
margin: 0;
|
||||
color: var(--text-secondary);
|
||||
font-size: 16px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.error-actions {
|
||||
margin-top: 32px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.action-button {
|
||||
appearance: none;
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
padding: 12px 22px;
|
||||
font-size: 15px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.action-button:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.action-button.primary {
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
box-shadow: 0 12px 24px rgba(64, 158, 255, 0.24);
|
||||
}
|
||||
|
||||
.action-button.primary:hover {
|
||||
background: var(--accent-hover);
|
||||
}
|
||||
|
||||
.action-button.secondary {
|
||||
background: #fff;
|
||||
color: var(--text-primary);
|
||||
border: 1px solid rgba(31, 45, 61, 0.12);
|
||||
}
|
||||
|
||||
.error-illustration {
|
||||
flex: 0 0 320px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.illustration-shell {
|
||||
width: 100%;
|
||||
aspect-ratio: 1 / 1;
|
||||
border-radius: 32px;
|
||||
background: linear-gradient(160deg, rgba(64, 158, 255, 0.12), rgba(64, 158, 255, 0.02));
|
||||
border: 1px solid rgba(64, 158, 255, 0.14);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.illustration-shell::before,
|
||||
.illustration-shell::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
background: rgba(64, 158, 255, 0.12);
|
||||
}
|
||||
|
||||
.illustration-shell::before {
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
top: -30px;
|
||||
right: -30px;
|
||||
}
|
||||
|
||||
.illustration-shell::after {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
left: -20px;
|
||||
bottom: -20px;
|
||||
}
|
||||
|
||||
.illustration-center {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: clamp(72px, 10vw, 120px);
|
||||
font-weight: 800;
|
||||
color: rgba(64, 158, 255, 0.85);
|
||||
letter-spacing: 6px;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.error-card {
|
||||
flex-direction: column;
|
||||
padding: 36px 24px;
|
||||
gap: 28px;
|
||||
}
|
||||
|
||||
.error-illustration {
|
||||
flex-basis: auto;
|
||||
width: min(320px, 100%);
|
||||
}
|
||||
|
||||
.error-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main class="error-page">
|
||||
<section class="error-card">
|
||||
<div class="error-content">
|
||||
<h1 class="error-code">404</h1>
|
||||
<h2 class="error-title">抱歉,你访问的页面不存在</h2>
|
||||
<p class="error-message">
|
||||
当前地址可能已失效、输入有误,或者对应内容已被移动。你可以返回首页,或回到后台入口继续操作。
|
||||
</p>
|
||||
<div class="error-actions">
|
||||
<a class="action-button primary" href="/">返回首页</a>
|
||||
<a class="action-button secondary" href="/sys/">进入后台</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="error-illustration" aria-hidden="true">
|
||||
<div class="illustration-shell">
|
||||
<div class="illustration-center">404</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -12,7 +12,7 @@ export interface ApiInterfaceQueryParams {
|
||||
|
||||
// 创建接口参数
|
||||
export interface CreateApiInterfaceParams {
|
||||
platformId: string | number;
|
||||
platformId: number;
|
||||
name: string;
|
||||
code: string;
|
||||
url: string;
|
||||
@@ -22,6 +22,7 @@ export interface CreateApiInterfaceParams {
|
||||
requestConfig?: Record<string, any>;
|
||||
responseConfig?: Record<string, any>;
|
||||
limitConfig?: Record<string, any>;
|
||||
tableDefinition?: Record<string, any>;
|
||||
}
|
||||
|
||||
// 更新接口参数
|
||||
@@ -50,6 +51,7 @@ export interface ApiInterfaceInfo {
|
||||
requestConfig?: Record<string, any>;
|
||||
responseConfig?: Record<string, any>;
|
||||
limitConfig?: Record<string, any>;
|
||||
tableDefinition?: Record<string, any>;
|
||||
createdBy?: string;
|
||||
createdAt?: number;
|
||||
updatedBy?: string;
|
||||
@@ -59,7 +61,7 @@ export interface ApiInterfaceInfo {
|
||||
// 获取接口列表
|
||||
export function listApiInterfaces(params: ApiInterfaceQueryParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/listApiInterfaces',
|
||||
url: '/data-engine/api/interface/controller/listApiInterfaces',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
@@ -68,7 +70,7 @@ export function listApiInterfaces(params: ApiInterfaceQueryParams) {
|
||||
// 获取接口详情
|
||||
export function getApiInterface(id: string) {
|
||||
return request({
|
||||
url: '/api/interface/controller/getApiInterface',
|
||||
url: '/data-engine/api/interface/controller/getApiInterface',
|
||||
method: 'get',
|
||||
params: { id },
|
||||
});
|
||||
@@ -77,7 +79,7 @@ export function getApiInterface(id: string) {
|
||||
// 创建接口
|
||||
export function createApiInterface(data: CreateApiInterfaceParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/createApiInterface',
|
||||
url: '/data-engine/api/interface/controller/createApiInterface',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
@@ -86,7 +88,7 @@ export function createApiInterface(data: CreateApiInterfaceParams) {
|
||||
// 修改接口
|
||||
export function updateApiInterface(data: UpdateApiInterfaceParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/updateApiInterface',
|
||||
url: '/data-engine/api/interface/controller/updateApiInterface',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
@@ -95,7 +97,7 @@ export function updateApiInterface(data: UpdateApiInterfaceParams) {
|
||||
// 更新接口状态
|
||||
export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/updateApiInterfaceStatus',
|
||||
url: '/data-engine/api/interface/controller/updateApiInterfaceStatus',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
@@ -104,7 +106,7 @@ export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
|
||||
// 删除接口
|
||||
export function deleteApiInterface(id: string) {
|
||||
return request({
|
||||
url: '/api/interface/controller/deleteApiInterface',
|
||||
url: '/data-engine/api/interface/controller/deleteApiInterface',
|
||||
method: 'delete',
|
||||
params: { id },
|
||||
});
|
||||
|
||||
@@ -26,8 +26,7 @@ export interface CreateDatasourcePlatformParams {
|
||||
requestTimeoutMs?: number;
|
||||
maxRetries?: number;
|
||||
retryDelayMs?: number;
|
||||
createdBy?: string;
|
||||
updatedBy?: string;
|
||||
authConfig?: Record<string, any>;
|
||||
}
|
||||
|
||||
// 更新平台参数
|
||||
@@ -40,7 +39,6 @@ export interface UpdateDatasourcePlatformParams extends Partial<CreateDatasource
|
||||
export interface UpdateDatasourcePlatformStatusParams {
|
||||
id: string;
|
||||
Status: string;
|
||||
updatedBy?: string;
|
||||
}
|
||||
|
||||
// 平台信息
|
||||
@@ -54,22 +52,25 @@ export interface DatasourcePlatformInfo {
|
||||
apiBaseUrl: string;
|
||||
authType: string;
|
||||
authTypeName: string;
|
||||
token?: string;
|
||||
apiKey?: string;
|
||||
clientId?: string;
|
||||
clientSecret?: string;
|
||||
authConfig?: Record<string, any>;
|
||||
rateLimitPerMinute?: number;
|
||||
rateLimitPerHour?: number;
|
||||
concurrencyLimit?: number;
|
||||
requestTimeoutMs?: number;
|
||||
maxRetries?: number;
|
||||
retryDelayMs?: number;
|
||||
createdBy?: string;
|
||||
createdAt?: number;
|
||||
updatedBy?: string;
|
||||
updatedAt?: number;
|
||||
}
|
||||
|
||||
// 获取平台列表
|
||||
export function listDatasourcePlatforms(params: DatasourcePlatformQueryParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/listDatasourcePlatforms',
|
||||
url: '/data-engine/datasource/platform/controller/listDatasourcePlatforms',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
@@ -78,7 +79,7 @@ export function listDatasourcePlatforms(params: DatasourcePlatformQueryParams) {
|
||||
// 创建平台
|
||||
export function createDatasourcePlatform(data: CreateDatasourcePlatformParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/createDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/createDatasourcePlatform',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
@@ -87,7 +88,7 @@ export function createDatasourcePlatform(data: CreateDatasourcePlatformParams) {
|
||||
// 更新平台
|
||||
export function updateDatasourcePlatform(data: UpdateDatasourcePlatformParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/updateDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/updateDatasourcePlatform',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
@@ -96,7 +97,7 @@ export function updateDatasourcePlatform(data: UpdateDatasourcePlatformParams) {
|
||||
// 删除平台
|
||||
export function deleteDatasourcePlatform(id: string) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/deleteDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/deleteDatasourcePlatform',
|
||||
method: 'delete',
|
||||
params: { id },
|
||||
});
|
||||
@@ -105,7 +106,7 @@ export function deleteDatasourcePlatform(id: string) {
|
||||
// 获取平台详情
|
||||
export function getDatasourcePlatform(id: string) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/getDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/getDatasourcePlatform',
|
||||
method: 'get',
|
||||
params: { id },
|
||||
});
|
||||
@@ -114,7 +115,7 @@ export function getDatasourcePlatform(id: string) {
|
||||
// 根据编码获取平台信息
|
||||
export function getPlatformByCode(platformCode: string) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/getPlatformByCode',
|
||||
url: '/data-engine/datasource/platform/controller/getPlatformByCode',
|
||||
method: 'get',
|
||||
params: { platformCode },
|
||||
});
|
||||
@@ -123,7 +124,7 @@ export function getPlatformByCode(platformCode: string) {
|
||||
// 更新平台状态
|
||||
export function updateDatasourcePlatformStatus(data: UpdateDatasourcePlatformStatusParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/updateDatasourcePlatformStatus',
|
||||
url: '/data-engine/datasource/platform/controller/updateDatasourcePlatformStatus',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
|
||||
@@ -5,30 +5,42 @@ export interface knowledgeQueryParams {
|
||||
keyword?: string;
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
datasetType?: number; // 1=文本,2=视频
|
||||
}
|
||||
|
||||
// 创建知识库参数
|
||||
export interface CreateknowledgeParams {
|
||||
name: string; // 必传
|
||||
datasetType: number; // 1=文本,2=视频
|
||||
description?: string; // 可选
|
||||
embeddingModel?: string; // 向量模型
|
||||
status?: string; // 状态
|
||||
}
|
||||
|
||||
// 更新知识库参数
|
||||
export interface UpdateknowledgeParams {
|
||||
id: string; // 必传
|
||||
name?: string; // 可选
|
||||
datasetType?: number; // 1=文本,2=视频
|
||||
description?: string; // 可选
|
||||
embeddingModel?: string; // 向量模型
|
||||
status?: string; // 状态
|
||||
}
|
||||
|
||||
// 数据集信息
|
||||
export interface knowledgeInfo {
|
||||
id?: string;
|
||||
name: string;
|
||||
datasetType?: number; // 1=文本,2=视频
|
||||
description?: string;
|
||||
fileCount?: number;
|
||||
totalSize?: number;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
embeddingModel?: string; // 向量模型
|
||||
documentCount?: number; // 文档数量
|
||||
charCount?: number; // 字符数量
|
||||
status?: string; // 状态
|
||||
}
|
||||
|
||||
// 获取知识库列表
|
||||
|
||||
@@ -37,6 +37,8 @@ export interface NodeLibraryItem {
|
||||
nodeName: string;
|
||||
modelType: number;
|
||||
skillOption: boolean;
|
||||
promptOption: boolean;
|
||||
isSaveFile: boolean;
|
||||
formConfig: NodeLibraryFormItem[];
|
||||
modelConfig: NodeLibraryModelConfig[];
|
||||
}
|
||||
@@ -86,6 +88,7 @@ export interface ExecutionItem {
|
||||
timestamp: string;
|
||||
content: string;
|
||||
label: string;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface ExecutionFlowItem {
|
||||
|
||||
@@ -20,6 +20,41 @@ export interface ModelFormEntry {
|
||||
value: string;
|
||||
}
|
||||
|
||||
// 提示词管理接口类型
|
||||
export interface PromptItem {
|
||||
id: number | string;
|
||||
tenantId?: number;
|
||||
creator?: string;
|
||||
createdAt?: string;
|
||||
updater?: string;
|
||||
updatedAt?: string;
|
||||
deletedAt?: string | null;
|
||||
nodeType: string;
|
||||
prompt: string;
|
||||
sourceType: number; // 0-自定义 1-公共
|
||||
}
|
||||
|
||||
export interface PromptListResponse {
|
||||
list: PromptItem[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface PromptListParams {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
keyword?: string;
|
||||
}
|
||||
|
||||
export interface CreatePromptParams {
|
||||
nodeType: string;
|
||||
prompt: string;
|
||||
sourceType: number;
|
||||
}
|
||||
|
||||
export interface UpdatePromptParams extends CreatePromptParams {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/** 模型类型(listType 接口项,字段名以后端为准,前端做兼容解析) */
|
||||
export interface ModelTypeListItem {
|
||||
id?: number | string;
|
||||
@@ -84,18 +119,22 @@ export interface ModelModuleItem {
|
||||
/** 会话开关状态(列表接口返回,0 关 1 开;会话开关接口就绪后生效) */
|
||||
chatSessionEnabled?: number;
|
||||
enabled: number;
|
||||
/** 调用模式:0-同步 1-异步 2-流式 */
|
||||
callMode?: number;
|
||||
maxConcurrency: number;
|
||||
queueLimit: number;
|
||||
queueLimit?: number;
|
||||
timeoutMs?: number;
|
||||
timeoutSeconds?: number;
|
||||
expectedSeconds?: number;
|
||||
retryTimes: number;
|
||||
retryQueueMaxSeconds: number;
|
||||
retryQueueMaxSeconds?: number;
|
||||
autoCleanSeconds: number;
|
||||
remark?: string;
|
||||
headMsg?: string;
|
||||
headMsg?: string | Record<string, string>;
|
||||
form?: ModelFormEntry[] | Record<string, { value: string }>;
|
||||
requestMapping?: Record<string, unknown>;
|
||||
requiredFields?: string[];
|
||||
firstFrame?: string;
|
||||
lastFrame?: string;
|
||||
responseMapping?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
@@ -112,24 +151,35 @@ export interface CreateModelParams {
|
||||
modelName: string;
|
||||
/** 与 listType 返回的类型 id 一致,可能为数字或字符串 */
|
||||
modelType: number | string;
|
||||
operatorName?: string;
|
||||
baseUrl: string;
|
||||
httpMethod?: string;
|
||||
headMsg?: string;
|
||||
headMsg?: Record<string, string>;
|
||||
isPrivate: number;
|
||||
enabled: number;
|
||||
isChatModel: number;
|
||||
/** 调用模式:0-同步 1-异步 2-流式,默认0 */
|
||||
callMode: number;
|
||||
apiKey?: string;
|
||||
form: ModelFormEntry[];
|
||||
requestMapping?: Record<string, unknown>;
|
||||
requiredFields?: string[];
|
||||
firstFrame?: string;
|
||||
lastFrame?: string;
|
||||
responseMapping?: Record<string, unknown>;
|
||||
responseBody?: string;
|
||||
extendMapping?: Record<string, unknown>;
|
||||
responseTokenField?: string;
|
||||
tokenConfig?: Record<string, unknown>;
|
||||
queryConfig?: Record<string, unknown>;
|
||||
streamConfig?: Record<string, unknown>;
|
||||
maxConcurrency?: number;
|
||||
queueLimit?: number;
|
||||
timeoutSeconds: number;
|
||||
expectedSeconds: number;
|
||||
expectedSeconds?: number;
|
||||
retryTimes?: number;
|
||||
retryQueueMaxSeconds: number;
|
||||
retryQueueMaxSeconds?: number;
|
||||
autoCleanSeconds: number;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface ModelConfigTypeItem {
|
||||
@@ -245,3 +295,46 @@ export function getOperatorList() {
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户提示词列表
|
||||
*/
|
||||
export function getMyPromptList(params: PromptListParams) {
|
||||
return request<PromptListResponse>({
|
||||
url: '/node/prompt/listMy',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建提示词
|
||||
*/
|
||||
export function createPrompt(data: CreatePromptParams) {
|
||||
return request({
|
||||
url: '/node/prompt/create',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改提示词
|
||||
*/
|
||||
export function updatePrompt(data: UpdatePromptParams) {
|
||||
return request({
|
||||
url: '/node/prompt/update',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除提示词
|
||||
*/
|
||||
export function deletePrompt(id: number | string) {
|
||||
return request({
|
||||
url: `/node/prompt/delete/${id}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
|
||||
149
src/api/settings/promptManager/index.ts
Normal file
149
src/api/settings/promptManager/index.ts
Normal file
@@ -0,0 +1,149 @@
|
||||
import request from '/@/utils/request';
|
||||
|
||||
// 提示词管理接口类型
|
||||
export interface PromptItem {
|
||||
id: number | string;
|
||||
tenantId?: number;
|
||||
creator?: string;
|
||||
createdAt?: string;
|
||||
updater?: string;
|
||||
updatedAt?: string;
|
||||
deletedAt?: string | null;
|
||||
nodeType: string;
|
||||
prompt: string;
|
||||
sourceType: number; // 1-管理员 2-用户
|
||||
}
|
||||
|
||||
export interface PromptListResponse {
|
||||
list: PromptItem[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface PromptListParams {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
keyword?: string;
|
||||
nodeType?: string;
|
||||
}
|
||||
|
||||
export interface CreatePromptParams {
|
||||
nodeType: string;
|
||||
prompt: string;
|
||||
sourceType: number;
|
||||
}
|
||||
|
||||
export interface CheckIsSuperAdminResponse {
|
||||
isSuperAdmin: boolean;
|
||||
}
|
||||
|
||||
export interface CreatePromptResponse {
|
||||
id?: number | string;
|
||||
tenantId?: number;
|
||||
creator?: string;
|
||||
createdAt?: string;
|
||||
updater?: string;
|
||||
updatedAt?: string;
|
||||
deletedAt?: string | null;
|
||||
nodeType?: string;
|
||||
prompt?: string;
|
||||
sourceType?: number;
|
||||
}
|
||||
|
||||
export interface UpdatePromptParams extends CreatePromptParams {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
// 节点库项接口类型
|
||||
export interface NodeLibraryNode {
|
||||
nodeId: string;
|
||||
nodeCode: string;
|
||||
modelType: number;
|
||||
nodeName: string;
|
||||
skillOption: boolean;
|
||||
promptOption: boolean;
|
||||
}
|
||||
|
||||
export interface NodeLibraryGroup {
|
||||
group: string;
|
||||
label: string;
|
||||
items: NodeLibraryNode[];
|
||||
}
|
||||
|
||||
export interface NodeLibraryResponse {
|
||||
groups: NodeLibraryGroup[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点类型列表(节点库)
|
||||
*/
|
||||
export function getNodeLibraryList() {
|
||||
return request<NodeLibraryResponse>({
|
||||
url: '/ai-agent/node/library/list',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取提示词列表(根据节点类型)
|
||||
*/
|
||||
export function getPromptList(params: PromptListParams) {
|
||||
return request<PromptListResponse>({
|
||||
url: '/ai-agent/node/prompt/list',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户提示词列表
|
||||
*/
|
||||
export function getMyPromptList(params: PromptListParams) {
|
||||
return request<PromptListResponse>({
|
||||
url: '/ai-agent/node/prompt/listMy',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建提示词
|
||||
*/
|
||||
export function createPrompt(data: CreatePromptParams) {
|
||||
return request<CreatePromptResponse>({
|
||||
url: '/ai-agent/node/prompt/create',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改提示词
|
||||
*/
|
||||
export function updatePrompt(data: UpdatePromptParams) {
|
||||
return request({
|
||||
url: '/ai-agent/node/prompt/update',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除提示词
|
||||
*/
|
||||
export function deletePrompt(id: number | string) {
|
||||
return request({
|
||||
url: '/ai-agent/node/prompt/delete',
|
||||
method: 'delete',
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前用户是否为超级管理员
|
||||
*/
|
||||
export function checkIsSuperAdmin() {
|
||||
return request<CheckIsSuperAdminResponse>({
|
||||
url: '/admin-go/api/v1/system/user/checkIsSuperAdmin',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
16
src/api/system/pwconfig/index.ts
Normal file
16
src/api/system/pwconfig/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import request from '/@/utils/request';
|
||||
|
||||
export function getPwConfig() {
|
||||
return request({
|
||||
url: '/admin-go/api/v1/system/pwconfig/get',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
export function savePwConfig(data: any) {
|
||||
return request({
|
||||
url: '/admin-go/api/v1/system/pwconfig/save',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="search-bar">
|
||||
<el-input v-model="searchParams.modelName" placeholder="搜索模型名称" clearable @clear="handleSearch">
|
||||
<template #prefix
|
||||
><el-icon><Search /></el-icon
|
||||
><el-icon> <Search /> </el-icon
|
||||
></template>
|
||||
</el-input>
|
||||
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
||||
@@ -26,7 +26,9 @@
|
||||
<div class="model-type">{{ getModelTypeName(model.modelType) }}</div>
|
||||
<div class="model-badges">
|
||||
<el-tag v-if="model.isOwner === 0" type="warning" size="small">内置模型</el-tag>
|
||||
<el-icon v-if="selectedModel?.id === model.id" class="check-icon" color="#67c23a"><CircleCheck /></el-icon>
|
||||
<el-icon v-if="selectedModel?.id === model.id" class="check-icon" color="#67c23a">
|
||||
<CircleCheck />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="model-card-body">
|
||||
@@ -92,7 +94,14 @@
|
||||
import { ref, reactive, watch, onMounted } from 'vue';
|
||||
import { ElMessage, type FormInstance, type FormRules } from 'element-plus';
|
||||
import { Search, CircleCheck } from '@element-plus/icons-vue';
|
||||
import { getModelModuleList, addModelModule, getModelTypeList, normalizeModelTypeOptions } from '/@/api/settings/modelConfig/modelModule';
|
||||
import {
|
||||
getModelModuleList,
|
||||
addModelModule,
|
||||
getModelTypeList,
|
||||
normalizeModelTypeOptions,
|
||||
type CreateModelParams,
|
||||
type ModelFormEntry,
|
||||
} from '/@/api/settings/modelConfig/modelModule';
|
||||
import { checkIsSuperAdmin } from '/@/api/system/user/index';
|
||||
import { getApiErrorMessage } from '/@/utils/request';
|
||||
import EditModule from '/@/views/settings/modelConfig/modelModule/component/editModule.vue';
|
||||
@@ -101,7 +110,7 @@ interface ModelItem {
|
||||
id: string;
|
||||
tenantId?: number;
|
||||
modelName: string;
|
||||
modelType: number;
|
||||
modelType: number | string;
|
||||
baseUrl: string;
|
||||
route: string;
|
||||
httpMethod: string;
|
||||
@@ -109,13 +118,22 @@ interface ModelItem {
|
||||
apiKey?: string;
|
||||
isPrivate?: number;
|
||||
isChatModel?: number;
|
||||
headMsg?: string;
|
||||
headMsg?: string | Record<string, string>;
|
||||
operatorName?: string;
|
||||
responseBody?: Record<string, unknown>;
|
||||
responseTokenField?: string;
|
||||
tokenConfig?: Record<string, unknown> | string;
|
||||
form?: any;
|
||||
requestMapping?: any;
|
||||
responseMapping?: any;
|
||||
extendMapping?: Record<string, unknown> | string;
|
||||
queryConfig?: Record<string, unknown>;
|
||||
streamConfig?: Record<string, unknown>;
|
||||
form?: ModelFormEntry[] | Record<string, unknown>;
|
||||
requestMapping?: Record<string, unknown>;
|
||||
requiredFields?: string[];
|
||||
firstFrame?: string;
|
||||
lastFrame?: string;
|
||||
responseMapping?: Record<string, unknown>;
|
||||
callMode?: number;
|
||||
isAsync?: number;
|
||||
maxConcurrency?: number;
|
||||
queueLimit?: number;
|
||||
timeoutSeconds?: number;
|
||||
@@ -206,13 +224,125 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
const getModelTypeName = (type: number) => {
|
||||
const getModelTypeName = (type: number | string) => {
|
||||
const typeMap: Record<number, string> = {
|
||||
1: '推理模型',
|
||||
2: '图片模型',
|
||||
3: '音频模型',
|
||||
100: '推理模型',
|
||||
200: '图片模型',
|
||||
201: '图片模型-文生图',
|
||||
202: '图片模型-图生图',
|
||||
203: '图片模型-图片编辑',
|
||||
204: '图片模型-图片变体',
|
||||
300: '音频模型',
|
||||
301: '音频模型-文生音',
|
||||
302: '音频模型-音生文',
|
||||
303: '音频模型-音生音',
|
||||
400: '向量化模型',
|
||||
401: '向量化模型-文本嵌入',
|
||||
402: '向量化模型-重排序',
|
||||
500: '全模态模型',
|
||||
501: '全模态模型-文图音',
|
||||
502: '全模态模型-视觉理解',
|
||||
600: '视频模型',
|
||||
601: '视频模型-文生视频',
|
||||
602: '视频模型-图生视频',
|
||||
603: '视频模型-图文生视频',
|
||||
604: '视频模型-视频生视频',
|
||||
605: '视频模型-视频编辑',
|
||||
};
|
||||
return typeMap[type] || '未知类型';
|
||||
return typeMap[Number(type)] || '未知类型';
|
||||
};
|
||||
|
||||
const parseJsonObjectField = (raw: unknown): Record<string, unknown> => {
|
||||
if (raw && typeof raw === 'object' && !Array.isArray(raw)) {
|
||||
return raw as Record<string, unknown>;
|
||||
}
|
||||
if (typeof raw === 'string') {
|
||||
try {
|
||||
const parsed = JSON.parse(raw || '{}');
|
||||
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
||||
return parsed as Record<string, unknown>;
|
||||
}
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
return {};
|
||||
};
|
||||
const fieldsToUnknownObject = (fields: Array<{ key: string; value: string }>) => {
|
||||
const obj: Record<string, unknown> = {};
|
||||
fields.forEach((f) => {
|
||||
const k = String(f.key || '').trim();
|
||||
if (!k) return;
|
||||
obj[k] = String(f.value ?? '');
|
||||
});
|
||||
return obj;
|
||||
};
|
||||
|
||||
const parseFormEntries = (raw: unknown): ModelFormEntry[] => {
|
||||
if (Array.isArray(raw)) {
|
||||
return (raw as ModelFormEntry[])
|
||||
.filter((item) => item && item.key !== undefined)
|
||||
.map((item) => ({
|
||||
key: String(item.key ?? '').trim(),
|
||||
value: String(item.value ?? ''),
|
||||
}))
|
||||
.filter((item) => item.key !== '');
|
||||
}
|
||||
|
||||
if (raw && typeof raw === 'object') {
|
||||
return Object.entries(raw as Record<string, unknown>).map(([key, value]) => {
|
||||
let nextValue = value;
|
||||
if (nextValue && typeof nextValue === 'object' && !Array.isArray(nextValue) && 'value' in nextValue) {
|
||||
nextValue = (nextValue as { value: unknown }).value;
|
||||
}
|
||||
return {
|
||||
key: String(key).trim(),
|
||||
value: String(nextValue ?? ''),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
return [];
|
||||
};
|
||||
|
||||
const normalizeQueryConfig = (raw: unknown): Record<string, unknown> => {
|
||||
if (raw && typeof raw === 'object' && !Array.isArray(raw)) {
|
||||
return raw as Record<string, unknown>;
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
||||
const parseHeadMsgRecord = (raw: ModelItem['headMsg']) => {
|
||||
const headMsgRecord: Record<string, string> = {};
|
||||
if (typeof raw === 'string') {
|
||||
try {
|
||||
const parsed = JSON.parse(raw);
|
||||
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
||||
Object.entries(parsed).forEach(([k, v]) => {
|
||||
headMsgRecord[k] = String(v);
|
||||
});
|
||||
return headMsgRecord;
|
||||
}
|
||||
} catch {
|
||||
const pairs = raw.split(',');
|
||||
pairs.forEach((pair) => {
|
||||
const idx = pair.indexOf(':');
|
||||
if (idx === -1) return;
|
||||
const key = pair.slice(0, idx).trim();
|
||||
const value = pair.slice(idx + 1).trim();
|
||||
if (key) {
|
||||
headMsgRecord[key] = value;
|
||||
}
|
||||
});
|
||||
return headMsgRecord;
|
||||
}
|
||||
}
|
||||
if (raw && typeof raw === 'object' && !Array.isArray(raw)) {
|
||||
Object.entries(raw).forEach(([k, v]) => {
|
||||
headMsgRecord[k] = String(v);
|
||||
});
|
||||
}
|
||||
return headMsgRecord;
|
||||
};
|
||||
|
||||
const fetchModelList = async () => {
|
||||
@@ -270,20 +400,26 @@ const handleCreatePrivateModel = async () => {
|
||||
creatingModel.value = true;
|
||||
|
||||
const builtInModel = builtInModelToClone.value;
|
||||
const createParams = {
|
||||
const formList = parseFormEntries(builtInModel.form);
|
||||
|
||||
const createParams: CreateModelParams = {
|
||||
modelName: apiKeyForm.modelName,
|
||||
modelType: builtInModel.modelType,
|
||||
operatorName: builtInModel.operatorName || '',
|
||||
baseUrl: builtInModel.baseUrl,
|
||||
httpMethod: builtInModel.httpMethod || 'POST',
|
||||
headMsg: builtInModel.headMsg || '',
|
||||
headMsg: parseHeadMsgRecord(builtInModel.headMsg),
|
||||
isPrivate: builtInModel.isPrivate ?? 1,
|
||||
enabled: builtInModel.enabled ?? 1,
|
||||
isChatModel: builtInModel.isChatModel || 0,
|
||||
callMode: builtInModel.callMode ?? builtInModel.isAsync ?? 0,
|
||||
apiKey: apiKeyForm.apiKey,
|
||||
form: builtInModel.form || {},
|
||||
requestMapping: builtInModel.requestMapping || {},
|
||||
responseMapping: builtInModel.responseMapping || {},
|
||||
form: formList,
|
||||
requestMapping: (builtInModel.requestMapping as Record<string, unknown>) || {},
|
||||
requiredFields: Array.isArray(builtInModel.requiredFields) ? builtInModel.requiredFields : [],
|
||||
firstFrame: String(builtInModel.firstFrame || ''),
|
||||
lastFrame: String(builtInModel.lastFrame || ''),
|
||||
responseMapping: (builtInModel.responseMapping as Record<string, unknown>) || {},
|
||||
responseBody: builtInModel.responseBody || {},
|
||||
maxConcurrency: builtInModel.maxConcurrency || 10,
|
||||
queueLimit: builtInModel.queueLimit || 100,
|
||||
@@ -292,9 +428,20 @@ const handleCreatePrivateModel = async () => {
|
||||
retryTimes: builtInModel.retryTimes || 3,
|
||||
retryQueueMaxSeconds: builtInModel.retryQueueMaxSeconds || 60,
|
||||
autoCleanSeconds: builtInModel.autoCleanSeconds || 300,
|
||||
remark: builtInModel.remark || '',
|
||||
tokenMapping: builtInModel.tokenMapping || '',
|
||||
tokenConfig: builtInModel.tokenConfig || {},
|
||||
extendMapping: fieldsToUnknownObject(
|
||||
Object.entries(parseJsonObjectField(builtInModel.extendMapping)).map(([k, v]) => ({ key: k, value: String(v ?? '') }))
|
||||
),
|
||||
tokenConfig: fieldsToUnknownObject(
|
||||
Object.entries(parseJsonObjectField(builtInModel.tokenConfig)).map(([k, v]) => ({ key: k, value: String(v ?? '') }))
|
||||
),
|
||||
queryConfig: normalizeQueryConfig(builtInModel.queryConfig),
|
||||
responseTokenField: String(builtInModel.responseTokenField || ''),
|
||||
streamConfig:
|
||||
Number(builtInModel.callMode ?? builtInModel.isAsync ?? 0) === 2
|
||||
? builtInModel.streamConfig && typeof builtInModel.streamConfig === 'object' && !Array.isArray(builtInModel.streamConfig)
|
||||
? (builtInModel.streamConfig as Record<string, unknown>)
|
||||
: {}
|
||||
: undefined,
|
||||
};
|
||||
|
||||
const res: any = await addModelModule(createParams);
|
||||
|
||||
@@ -34,6 +34,23 @@ export const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: staticRoutes,
|
||||
});
|
||||
const hasValidResolvedRoute = (to: any) => {
|
||||
const resolved = router.resolve(to.fullPath);
|
||||
const matched = resolved.matched || [];
|
||||
|
||||
const isStaticFallbackRoute = matched.length === 1 && matched[0]?.path === '/:pathMatch(.*)*';
|
||||
|
||||
const isRedirectTo404Route = matched.length > 0 && matched.every((item) => item.redirect === '/404');
|
||||
|
||||
return matched.length > 0 && !isStaticFallbackRoute && !isRedirectTo404Route;
|
||||
};
|
||||
const goResolvedOr404AfterInit = (to: any, next: any) => {
|
||||
if (hasValidResolvedRoute(to)) {
|
||||
next({ ...to, replace: true });
|
||||
} else {
|
||||
next('/404');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 路由多级嵌套数组处理成一维数组
|
||||
@@ -106,18 +123,18 @@ router.beforeEach(async (to, from, next) => {
|
||||
const { routesList } = storeToRefs(storesRoutesList);
|
||||
if (routesList.value.length === 0) {
|
||||
if (isRequestRoutes) {
|
||||
// 后端控制路由:路由数据初始化,防止刷新时丢失
|
||||
await initBackEndControlRoutes();
|
||||
// 动态添加路由:防止非首页刷新时跳转回首页的问题
|
||||
// 确保 addRoute() 时动态添加的路由已经被完全加载上去
|
||||
next({ ...to, replace: true });
|
||||
goResolvedOr404AfterInit(to, next);
|
||||
} else {
|
||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I5F1HP
|
||||
await initFrontEndControlRoutes();
|
||||
next({ ...to, replace: true });
|
||||
goResolvedOr404AfterInit(to, next);
|
||||
}
|
||||
} else {
|
||||
next();
|
||||
if (hasValidResolvedRoute(to)) {
|
||||
next();
|
||||
} else {
|
||||
next('/404');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RouteRecordRaw } from 'vue-router';
|
||||
import { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
/**
|
||||
* 路由meta对象参数说明
|
||||
@@ -69,9 +69,9 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
||||
|
||||
/**
|
||||
* 盘点管理路由配置(供后端菜单配置参考)
|
||||
*
|
||||
*
|
||||
* 父级菜单: 库存作业 (/assets/operation)
|
||||
*
|
||||
*
|
||||
* 盘点菜单配置:
|
||||
* - 路由路径: /assets/operation/count
|
||||
* - 组件路径: assets/operation/count/index
|
||||
@@ -1077,8 +1077,8 @@ export const demoRoutes: Array<RouteRecordRaw> = [
|
||||
*/
|
||||
export const notFoundAndNoPower = [
|
||||
{
|
||||
path: '/:path(.*)*',
|
||||
name: 'notFound',
|
||||
path: '/404',
|
||||
name: 'notFoundPage',
|
||||
component: () => import('/@/views/error/404.vue'),
|
||||
meta: {
|
||||
title: 'message.staticRoutes.notFound',
|
||||
@@ -1094,6 +1094,15 @@ export const notFoundAndNoPower = [
|
||||
isHide: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/:path(.*)*',
|
||||
name: 'notFound',
|
||||
redirect: '/404',
|
||||
meta: {
|
||||
title: 'message.staticRoutes.notFound',
|
||||
isHide: true,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,22 +32,12 @@
|
||||
<div class="table-body">
|
||||
<div v-for="(attr, index) in ruleForm.attrs" :key="index" class="table-row">
|
||||
<div class="col col-name">
|
||||
<el-input
|
||||
v-if="!isDictType(attr.type)"
|
||||
v-model="attr.name"
|
||||
placeholder="请输入属性名称"
|
||||
clearable
|
||||
/>
|
||||
<el-input v-if="!isDictType(attr.type)" v-model="attr.name" placeholder="请输入属性名称" clearable />
|
||||
<span v-else class="dict-name">{{ attr.name || '请选择字典' }}</span>
|
||||
</div>
|
||||
<div class="col col-type">
|
||||
<el-select v-model="attr.type" placeholder="属性类型" class="w100" @change="onAttrTypeChange(attr)">
|
||||
<el-option
|
||||
v-for="item in attrTypeOptions"
|
||||
:key="item.key"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
/>
|
||||
<el-option v-for="item in attrTypeOptions" :key="item.key" :label="item.value" :value="item.key" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="col col-required">
|
||||
@@ -155,13 +145,6 @@ interface DictInfo {
|
||||
remark: string;
|
||||
}
|
||||
|
||||
interface DictValue {
|
||||
key: string;
|
||||
value: string;
|
||||
isDefault: number;
|
||||
remark: string;
|
||||
}
|
||||
|
||||
interface RuleForm {
|
||||
id: string | '';
|
||||
parentId: string;
|
||||
@@ -219,15 +202,11 @@ const fetchDictTypeOptions = () => {
|
||||
.then((res: any) => {
|
||||
const list = res.data?.list ?? [];
|
||||
// 提取所有字典类型信息
|
||||
dictTypeOptions.value = list
|
||||
.map((item: any) => item.info)
|
||||
.filter((info: DictInfo) => info && info.name);
|
||||
dictTypeOptions.value = list.map((item: any) => item.info).filter((info: DictInfo) => info && info.name);
|
||||
// 保存完整的字典数据列表(包含info和values)
|
||||
dictValueOptions.value = list;
|
||||
|
||||
})
|
||||
.catch((err: any) => {
|
||||
|
||||
dictTypeOptions.value = [];
|
||||
dictValueOptions.value = [];
|
||||
})
|
||||
@@ -270,7 +249,9 @@ const isDictOptionDisabled = (dictName: string, currentAttr: CustomAttr) => {
|
||||
const dictInfo = dictTypeOptions.value.find((item) => item.name === dictName);
|
||||
const dictType = dictInfo?.type || '';
|
||||
// 检查该字典是否已被其他属性使用(使用 dictType 判断)
|
||||
return ruleForm.attrs.some((attr) => attr !== currentAttr && isDictType(attr.type) && (attr.dictType === dictType || (!attr.dictType && attr.name === dictName)));
|
||||
return ruleForm.attrs.some(
|
||||
(attr) => attr !== currentAttr && isDictType(attr.type) && (attr.dictType === dictType || (!attr.dictType && attr.name === dictName))
|
||||
);
|
||||
};
|
||||
|
||||
// 添加自定义属性
|
||||
@@ -325,16 +306,16 @@ const openDialog = (row?: CategoryRow | string, edit?: boolean) => {
|
||||
// 获取分类树数据
|
||||
getCategoryTree().then((res: any) => {
|
||||
const tree = res.data?.tree ?? [];
|
||||
|
||||
|
||||
// 递归函数,将所有id字段转换为字符串
|
||||
const convertIdsToString = (items: any[]): any[] => {
|
||||
return items.map(item => ({
|
||||
return items.map((item) => ({
|
||||
...item,
|
||||
id: item.id?.toString(),
|
||||
children: item.children && item.children.length > 0 ? convertIdsToString(item.children) : []
|
||||
children: item.children && item.children.length > 0 ? convertIdsToString(item.children) : [],
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
categoryData.value = convertIdsToString(tree);
|
||||
});
|
||||
|
||||
@@ -472,7 +453,7 @@ const onSubmit = () => {
|
||||
...submitData,
|
||||
_originalData: originalData,
|
||||
};
|
||||
|
||||
|
||||
updateCategory(requestData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功');
|
||||
|
||||
121
src/views/home/components/ChatList.vue
Normal file
121
src/views/home/components/ChatList.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div class="chat-list">
|
||||
<div class="chat-divider">今天 15:14</div>
|
||||
|
||||
<div v-for="msg in messages" :key="msg.id" class="message-row" :class="{ 'is-user': msg.isUser }">
|
||||
<div class="bubble-wrap">
|
||||
<div class="bubble">{{ msg.content }}</div>
|
||||
<div class="time">{{ msg.time }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
interface Message {
|
||||
id: number;
|
||||
content: string;
|
||||
time: string;
|
||||
isUser: boolean;
|
||||
}
|
||||
|
||||
const messages = ref<Message[]>([
|
||||
{
|
||||
id: 1,
|
||||
content: '你好!我叫知子,很高兴为您服务。您今天想聊些什么呢?',
|
||||
time: '09:30',
|
||||
isUser: false,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
content: '你好!我想了解下这个系统都能做什么。',
|
||||
time: '09:31',
|
||||
isUser: true,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
content: '当然可以,这个系统提供了多种功能:日记、文件、快捷指令、快捷回复,以及技能管理和模型管理入口。你想先看哪一块?',
|
||||
time: '09:31',
|
||||
isUser: false,
|
||||
},
|
||||
]);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.chat-list {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
gap: 16px;
|
||||
padding: 28px 0 10px;
|
||||
}
|
||||
|
||||
.chat-divider {
|
||||
align-self: center;
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
line-height: 1;
|
||||
padding: 4px 16px;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(226, 233, 244, 0.8);
|
||||
letter-spacing: 0.2px;
|
||||
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
|
||||
}
|
||||
|
||||
.message-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
max-width: 100%;
|
||||
|
||||
&.is-user {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
.bubble-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
max-width: min(84%, 1120px);
|
||||
}
|
||||
|
||||
.bubble {
|
||||
font-size: 14px;
|
||||
line-height: 1.75;
|
||||
padding: 14px 16px;
|
||||
border-radius: 16px;
|
||||
word-break: break-word;
|
||||
color: #1f2937;
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 255, 0.92) 100%);
|
||||
border: 1px solid rgba(226, 233, 244, 0.95);
|
||||
backdrop-filter: blur(8px);
|
||||
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
.message-row.is-user & {
|
||||
background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
|
||||
border-color: rgba(59, 130, 246, 0.4);
|
||||
color: #fff;
|
||||
box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 11px;
|
||||
color: #8f9aae;
|
||||
padding: 4px 6px;
|
||||
|
||||
.message-row.is-user & {
|
||||
text-align: right;
|
||||
color: rgba(148, 163, 184, 0.9);
|
||||
}
|
||||
.message-row:not(.is-user) & {
|
||||
padding-left: 2px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
164
src/views/home/components/CommandList.vue
Normal file
164
src/views/home/components/CommandList.vue
Normal file
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div class="command-list">
|
||||
<div v-for="command in commandList" :key="command.id" class="command-card" @click="handleCommandClick(command)">
|
||||
<div class="command-icon">
|
||||
<el-icon :size="32" color="#3b82f6">
|
||||
<Lightning />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="command-content">
|
||||
<h3 class="command-name">{{ command.name }}</h3>
|
||||
<p class="command-desc">{{ command.description }}</p>
|
||||
<div class="command-trigger">
|
||||
<el-tag size="small" type="info">{{ command.trigger }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command-actions">
|
||||
<el-button text size="small" @click.stop="handleEdit(command)">
|
||||
<el-icon><Edit /></el-icon>
|
||||
</el-button>
|
||||
<el-button text size="small" type="danger" @click.stop="handleDelete(command)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { Lightning, Edit, Delete } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
interface Command {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
trigger: string;
|
||||
action: string;
|
||||
}
|
||||
|
||||
const commandList = ref<Command[]>([
|
||||
{
|
||||
id: 1,
|
||||
name: '快速创建组件',
|
||||
description: '快速创建一个 Vue 组件模板,包含基础结构和样式',
|
||||
trigger: '/component',
|
||||
action: 'create_component',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '生成 API 接口',
|
||||
description: '根据接口文档快速生成 API 请求函数',
|
||||
trigger: '/api',
|
||||
action: 'generate_api',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '代码格式化',
|
||||
description: '格式化当前文件的代码,统一代码风格',
|
||||
trigger: '/format',
|
||||
action: 'format_code',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '添加类型定义',
|
||||
description: '为 JavaScript 代码添加 TypeScript 类型定义',
|
||||
trigger: '/types',
|
||||
action: 'add_types',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: '生成测试用例',
|
||||
description: '为当前组件或函数生成单元测试代码',
|
||||
trigger: '/test',
|
||||
action: 'generate_test',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: '优化性能',
|
||||
description: '分析代码并提供性能优化建议',
|
||||
trigger: '/optimize',
|
||||
action: 'optimize_code',
|
||||
},
|
||||
]);
|
||||
|
||||
const handleCommandClick = (command: Command) => {
|
||||
ElMessage.success(`执行指令: ${command.name}`);
|
||||
};
|
||||
|
||||
const handleEdit = (command: Command) => {
|
||||
ElMessage.info(`编辑指令: ${command.name}`);
|
||||
};
|
||||
|
||||
const handleDelete = (command: Command) => {
|
||||
ElMessage.warning(`删除指令: ${command.name}`);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.command-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.command-card {
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
border: 1px solid #e5e7eb;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
align-items: flex-start;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||||
transform: translateY(-2px);
|
||||
border-color: #3b82f6;
|
||||
background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
|
||||
}
|
||||
}
|
||||
|
||||
.command-icon {
|
||||
flex-shrink: 0;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.command-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.command-name {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin: 0 0 8px 0;
|
||||
}
|
||||
|
||||
.command-desc {
|
||||
font-size: 13px;
|
||||
color: #6b7280;
|
||||
line-height: 1.5;
|
||||
margin: 0 0 12px 0;
|
||||
}
|
||||
|
||||
.command-trigger {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.command-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
</style>
|
||||
171
src/views/home/components/DiaryList.vue
Normal file
171
src/views/home/components/DiaryList.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div class="diary-list">
|
||||
<div v-for="diary in diaryList" :key="diary.id" class="diary-card" @click="handleDiaryClick(diary)">
|
||||
<div class="diary-header">
|
||||
<div class="diary-date">
|
||||
<el-icon><Calendar /></el-icon>
|
||||
{{ diary.date }}
|
||||
</div>
|
||||
<el-tag :type="diary.mood === 'happy' ? 'success' : diary.mood === 'sad' ? 'danger' : 'warning'" size="small">
|
||||
{{ getMoodText(diary.mood) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<h3 class="diary-title">{{ diary.title }}</h3>
|
||||
<p class="diary-content">{{ diary.content }}</p>
|
||||
<div class="diary-footer">
|
||||
<div class="diary-tags">
|
||||
<el-tag v-for="tag in diary.tags" :key="tag" size="small" effect="plain">{{ tag }}</el-tag>
|
||||
</div>
|
||||
<div class="diary-actions">
|
||||
<el-button text size="small" @click.stop="handleEdit(diary)">
|
||||
<el-icon><Edit /></el-icon>
|
||||
</el-button>
|
||||
<el-button text size="small" type="danger" @click.stop="handleDelete(diary)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { Calendar, Edit, Delete } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
interface Diary {
|
||||
id: number;
|
||||
title: string;
|
||||
content: string;
|
||||
date: string;
|
||||
mood: 'happy' | 'sad' | 'normal';
|
||||
tags: string[];
|
||||
}
|
||||
|
||||
const diaryList = ref<Diary[]>([
|
||||
{
|
||||
id: 1,
|
||||
title: '今天学习了 Vue 3 新特性',
|
||||
content: '今天深入学习了 Vue 3 的 Composition API,感觉比 Options API 更加灵活和强大。特别是 setup 函数和响应式系统的改进,让代码组织更加清晰...',
|
||||
date: '2026-05-26',
|
||||
mood: 'happy',
|
||||
tags: ['学习', 'Vue3', '前端'],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '项目进度顺利',
|
||||
content: '今天完成了首页重构的基础布局,整体效果不错。明天继续完善功能模块和样式细节...',
|
||||
date: '2026-05-25',
|
||||
mood: 'happy',
|
||||
tags: ['工作', '项目'],
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '遇到了一些技术难题',
|
||||
content: '在处理复杂组件通信时遇到了一些问题,花了不少时间调试。最后通过重新设计数据流解决了...',
|
||||
date: '2026-05-24',
|
||||
mood: 'normal',
|
||||
tags: ['技术', '调试'],
|
||||
},
|
||||
]);
|
||||
|
||||
const getMoodText = (mood: string) => {
|
||||
const moodMap: Record<string, string> = {
|
||||
happy: '😊 开心',
|
||||
sad: '😢 难过',
|
||||
normal: '😐 平静',
|
||||
};
|
||||
return moodMap[mood] || '平静';
|
||||
};
|
||||
|
||||
const handleDiaryClick = (diary: Diary) => {
|
||||
ElMessage.info(`查看日记: ${diary.title}`);
|
||||
};
|
||||
|
||||
const handleEdit = (diary: Diary) => {
|
||||
ElMessage.info(`编辑日记: ${diary.title}`);
|
||||
};
|
||||
|
||||
const handleDelete = (diary: Diary) => {
|
||||
ElMessage.warning(`删除日记: ${diary.title}`);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.diary-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.diary-card {
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
border: 1px solid #e5e7eb;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||||
transform: translateY(-2px);
|
||||
border-color: #3b82f6;
|
||||
}
|
||||
}
|
||||
|
||||
.diary-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.diary-date {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 13px;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
.diary-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin: 0 0 12px 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.diary-content {
|
||||
font-size: 14px;
|
||||
color: #6b7280;
|
||||
line-height: 1.6;
|
||||
margin: 0 0 16px 0;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.diary-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid #f3f4f6;
|
||||
}
|
||||
|
||||
.diary-tags {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.diary-actions {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
</style>
|
||||
199
src/views/home/components/FileList.vue
Normal file
199
src/views/home/components/FileList.vue
Normal file
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div class="file-list">
|
||||
<div v-for="file in fileList" :key="file.id" class="file-card" @click="handleFileClick(file)">
|
||||
<div class="file-icon">
|
||||
<el-icon :size="40" :color="getFileColor(file.type)">
|
||||
<component :is="getFileIcon(file.type)" />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="file-info">
|
||||
<h3 class="file-name">{{ file.name }}</h3>
|
||||
<div class="file-meta">
|
||||
<span class="file-size">{{ file.size }}</span>
|
||||
<span class="file-date">{{ file.date }}</span>
|
||||
</div>
|
||||
<div class="file-tags">
|
||||
<el-tag v-for="tag in file.tags" :key="tag" size="small" effect="plain">{{ tag }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div class="file-actions">
|
||||
<el-button text size="small" @click.stop="handleDownload(file)">
|
||||
<el-icon><Download /></el-icon>
|
||||
</el-button>
|
||||
<el-button text size="small" type="danger" @click.stop="handleDelete(file)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { Document, Picture, VideoPlay, Folder, Download, Delete } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
interface FileItem {
|
||||
id: number;
|
||||
name: string;
|
||||
type: 'document' | 'image' | 'video' | 'folder';
|
||||
size: string;
|
||||
date: string;
|
||||
tags: string[];
|
||||
}
|
||||
|
||||
const fileList = ref<FileItem[]>([
|
||||
{
|
||||
id: 1,
|
||||
name: 'Vue3 学习笔记.pdf',
|
||||
type: 'document',
|
||||
size: '2.5 MB',
|
||||
date: '2026-05-26',
|
||||
tags: ['学习', '文档'],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '项目截图.png',
|
||||
type: 'image',
|
||||
size: '856 KB',
|
||||
date: '2026-05-25',
|
||||
tags: ['截图', '项目'],
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '演示视频.mp4',
|
||||
type: 'video',
|
||||
size: '15.3 MB',
|
||||
date: '2026-05-24',
|
||||
tags: ['视频', '演示'],
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '项目文档',
|
||||
type: 'folder',
|
||||
size: '12 个文件',
|
||||
date: '2026-05-23',
|
||||
tags: ['文件夹'],
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: 'API 接口文档.docx',
|
||||
type: 'document',
|
||||
size: '1.2 MB',
|
||||
date: '2026-05-22',
|
||||
tags: ['文档', 'API'],
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: 'UI 设计稿.sketch',
|
||||
type: 'image',
|
||||
size: '4.8 MB',
|
||||
date: '2026-05-21',
|
||||
tags: ['设计', 'UI'],
|
||||
},
|
||||
]);
|
||||
|
||||
const getFileIcon = (type: string) => {
|
||||
const iconMap: Record<string, any> = {
|
||||
document: Document,
|
||||
image: Picture,
|
||||
video: VideoPlay,
|
||||
folder: Folder,
|
||||
};
|
||||
return iconMap[type] || Document;
|
||||
};
|
||||
|
||||
const getFileColor = (type: string) => {
|
||||
const colorMap: Record<string, string> = {
|
||||
document: '#3b82f6',
|
||||
image: '#10b981',
|
||||
video: '#f59e0b',
|
||||
folder: '#8b5cf6',
|
||||
};
|
||||
return colorMap[type] || '#6b7280';
|
||||
};
|
||||
|
||||
const handleFileClick = (file: FileItem) => {
|
||||
ElMessage.info(`打开文件: ${file.name}`);
|
||||
};
|
||||
|
||||
const handleDownload = (file: FileItem) => {
|
||||
ElMessage.success(`下载文件: ${file.name}`);
|
||||
};
|
||||
|
||||
const handleDelete = (file: FileItem) => {
|
||||
ElMessage.warning(`删除文件: ${file.name}`);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.file-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.file-card {
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
border: 1px solid #e5e7eb;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
align-items: flex-start;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||||
transform: translateY(-2px);
|
||||
border-color: #3b82f6;
|
||||
}
|
||||
}
|
||||
|
||||
.file-icon {
|
||||
flex-shrink: 0;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f3f4f6;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.file-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.file-name {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin: 0 0 8px 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.file-meta {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
font-size: 13px;
|
||||
color: #6b7280;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.file-tags {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.file-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
</style>
|
||||
332
src/views/home/components/InputBar.vue
Normal file
332
src/views/home/components/InputBar.vue
Normal file
@@ -0,0 +1,332 @@
|
||||
<template>
|
||||
<div class="input-shell">
|
||||
<div class="input-card">
|
||||
<el-input
|
||||
v-model="message"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
:autosize="{ minRows: 2, maxRows: 5 }"
|
||||
placeholder="多说说你的偏好和要求,我会越用越懂你"
|
||||
class="message-input"
|
||||
@keydown.enter.exact="handleSend"
|
||||
/>
|
||||
|
||||
<div class="input-toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button circle class="tool-btn" @click="handleAttachment">
|
||||
<el-icon><Plus /></el-icon>
|
||||
</el-button>
|
||||
<el-dropdown trigger="click" @command="handleSkillSelect">
|
||||
<el-button class="pill-btn">
|
||||
{{ currentSkillDisplay }}
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="default">默认对话</el-dropdown-item>
|
||||
<el-dropdown-item command="code-review">代码审查</el-dropdown-item>
|
||||
<el-dropdown-item command="refactor">代码重构</el-dropdown-item>
|
||||
<el-dropdown-item command="writing">内容写作</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<el-button circle class="send-btn" :disabled="!message.trim()" @click="handleSend">
|
||||
<el-icon><Top /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 常用工作流胶囊 -->
|
||||
<div class="workflow-pills" v-if="commonWorkflows.length > 0">
|
||||
<div
|
||||
v-for="wf in commonWorkflows"
|
||||
:key="wf.id"
|
||||
class="workflow-pill"
|
||||
:class="{ active: selectedWorkflowId === wf.id }"
|
||||
@click="selectWorkflow(wf)"
|
||||
>
|
||||
<el-icon class="pill-icon">
|
||||
<component :is="wf.icon" />
|
||||
</el-icon>
|
||||
<span class="pill-text">{{ wf.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { Top, Plus, MagicStick, Document, CircleCheck } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
interface Emits {
|
||||
(e: 'send', message: string): void;
|
||||
}
|
||||
|
||||
interface Workflow {
|
||||
id: number;
|
||||
name: string;
|
||||
icon: any;
|
||||
prefix: string;
|
||||
editPath: string;
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
const router = useRouter();
|
||||
const message = ref('');
|
||||
const selectedSkill = ref('default');
|
||||
const selectedWorkflowId = ref<number | null>(null);
|
||||
|
||||
const skillLabels: Record<string, string> = {
|
||||
default: '选择技能',
|
||||
'code-review': '代码审查',
|
||||
refactor: '代码重构',
|
||||
writing: '内容写作',
|
||||
};
|
||||
|
||||
const currentSkillDisplay = computed(() => {
|
||||
return selectedSkill.value === 'default' ? '选择技能' : skillLabels[selectedSkill.value];
|
||||
});
|
||||
|
||||
const skills: Record<string, string> = {
|
||||
default: '',
|
||||
'code-review': '[技能:代码审查] 请帮我审查下面这段代码,找出潜在问题并给出改进建议:\n',
|
||||
refactor: '[技能:代码重构] 请帮我重构下面这段代码,提升可读性和可维护性:\n',
|
||||
writing: '[技能:内容写作] 请根据下面的需求帮我创作内容:\n',
|
||||
};
|
||||
|
||||
// 常用工作流列表
|
||||
const commonWorkflows: Workflow[] = [
|
||||
{
|
||||
id: 1,
|
||||
name: '审查+测试',
|
||||
icon: Document,
|
||||
prefix: '[工作流:审查+测试] 完成后请自动生成单元测试:\n',
|
||||
editPath: '/settings/workflow',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '文档再编码',
|
||||
icon: Document,
|
||||
prefix: '[工作流:文档再编码] 请先编写接口文档,再实现代码:\n',
|
||||
editPath: '/settings/workflow',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '代码重构',
|
||||
icon: Document,
|
||||
prefix: '[工作流:代码重构] 请帮我重构这段代码:\n',
|
||||
editPath: '/settings/workflow',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '需求分析',
|
||||
icon: Document,
|
||||
prefix: '[工作流:需求分析] 请帮我分析这个需求并拆解任务:\n',
|
||||
editPath: '/settings/workflow',
|
||||
},
|
||||
];
|
||||
|
||||
const handleSend = (event?: KeyboardEvent) => {
|
||||
if (event) event.preventDefault();
|
||||
const msg = message.value.trim();
|
||||
if (!msg) return;
|
||||
const skillPrefix = skills[selectedSkill.value] || '';
|
||||
const workflowPrefix = selectedWorkflowId.value !== null ? commonWorkflows.find((w) => w.id === selectedWorkflowId.value)?.prefix || '' : '';
|
||||
const finalMessage = (skillPrefix + workflowPrefix + msg).trim();
|
||||
emit('send', finalMessage);
|
||||
message.value = '';
|
||||
// 发送后清空选择
|
||||
selectedWorkflowId.value = null;
|
||||
};
|
||||
|
||||
const handleAttachment = () => {
|
||||
ElMessage.info('附件上传功能开发中...');
|
||||
};
|
||||
|
||||
const handleSkillSelect = (key: string | number | object) => {
|
||||
selectedSkill.value = String(key);
|
||||
if (selectedSkill.value !== 'default') {
|
||||
ElMessage.success(`已选择技能:${skillLabels[selectedSkill.value]}`);
|
||||
}
|
||||
};
|
||||
|
||||
const selectWorkflow = (wf: Workflow) => {
|
||||
if (selectedWorkflowId.value === wf.id) {
|
||||
selectedWorkflowId.value = null;
|
||||
ElMessage.info('已取消工作流');
|
||||
} else {
|
||||
selectedWorkflowId.value = wf.id;
|
||||
ElMessage.success(`已选择工作流:${wf.name}`);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.input-shell {
|
||||
position: relative;
|
||||
z-index: 12;
|
||||
margin-top: -20px;
|
||||
padding: 0 0 50px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.input-card {
|
||||
width: min(1060px, 82%);
|
||||
margin: 0 auto;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 100%),
|
||||
radial-gradient(120% 180% at 0% 0%, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 38%),
|
||||
radial-gradient(80% 120% at 100% 100%, rgba(168, 85, 247, 0.08) 0%, rgba(168, 85, 247, 0) 38%);
|
||||
border: 1px solid rgba(59, 130, 246, 0.28);
|
||||
border-radius: 20px;
|
||||
box-shadow:
|
||||
0 24px 48px rgba(15, 23, 42, 0.12),
|
||||
0 0 0 1px rgba(59, 130, 246, 0.08) inset,
|
||||
0 8px 16px rgba(37, 99, 235, 0.1);
|
||||
padding: 16px 18px 18px;
|
||||
backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
.message-input {
|
||||
:deep(.el-textarea__inner) {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
resize: none;
|
||||
padding: 8px 6px 14px;
|
||||
font-size: 15px;
|
||||
line-height: 1.65;
|
||||
color: #0f172a;
|
||||
background: transparent;
|
||||
min-height: 50px;
|
||||
font-weight: 500;
|
||||
|
||||
&::placeholder {
|
||||
color: #90a1b7;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.input-toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.toolbar-left,
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.tool-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px solid #d9e4f5;
|
||||
color: #5b6b84;
|
||||
background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
|
||||
box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
color: #2b4d8f;
|
||||
background: linear-gradient(135deg, #f0f7ff 0%, #e0edff 100%);
|
||||
border-color: #bfdbfe;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
.pill-btn {
|
||||
height: 32px;
|
||||
padding: 0 14px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid #dbe7f7;
|
||||
color: #30435f;
|
||||
background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(135deg, #f0f7ff 0%, #e0edff 100%);
|
||||
border-color: #bfdbfe;
|
||||
color: #1d4ed8;
|
||||
}
|
||||
}
|
||||
|
||||
.send-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: none;
|
||||
background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
|
||||
color: #fff;
|
||||
box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
filter: brightness(1.08);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.5;
|
||||
box-shadow: none;
|
||||
background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
|
||||
}
|
||||
}
|
||||
|
||||
/* 工作流胶囊样式 */
|
||||
.workflow-pills {
|
||||
margin-top: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid rgba(59, 130, 246, 0.15);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.workflow-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(59, 130, 246, 0.3);
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
color: #475569;
|
||||
|
||||
&:hover {
|
||||
border-color: #3b82f6;
|
||||
background: rgba(59, 130, 246, 0.08);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #3b82f6;
|
||||
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
||||
color: #ffffff;
|
||||
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
|
||||
.pill-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.pill-text {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
88
src/views/home/components/MainContent.vue
Normal file
88
src/views/home/components/MainContent.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<div class="main-content">
|
||||
<div v-if="activeMenu !== 'chat'" class="content-header">
|
||||
<h2 class="content-title">{{ currentTitle }}</h2>
|
||||
<div class="content-actions">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-body">
|
||||
<div class="chat-container" v-if="activeMenu === 'chat'">
|
||||
<ChatList />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import ChatList from './ChatList.vue';
|
||||
|
||||
interface Props {
|
||||
activeMenu: string;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const menuTitles: Record<string, string> = {
|
||||
chat: '对话',
|
||||
models: '模型管理',
|
||||
creation: '内容创作',
|
||||
};
|
||||
|
||||
const currentTitle = computed(() => menuTitles[props.activeMenu] || '首页');
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.main-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #ffffff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px 24px;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.content-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.content-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.content-body {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
background:
|
||||
radial-gradient(1200px 420px at 58% -120px, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0) 65%),
|
||||
radial-gradient(900px 320px at 20% 120%, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0) 68%),
|
||||
linear-gradient(180deg, #f8fbff 0%, #f5f7fb 100%);
|
||||
|
||||
/* 隐藏滚动条但保持滚动功能 */
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.chat-container {
|
||||
width: min(1060px, 82%);
|
||||
margin: 0 auto;
|
||||
padding: 20px 0 130px;
|
||||
}
|
||||
</style>
|
||||
207
src/views/home/components/ReplyList.vue
Normal file
207
src/views/home/components/ReplyList.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<div class="reply-list">
|
||||
<div v-for="reply in replyList" :key="reply.id" class="reply-card" @click="handleReplyClick(reply)">
|
||||
<div class="reply-header">
|
||||
<div class="reply-category">
|
||||
<el-tag :type="getCategoryType(reply.category)" size="small">{{ reply.category }}</el-tag>
|
||||
</div>
|
||||
<div class="reply-usage">
|
||||
<el-icon><ChatDotRound /></el-icon>
|
||||
<span>{{ reply.usageCount }} 次使用</span>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="reply-title">{{ reply.title }}</h3>
|
||||
<p class="reply-content">{{ reply.content }}</p>
|
||||
<div class="reply-footer">
|
||||
<div class="reply-tags">
|
||||
<el-tag v-for="tag in reply.tags" :key="tag" size="small" effect="plain">{{ tag }}</el-tag>
|
||||
</div>
|
||||
<div class="reply-actions">
|
||||
<el-button text size="small" @click.stop="handleCopy(reply)">
|
||||
<el-icon><CopyDocument /></el-icon>
|
||||
</el-button>
|
||||
<el-button text size="small" @click.stop="handleEdit(reply)">
|
||||
<el-icon><Edit /></el-icon>
|
||||
</el-button>
|
||||
<el-button text size="small" type="danger" @click.stop="handleDelete(reply)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { ChatDotRound, CopyDocument, Edit, Delete } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
interface Reply {
|
||||
id: number;
|
||||
title: string;
|
||||
content: string;
|
||||
category: string;
|
||||
tags: string[];
|
||||
usageCount: number;
|
||||
}
|
||||
|
||||
const replyList = ref<Reply[]>([
|
||||
{
|
||||
id: 1,
|
||||
title: '欢迎语',
|
||||
content: '您好!很高兴为您服务。请问有什么可以帮助您的吗?',
|
||||
category: '问候',
|
||||
tags: ['欢迎', '问候'],
|
||||
usageCount: 156,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '感谢回复',
|
||||
content: '非常感谢您的反馈!我们会继续努力为您提供更好的服务。',
|
||||
category: '感谢',
|
||||
tags: ['感谢', '反馈'],
|
||||
usageCount: 89,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '技术支持',
|
||||
content: '我已经收到您的问题,正在为您查询相关信息。请稍等片刻,我会尽快回复您。',
|
||||
category: '支持',
|
||||
tags: ['技术', '支持'],
|
||||
usageCount: 234,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: '道歉回复',
|
||||
content: '非常抱歉给您带来不便。我们会立即处理这个问题,并尽快给您一个满意的答复。',
|
||||
category: '道歉',
|
||||
tags: ['道歉', '问题'],
|
||||
usageCount: 45,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: '结束语',
|
||||
content: '如果您还有其他问题,随时欢迎联系我们。祝您生活愉快!',
|
||||
category: '结束',
|
||||
tags: ['结束', '祝福'],
|
||||
usageCount: 178,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
title: '产品介绍',
|
||||
content: '我们的产品采用最新技术,为您提供高效、稳定、安全的服务体验。',
|
||||
category: '介绍',
|
||||
tags: ['产品', '介绍'],
|
||||
usageCount: 67,
|
||||
},
|
||||
]);
|
||||
|
||||
const getCategoryType = (category: string) => {
|
||||
const typeMap: Record<string, any> = {
|
||||
问候: 'success',
|
||||
感谢: 'primary',
|
||||
支持: 'warning',
|
||||
道歉: 'danger',
|
||||
结束: 'info',
|
||||
介绍: '',
|
||||
};
|
||||
return typeMap[category] || '';
|
||||
};
|
||||
|
||||
const handleReplyClick = (reply: Reply) => {
|
||||
ElMessage.success(`使用快捷回复: ${reply.title}`);
|
||||
};
|
||||
|
||||
const handleCopy = (reply: Reply) => {
|
||||
navigator.clipboard.writeText(reply.content);
|
||||
ElMessage.success('已复制到剪贴板');
|
||||
};
|
||||
|
||||
const handleEdit = (reply: Reply) => {
|
||||
ElMessage.info(`编辑回复: ${reply.title}`);
|
||||
};
|
||||
|
||||
const handleDelete = (reply: Reply) => {
|
||||
ElMessage.warning(`删除回复: ${reply.title}`);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.reply-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.reply-card {
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
border: 1px solid #e5e7eb;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||||
transform: translateY(-2px);
|
||||
border-color: #3b82f6;
|
||||
}
|
||||
}
|
||||
|
||||
.reply-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.reply-category {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.reply-usage {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
.reply-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #1f2937;
|
||||
margin: 0 0 12px 0;
|
||||
}
|
||||
|
||||
.reply-content {
|
||||
font-size: 14px;
|
||||
color: #6b7280;
|
||||
line-height: 1.6;
|
||||
margin: 0 0 16px 0;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.reply-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid #f3f4f6;
|
||||
}
|
||||
|
||||
.reply-tags {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.reply-actions {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
</style>
|
||||
207
src/views/home/components/Sidebar.vue
Normal file
207
src/views/home/components/Sidebar.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<el-button class="new-chat-btn" @click="handleNewChat">
|
||||
<el-icon>
|
||||
<Plus />
|
||||
</el-icon>
|
||||
新增对话
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div v-if="historyList.length" class="history-section">
|
||||
<div class="history-title">历史对话</div>
|
||||
<div class="history-list">
|
||||
<div
|
||||
v-for="item in historyList"
|
||||
:key="item.id"
|
||||
class="history-item"
|
||||
:class="{ active: activeHistoryId === item.id }"
|
||||
@click="handleSelectHistory(item.id)"
|
||||
>
|
||||
<div class="history-main">
|
||||
<div class="history-name">{{ item.title }}</div>
|
||||
<div class="history-time">{{ item.time }}</div>
|
||||
</div>
|
||||
<el-button text class="delete-btn" @click.stop="handleDeleteHistory(item.id)">
|
||||
<el-icon>
|
||||
<Delete />
|
||||
</el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Plus, Delete } from '@element-plus/icons-vue';
|
||||
|
||||
interface HistoryItem {
|
||||
id: number;
|
||||
title: string;
|
||||
time: string;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
activeMenu: string;
|
||||
activeHistoryId: number;
|
||||
historyList: HistoryItem[];
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'menu-change', key: string): void;
|
||||
(e: 'new-chat'): void;
|
||||
(e: 'select-history', id: number): void;
|
||||
(e: 'delete-history', id: number): void;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
const handleNewChat = () => {
|
||||
emit('new-chat');
|
||||
};
|
||||
|
||||
const handleSelectHistory = (id: number) => {
|
||||
emit('select-history', id);
|
||||
};
|
||||
|
||||
const handleDeleteHistory = (id: number) => {
|
||||
emit('delete-history', id);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.sidebar {
|
||||
width: 252px;
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 251, 255, 0.92) 100%);
|
||||
border-right: 1px solid #e7edf7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
box-shadow: 8px 0 30px rgba(15, 23, 42, 0.06);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.sidebar-header {
|
||||
padding: 18px 16px 14px;
|
||||
border-bottom: 1px solid #e9eef7;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.new-chat-btn {
|
||||
margin-top: 0;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(59, 130, 246, 0.28);
|
||||
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.2px;
|
||||
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.26);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-1px);
|
||||
color: #ffffff;
|
||||
border-color: rgba(59, 130, 246, 0.4);
|
||||
background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
|
||||
box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
|
||||
}
|
||||
}
|
||||
|
||||
.history-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 8px;
|
||||
min-height: 0;
|
||||
background: linear-gradient(180deg, rgba(249, 251, 255, 0.5) 0%, rgba(249, 251, 255, 0.9) 100%);
|
||||
}
|
||||
|
||||
.history-title {
|
||||
padding: 12px 12px 8px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #64748b;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.8px;
|
||||
}
|
||||
|
||||
.history-list {
|
||||
flex: 1;
|
||||
padding: 0 8px 10px;
|
||||
overflow-y: auto;
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.history-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
padding: 10px 10px;
|
||||
margin-bottom: 6px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid transparent;
|
||||
cursor: pointer;
|
||||
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
|
||||
&:hover {
|
||||
border-color: #bfdbfe;
|
||||
background: linear-gradient(135deg, rgba(239, 246, 255, 0.9) 0%, rgba(219, 234, 254, 0.7) 100%);
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #3b82f6;
|
||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.04) 100%);
|
||||
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
opacity: 0;
|
||||
color: #94a3b8;
|
||||
transition: all 0.2s ease;
|
||||
padding: 4px;
|
||||
|
||||
&:hover {
|
||||
color: #ef4444;
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover .delete-btn {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.history-main {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.history-name {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #1e293b;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.history-time {
|
||||
font-size: 11px;
|
||||
color: #94a3b8;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,62 +1,61 @@
|
||||
<template>
|
||||
<el-dialog :title="isEdit ? '编辑数据集' : '新增数据集'" v-model="isShowDialog" width="600px" :close-on-click-modal="false" @close="onCancel">
|
||||
<el-form ref="formRef" :model="ruleForm" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="数据集名称" prop="name">
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入数据集名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数据集类型" prop="type">
|
||||
<el-select v-model="ruleForm.type" placeholder="请选择类型" clearable style="width: 100%">
|
||||
<el-option label="文本" value="text" />
|
||||
<el-option label="问答" value="qa" />
|
||||
<el-option label="表格" value="table" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="向量模型" prop="embeddingModel">
|
||||
<el-select v-model="ruleForm.embeddingModel" placeholder="请选择向量模型" clearable style="width: 100%">
|
||||
<el-option label="text-embedding-ada-002" value="text-embedding-ada-002" />
|
||||
<el-option label="text-embedding-3-small" value="text-embedding-3-small" />
|
||||
<el-option label="text-embedding-3-large" value="text-embedding-3-large" />
|
||||
<el-option label="bge-large-zh" value="bge-large-zh" />
|
||||
<el-option label="m3e-base" value="m3e-base" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="ruleForm.description" type="textarea" :rows="4" placeholder="请输入数据集描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" v-if="isEdit">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="文档数量">
|
||||
<el-input :value="ruleForm.documentCount" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="字符数量">
|
||||
<el-input :value="ruleForm.charCount" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :loading="submitLoading">{{ isEdit ? '保 存' : '创 建' }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog :title="isEdit ? '编辑数据集' : '新增数据集'" v-model="isShowDialog" width="600px" :close-on-click-modal="false" @close="onCancel">
|
||||
<el-form ref="formRef" :model="ruleForm" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="数据集名称" prop="name">
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入数据集名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数据集类型" prop="datasetType">
|
||||
<el-select v-model="ruleForm.datasetType" placeholder="请选择类型" clearable style="width: 100%">
|
||||
<el-option label="文本" :value="1" />
|
||||
<el-option label="视频" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="向量模型" prop="embeddingModel">
|
||||
<el-select v-model="ruleForm.embeddingModel" placeholder="请选择向量模型" clearable style="width: 100%">
|
||||
<el-option label="text-embedding-ada-002" value="text-embedding-ada-002" />
|
||||
<el-option label="text-embedding-3-small" value="text-embedding-3-small" />
|
||||
<el-option label="text-embedding-3-large" value="text-embedding-3-large" />
|
||||
<el-option label="bge-large-zh" value="bge-large-zh" />
|
||||
<el-option label="m3e-base" value="m3e-base" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="ruleForm.description" type="textarea" :rows="4" placeholder="请输入数据集描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" v-if="isEdit">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="文档数量">
|
||||
<el-input :value="ruleForm.documentCount" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="字符数量">
|
||||
<el-input :value="ruleForm.charCount" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :loading="submitLoading">{{ isEdit ? '保 存' : '创 建' }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -86,7 +85,7 @@ const submitLoading = ref(false);
|
||||
const ruleForm = reactive({
|
||||
id: '',
|
||||
name: '',
|
||||
type: 'text',
|
||||
datasetType: 1 as number,
|
||||
description: '',
|
||||
embeddingModel: 'text-embedding-ada-002',
|
||||
documentCount: 0,
|
||||
@@ -96,7 +95,7 @@ const ruleForm = reactive({
|
||||
// 表单验证规则
|
||||
const rules = reactive<FormRules>({
|
||||
name: [{ required: true, message: '请输入数据集名称', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '请选择数据集类型', trigger: 'change' }],
|
||||
datasetType: [{ required: true, message: '请选择数据集类型', trigger: 'change' }],
|
||||
embeddingModel: [{ required: true, message: '请选择向量模型', trigger: 'change' }],
|
||||
});
|
||||
|
||||
@@ -104,7 +103,7 @@ const rules = reactive<FormRules>({
|
||||
const resetForm = () => {
|
||||
ruleForm.id = '';
|
||||
ruleForm.name = '';
|
||||
ruleForm.type = 'text';
|
||||
ruleForm.datasetType = 1;
|
||||
ruleForm.description = '';
|
||||
ruleForm.embeddingModel = 'text-embedding-ada-002';
|
||||
ruleForm.documentCount = 0;
|
||||
@@ -122,7 +121,7 @@ const openDialog = async (row?: any) => {
|
||||
const data = res.data || row;
|
||||
ruleForm.id = data.id || '';
|
||||
ruleForm.name = data.name || '';
|
||||
ruleForm.type = data.type || 'text';
|
||||
ruleForm.datasetType = data.datasetType || 1;
|
||||
ruleForm.description = data.description || '';
|
||||
ruleForm.embeddingModel = data.embeddingModel || 'text-embedding-ada-002';
|
||||
ruleForm.documentCount = data.documentCount || 0;
|
||||
@@ -132,7 +131,7 @@ const openDialog = async (row?: any) => {
|
||||
// 使用传入的row数据
|
||||
ruleForm.id = row.id || '';
|
||||
ruleForm.name = row.name || '';
|
||||
ruleForm.type = row.type || 'text';
|
||||
ruleForm.datasetType = row.datasetType || 1;
|
||||
ruleForm.description = row.description || '';
|
||||
ruleForm.embeddingModel = row.embeddingModel || 'text-embedding-ada-002';
|
||||
ruleForm.documentCount = row.documentCount || 0;
|
||||
@@ -161,7 +160,7 @@ const onSubmit = async () => {
|
||||
const data = {
|
||||
id: ruleForm.id || undefined,
|
||||
name: ruleForm.name,
|
||||
type: ruleForm.type,
|
||||
datasetType: ruleForm.datasetType,
|
||||
description: ruleForm.description,
|
||||
embeddingModel: ruleForm.embeddingModel,
|
||||
status: 'enable',
|
||||
|
||||
@@ -1,107 +1,106 @@
|
||||
<template>
|
||||
<div class="knowledge-knowledge-page">
|
||||
<div class="knowledge-knowledge-container">
|
||||
<el-card shadow="hover">
|
||||
<div class="knowledge-knowledge-search mb15">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="数据集名称">
|
||||
<el-input size="default" v-model="tableData.param.keyword" placeholder="请输入数据集名称" clearable style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据集类型">
|
||||
<el-select size="default" v-model="tableData.param.type" placeholder="请选择类型" clearable style="width: 150px">
|
||||
<el-option label="文本" value="text" />
|
||||
<el-option label="问答" value="qa" />
|
||||
<el-option label="表格" value="table" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select size="default" v-model="tableData.param.status" placeholder="请选择状态" clearable style="width: 120px">
|
||||
<el-option label="启用" value="enable" />
|
||||
<el-option label="禁用" value="disable" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="default" type="primary" @click="getknowledgeList">
|
||||
<el-icon><ele-Search /></el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button size="default" @click="onResetQuery">
|
||||
<el-icon><ele-Refresh /></el-icon>
|
||||
重置
|
||||
</el-button>
|
||||
<el-button size="default" type="success" @click="onOpenAdd" v-auth="'api/v1/knowledge/knowledge/create'">
|
||||
<el-icon><ele-Plus /></el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table :data="tableData.data" style="width: 100%" v-loading="tableData.loading" border>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="name" label="数据集名称" min-width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="onViewDetail(scope.row)">{{ scope.row.name }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="类型" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getTypeTagType(scope.row.type)">{{ getTypeText(scope.row.type) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="documentCount" label="文档数" width="100" align="center" />
|
||||
<el-table-column prop="charCount" label="字符数" width="120" align="center">
|
||||
<template #default="scope">
|
||||
{{ formatCharCount(scope.row.charCount) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="embeddingModel" label="向量模型" width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.statusEnabled"
|
||||
inline-prompt
|
||||
active-text="启"
|
||||
inactive-text="停"
|
||||
@change="onStatusChange(scope.row)"
|
||||
v-auth="'api/v1/knowledge/knowledge/updateStatus'"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createdAt" label="创建时间" width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="updatedAt" label="更新时间" width="170" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="200" fixed="right" align="center">
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="onEdit(scope.row)" v-auth="'api/v1/knowledge/knowledge/update'">编辑</el-button>
|
||||
<el-button size="small" text type="success" @click="onManageDocuments(scope.row)">文档</el-button>
|
||||
<el-button size="small" text type="danger" @click="onRowDel(scope.row)" v-auth="'api/v1/knowledge/knowledge/delete'">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<div class="mt15" style="text-align: right">
|
||||
<el-pagination
|
||||
v-model:current-page="tableData.param.pageNum"
|
||||
v-model:page-size="tableData.param.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="tableData.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="onSizeChange"
|
||||
@current-change="onCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<div class="knowledge-knowledge-page">
|
||||
<div class="knowledge-knowledge-container">
|
||||
<el-card shadow="hover">
|
||||
<div class="knowledge-knowledge-search mb15">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="数据集名称">
|
||||
<el-input size="default" v-model="tableData.param.keyword" placeholder="请输入数据集名称" clearable style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据集类型">
|
||||
<el-select size="default" v-model="tableData.param.datasetType" placeholder="请选择类型" clearable style="width: 150px">
|
||||
<el-option label="文本" :value="1" />
|
||||
<el-option label="视频" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select size="default" v-model="tableData.param.status" placeholder="请选择状态" clearable style="width: 120px">
|
||||
<el-option label="启用" value="enable" />
|
||||
<el-option label="禁用" value="disable" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="default" type="primary" @click="getknowledgeList">
|
||||
<el-icon><ele-Search /></el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button size="default" @click="onResetQuery">
|
||||
<el-icon><ele-Refresh /></el-icon>
|
||||
重置
|
||||
</el-button>
|
||||
<el-button size="default" type="success" @click="onOpenAdd" v-auth="'api/v1/knowledge/knowledge/create'">
|
||||
<el-icon><ele-Plus /></el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table :data="tableData.data" style="width: 100%" v-loading="tableData.loading" border>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="name" label="数据集名称" min-width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="onViewDetail(scope.row)">{{ scope.row.name }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="datasetType" label="类型" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getTypeTagType(scope.row.datasetType)">{{ getTypeText(scope.row.datasetType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="documentCount" label="文档数" width="100" align="center" />
|
||||
<el-table-column prop="charCount" label="字符数" width="120" align="center">
|
||||
<template #default="scope">
|
||||
{{ formatCharCount(scope.row.charCount) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="embeddingModel" label="向量模型" width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.statusEnabled"
|
||||
inline-prompt
|
||||
active-text="启"
|
||||
inactive-text="停"
|
||||
@change="onStatusChange(scope.row)"
|
||||
v-auth="'api/v1/knowledge/knowledge/updateStatus'"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createdAt" label="创建时间" width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="updatedAt" label="更新时间" width="170" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="200" fixed="right" align="center">
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="onEdit(scope.row)" v-auth="'api/v1/knowledge/knowledge/update'">编辑</el-button>
|
||||
<el-button size="small" text type="success" @click="onManageDocuments(scope.row)">文档</el-button>
|
||||
<el-button size="small" text type="danger" @click="onRowDel(scope.row)" v-auth="'api/v1/knowledge/knowledge/delete'">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<div class="mt15" style="text-align: right">
|
||||
<el-pagination
|
||||
v-model:current-page="tableData.param.pageNum"
|
||||
v-model:page-size="tableData.param.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="tableData.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="onSizeChange"
|
||||
@current-change="onCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<Editknowledge ref="editknowledgeRef" @getknowledgeList="getknowledgeList" />
|
||||
</div>
|
||||
<Editknowledge ref="editknowledgeRef" @getknowledgeList="getknowledgeList" />
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'knowledgeknowledge',
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
@@ -117,7 +116,7 @@ const tableData = reactive({
|
||||
loading: false,
|
||||
param: {
|
||||
keyword: '',
|
||||
type: '',
|
||||
datasetType: undefined as number | undefined,
|
||||
status: undefined as string | undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -148,30 +147,26 @@ const getknowledgeList = async () => {
|
||||
};
|
||||
|
||||
// 获取类型标签类型
|
||||
const getTypeTagType = (type: string) => {
|
||||
switch (type) {
|
||||
case 'text':
|
||||
const getTypeTagType = (datasetType: number) => {
|
||||
switch (datasetType) {
|
||||
case 1:
|
||||
return 'primary';
|
||||
case 'qa':
|
||||
case 2:
|
||||
return 'success';
|
||||
case 'table':
|
||||
return 'warning';
|
||||
default:
|
||||
return 'info';
|
||||
}
|
||||
};
|
||||
|
||||
// 获取类型文本
|
||||
const getTypeText = (type: string) => {
|
||||
switch (type) {
|
||||
case 'text':
|
||||
const getTypeText = (datasetType: number) => {
|
||||
switch (datasetType) {
|
||||
case 1:
|
||||
return '文本';
|
||||
case 'qa':
|
||||
return '问答';
|
||||
case 'table':
|
||||
return '表格';
|
||||
case 2:
|
||||
return '视频';
|
||||
default:
|
||||
return type;
|
||||
return String(datasetType);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -187,7 +182,7 @@ const formatCharCount = (count: number) => {
|
||||
// 重置查询
|
||||
const onResetQuery = () => {
|
||||
tableData.param.keyword = '';
|
||||
tableData.param.type = '';
|
||||
tableData.param.datasetType = undefined;
|
||||
tableData.param.status = undefined;
|
||||
tableData.param.pageNum = 1;
|
||||
getknowledgeList();
|
||||
@@ -261,9 +256,9 @@ const onCurrentChange = (page: number) => {
|
||||
onMounted(() => {
|
||||
getknowledgeList();
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="scss">
|
||||
.knowledge-knowledge-page {
|
||||
padding: 15px;
|
||||
.knowledge-knowledge-container {
|
||||
@@ -274,4 +269,4 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
<template #default="{ row }">
|
||||
<el-button text size="small" v-debounce @click="onPreviewFile(row)">预览</el-button>
|
||||
<el-button v-if="row.vectorStatus === 1" text size="small" type="primary" v-debounce @click="onGenerateVector(row)"
|
||||
>生成向量</el-button
|
||||
>生成向量</el-button
|
||||
>
|
||||
<el-button v-else text size="small" type="primary" v-debounce @click="onViewTaskList(row)">查看任务</el-button>
|
||||
<el-button text size="small" type="danger" v-debounce @click="onDeleteFile(row)">删除</el-button>
|
||||
@@ -233,6 +233,12 @@
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="knowledgeForm.name" placeholder="请输入知识库名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据集类型" prop="datasetType">
|
||||
<el-select v-model="knowledgeForm.datasetType" placeholder="请选择类型" clearable style="width: 100%">
|
||||
<el-option label="文本" :value="1" />
|
||||
<el-option label="视频" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="knowledgeForm.description" type="textarea" :rows="3" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
@@ -469,10 +475,12 @@ const knowledgeFormRef = ref<FormInstance>();
|
||||
const knowledgeForm = reactive({
|
||||
id: '',
|
||||
name: '',
|
||||
datasetType: undefined as number | undefined,
|
||||
description: '',
|
||||
});
|
||||
const knowledgeRules = reactive<FormRules>({
|
||||
name: [{ required: true, message: '请输入知识库名称', trigger: 'blur' }],
|
||||
datasetType: [{ required: true, message: '请选择数据集类型', trigger: 'change' }],
|
||||
});
|
||||
|
||||
// 文件列表(含OSS上传结果)
|
||||
@@ -555,6 +563,7 @@ const getknowledgeList = async () => {
|
||||
const response = await listknowledges({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
datasetType: 1,
|
||||
});
|
||||
knowledgeList.value = response.data.list || [];
|
||||
} catch (_error) {
|
||||
@@ -576,6 +585,7 @@ const onSelectknowledge = (item: any) => {
|
||||
const onAddknowledge = () => {
|
||||
knowledgeForm.id = '';
|
||||
knowledgeForm.name = '';
|
||||
knowledgeForm.datasetType = undefined;
|
||||
knowledgeForm.description = '';
|
||||
showknowledgeDialog.value = true;
|
||||
};
|
||||
@@ -594,6 +604,7 @@ const onCardContextMenu = (event: MouseEvent, item: any) => {
|
||||
const onRenameknowledge = (item: any) => {
|
||||
knowledgeForm.id = item.id;
|
||||
knowledgeForm.name = item.name;
|
||||
knowledgeForm.datasetType = item.datasetType;
|
||||
knowledgeForm.description = item.description || '';
|
||||
showknowledgeDialog.value = true;
|
||||
};
|
||||
@@ -634,14 +645,17 @@ const onSaveknowledge = async () => {
|
||||
await updateknowledge({
|
||||
id: knowledgeForm.id,
|
||||
name: knowledgeForm.name,
|
||||
datasetType: knowledgeForm.datasetType,
|
||||
description: knowledgeForm.description,
|
||||
});
|
||||
} else {
|
||||
// 创建知识库
|
||||
await createknowledge({
|
||||
const params = {
|
||||
name: knowledgeForm.name,
|
||||
datasetType: knowledgeForm.datasetType as number,
|
||||
description: knowledgeForm.description,
|
||||
});
|
||||
};
|
||||
await createknowledge(params);
|
||||
}
|
||||
|
||||
ElMessage.success(knowledgeForm.id ? '保存成功' : '创建成功');
|
||||
@@ -988,7 +1002,7 @@ const onSaveModelConfig = async () => {
|
||||
// 构建请求数据,只传递接口需要的字段
|
||||
const data = {
|
||||
modelType: selectedModelType.value,
|
||||
configType: selectedConfigType.value,
|
||||
configType: selectedConfigType,
|
||||
modelName: modelFormData.value.modelName,
|
||||
modelDesc: modelFormData.value.modelDesc,
|
||||
configContent: {} as Record<string, any>,
|
||||
|
||||
@@ -87,7 +87,7 @@ export default defineComponent({
|
||||
isShowPassword: false,
|
||||
ruleForm: {
|
||||
username: 'admin',
|
||||
password: '123456',
|
||||
password: 'Tongli686^*^',
|
||||
verifyCode: '',
|
||||
verifyKey: '',
|
||||
},
|
||||
|
||||
@@ -1,221 +1,540 @@
|
||||
<template>
|
||||
<template>
|
||||
<div class="cid-apis-container">
|
||||
<el-card shadow="hover">
|
||||
<div class="system-user-search mb15">
|
||||
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
|
||||
<el-form-item label="关键字" prop="keyword">
|
||||
<el-input
|
||||
v-model="tableData.param.keyword"
|
||||
placeholder="请输入接口名称"
|
||||
clearable
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="getList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="default" type="primary" @click="getList">
|
||||
<el-icon><ele-Search /></el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button size="default" @click="resetQuery(queryRef)">
|
||||
<el-icon><ele-Refresh /></el-icon>
|
||||
重置
|
||||
</el-button>
|
||||
<el-button size="default" type="success" @click="onOpenAdd">
|
||||
<el-icon><ele-FolderAdd /></el-icon>
|
||||
新增接口
|
||||
</el-button>
|
||||
<el-button size="default" type="danger" @click="onRowDel(null)">
|
||||
<el-icon><ele-Delete /></el-icon>
|
||||
删除
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column prop="name" label="接口名称" show-overflow-tooltip />
|
||||
<el-table-column prop="path" label="接口路径" show-overflow-tooltip />
|
||||
<el-table-column prop="method" label="请求方式" width="100" align="center" />
|
||||
<el-table-column prop="datasourceName" label="所属平台" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ scope.row.status === 1 ? '启用' : '禁用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createdAt" label="创建时间" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="180">
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="onOpenEdit(scope.row)">修改</el-button>
|
||||
<el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="tableData.total > 0"
|
||||
:total="tableData.total"
|
||||
v-model:page="tableData.param.pageNum"
|
||||
v-model:limit="tableData.param.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" :close-on-click-modal="false">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="90px">
|
||||
<el-form-item label="接口名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入接口名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="接口路径" prop="path">
|
||||
<el-input v-model="form.path" placeholder="请输入接口路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请求方式" prop="method">
|
||||
<el-select v-model="form.method" style="width: 100%">
|
||||
<el-option label="GET" value="GET" />
|
||||
<el-option label="POST" value="POST" />
|
||||
<el-option label="PUT" value="PUT" />
|
||||
<el-option label="DELETE" value="DELETE" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属平台" prop="datasourceId">
|
||||
<el-input v-model="form.datasourceId" placeholder="请输入所属平台ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" style="width: 100%">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="禁用" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :loading="dialog.saving">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-card shadow="hover"
|
||||
><el-tabs v-model="tab" @tab-change="onTab"
|
||||
><el-tab-pane label="平台管理" name="platform"
|
||||
><el-form ref="pqf" :model="pq" :inline="true" label-width="68px" class="mb15"
|
||||
><el-form-item label="关键字" prop="keyword"
|
||||
><el-input
|
||||
v-model="pq.keyword"
|
||||
placeholder="请输入平台名称/编码"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="searchPlatform" /></el-form-item
|
||||
><el-form-item label="状态" prop="status"
|
||||
><el-select v-model="pq.status" placeholder="平台状态" clearable style="width: 160px"
|
||||
><el-option label="启用" value="ACTIVE" /><el-option label="禁用" value="INACTIVE" /></el-select></el-form-item
|
||||
><el-form-item
|
||||
><el-button type="primary" @click="searchPlatform"
|
||||
><el-icon><ele-Search /></el-icon>查询</el-button
|
||||
><el-button @click="resetPlatformQuery"
|
||||
><el-icon><ele-Refresh /></el-icon>重置</el-button
|
||||
><el-button type="success" @click="openPlatform()"
|
||||
><el-icon><ele-FolderAdd /></el-icon>新增平台</el-button
|
||||
></el-form-item
|
||||
></el-form
|
||||
><el-table :data="platformRows" row-key="id" v-loading="platformLoading"
|
||||
><el-table-column type="index" label="序号" width="60" /><el-table-column
|
||||
prop="platformCode"
|
||||
label="平台编码"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="platformName" label="平台名称" min-width="160" show-overflow-tooltip /><el-table-column
|
||||
prop="apiBaseUrl"
|
||||
label="API地址"
|
||||
min-width="220"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="authType" label="认证" width="100" align="center" /><el-table-column
|
||||
prop="status"
|
||||
label="状态"
|
||||
width="90"
|
||||
align="center"
|
||||
><template #default="s"
|
||||
><el-tag size="small" :type="s.row.status === 'ACTIVE' ? 'success' : 'danger'">{{
|
||||
s.row.status === 'ACTIVE' ? '启用' : '禁用'
|
||||
}}</el-tag></template
|
||||
></el-table-column
|
||||
><el-table-column prop="rateLimitPerMinute" label="限流/分钟" width="110" align="center" /><el-table-column
|
||||
prop="requestTimeoutMs"
|
||||
label="超时(ms)"
|
||||
width="110"
|
||||
align="center"
|
||||
/><el-table-column label="创建时间" width="170"
|
||||
><template #default="s">{{ ft(s.row.createdAt) }}</template></el-table-column
|
||||
><el-table-column label="操作" width="150" fixed="right"
|
||||
><template #default="s"
|
||||
><el-button size="small" text type="primary" @click="openPlatform(s.row)">修改</el-button
|
||||
><el-button size="small" text type="danger" @click="delPlatform(s.row)">删除</el-button></template
|
||||
></el-table-column
|
||||
></el-table
|
||||
><pagination :total="platformTotal" v-model:page="pq.pageNum" v-model:limit="pq.pageSize" @pagination="getPlatforms" /></el-tab-pane
|
||||
><el-tab-pane label="接口管理" name="api"
|
||||
><el-form ref="aqf" :model="aq" :inline="true" label-width="68px" class="mb15"
|
||||
><el-form-item label="关键字" prop="keyword"
|
||||
><el-input
|
||||
v-model="aq.keyword"
|
||||
placeholder="请输入接口名称/编码"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
@keyup.enter.native="searchApi" /></el-form-item
|
||||
><el-form-item label="平台" prop="platformId"
|
||||
><el-select v-model="aq.platformId" placeholder="请选择平台" clearable filterable style="width: 180px"
|
||||
><el-option v-for="i in platforms" :key="i.id" :label="i.platformName" :value="String(i.id)" /></el-select></el-form-item
|
||||
><el-form-item label="状态" prop="status"
|
||||
><el-select v-model="aq.status" placeholder="状态" clearable style="width: 130px"
|
||||
><el-option label="启用" value="active" /><el-option label="禁用" value="inactive" /></el-select></el-form-item
|
||||
><el-form-item label="方法" prop="method"
|
||||
><el-select v-model="aq.method" placeholder="请求方式" clearable style="width: 130px"
|
||||
><el-option v-for="m in methods" :key="m" :label="m" :value="m" /></el-select></el-form-item
|
||||
><el-form-item
|
||||
><el-button type="primary" @click="searchApi"
|
||||
><el-icon><ele-Search /></el-icon>查询</el-button
|
||||
><el-button @click="resetApiQuery"
|
||||
><el-icon><ele-Refresh /></el-icon>重置</el-button
|
||||
><el-button type="success" @click="openApi()"
|
||||
><el-icon><ele-FolderAdd /></el-icon>新增接口</el-button
|
||||
></el-form-item
|
||||
></el-form
|
||||
><el-table :data="apiRows" v-loading="apiLoading"
|
||||
><el-table-column type="index" label="序号" width="60" /><el-table-column
|
||||
prop="code"
|
||||
label="接口编码"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="name" label="接口名称" min-width="150" show-overflow-tooltip /><el-table-column
|
||||
prop="url"
|
||||
label="URL"
|
||||
min-width="220"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="method" label="请求方式" width="100" align="center"
|
||||
><template #default="s"
|
||||
><el-tag size="small" :type="s.row.method === 'GET' ? 'success' : 'primary'">{{ s.row.method }}</el-tag></template
|
||||
></el-table-column
|
||||
><el-table-column prop="status" label="状态" width="90" align="center"
|
||||
><template #default="s"
|
||||
><el-tag size="small" :type="ns(s.row.status) === 'active' ? 'success' : 'danger'">{{
|
||||
ns(s.row.status) === 'active' ? '启用' : '禁用'
|
||||
}}</el-tag></template
|
||||
></el-table-column
|
||||
><el-table-column prop="platformName" label="所属平台" min-width="140" show-overflow-tooltip /> ><el-table-column
|
||||
label="创建时间"
|
||||
width="170"
|
||||
><template #default="s">{{ ft(s.row.createdAt) }}</template></el-table-column
|
||||
><el-table-column label="操作" width="160" fixed="right"
|
||||
><template #default="s"
|
||||
><el-button size="small" text type="primary" @click="openApi(String(s.row.id))">修改</el-button
|
||||
><el-button size="small" text type="danger" @click="delApi(s.row)">删除</el-button></template
|
||||
></el-table-column
|
||||
></el-table
|
||||
><pagination :total="apiTotal" v-model:page="aq.pageNum" v-model:limit="aq.pageSize" @pagination="getApis" /></el-tab-pane></el-tabs
|
||||
></el-card>
|
||||
<el-dialog v-model="platformDialog.visible" :title="platformDialog.title" width="720px" :close-on-click-modal="false" destroy-on-close
|
||||
><el-form ref="platformFormRef" :model="platformForm" :rules="platformRules" label-width="120px" v-loading="platformDialog.loading"
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="平台编码" prop="platformCode"><el-input v-model="platformForm.platformCode" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="平台名称" prop="platformName"><el-input v-model="platformForm.platformName" /></el-form-item></el-col></el-row
|
||||
><el-form-item label="平台描述"><el-input v-model="platformForm.description" type="textarea" :rows="3" /></el-form-item
|
||||
><el-form-item label="API地址"><el-input v-model="platformForm.apiBaseUrl" /></el-form-item
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="认证类型" prop="authType"
|
||||
><el-select v-model="platformForm.authType" style="width: 100%"
|
||||
><el-option label="Token" value="TOKEN" /><el-option label="API Key" value="API_KEY" /><el-option
|
||||
label="OAuth2"
|
||||
value="OAUTH2" /><el-option label="Basic" value="BASIC" /></el-select></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="状态" prop="status"
|
||||
><el-select v-model="platformForm.status" style="width: 100%"
|
||||
><el-option label="启用" value="ACTIVE" /><el-option label="停用" value="INACTIVE" /></el-select></el-form-item></el-col></el-row
|
||||
><el-form-item label="Token/密钥"><el-input v-model="platformForm.token" show-password /></el-form-item
|
||||
><el-form-item label="API Key"><el-input v-model="platformForm.apiKey" show-password /></el-form-item
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="Client ID"><el-input v-model="platformForm.clientId" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="Client Secret"><el-input v-model="platformForm.clientSecret" show-password /></el-form-item></el-col></el-row
|
||||
><el-form-item label="认证配置 JSON" prop="authConfigText"
|
||||
><el-input v-model="platformForm.authConfigText" type="textarea" :rows="6" /></el-form-item
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="限流/分钟"
|
||||
><el-input-number v-model="platformForm.rateLimitPerMinute" :min="0" style="width: 100%" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="限流/小时"
|
||||
><el-input-number v-model="platformForm.rateLimitPerHour" :min="0" style="width: 100%" /></el-form-item></el-col></el-row
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="并发限制"
|
||||
><el-input-number v-model="platformForm.concurrencyLimit" :min="0" style="width: 100%" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="超时(ms)"
|
||||
><el-input-number v-model="platformForm.requestTimeoutMs" :min="0" style="width: 100%" /></el-form-item></el-col></el-row
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="最大重试"><el-input-number v-model="platformForm.maxRetries" :min="0" style="width: 100%" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="重试延迟(ms)"
|
||||
><el-input-number v-model="platformForm.retryDelayMs" :min="0" style="width: 100%" /></el-form-item></el-col></el-row></el-form
|
||||
><template #footer
|
||||
><el-button @click="platformDialog.visible = false">取消</el-button
|
||||
><el-button type="primary" :loading="platformDialog.saving" @click="savePlatform">确定</el-button></template
|
||||
></el-dialog
|
||||
><el-dialog v-model="apiDialog.visible" :title="apiDialog.title" width="780px" :close-on-click-modal="false" destroy-on-close
|
||||
><el-form ref="apiFormRef" :model="apiForm" :rules="apiRules" label-width="110px" v-loading="apiDialog.loading"
|
||||
><el-form-item label="所属平台" prop="platformId"
|
||||
><el-select v-model="apiForm.platformId" style="width: 100%" filterable
|
||||
><el-option v-for="i in platforms" :key="i.id" :label="i.platformName" :value="String(i.id)" /></el-select></el-form-item
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="接口编码" prop="code"><el-input v-model="apiForm.code" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="接口名称" prop="name"><el-input v-model="apiForm.name" /></el-form-item></el-col></el-row
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="URL" prop="url"><el-input v-model="apiForm.url" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="请求方式" prop="method"
|
||||
><el-select v-model="apiForm.method" style="width: 100%"
|
||||
><el-option v-for="m in methods" :key="m" :label="m" :value="m" /></el-select></el-form-item></el-col></el-row
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="状态" prop="status"
|
||||
><el-select v-model="apiForm.status" style="width: 100%"
|
||||
><el-option label="启用" value="active" /><el-option label="禁用" value="inactive" /></el-select></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="认证类型"
|
||||
><el-select v-model="apiForm.authType" style="width: 100%" clearable
|
||||
><el-option label="Token" value="TOKEN" /><el-option label="API Key" value="API_KEY" /><el-option
|
||||
label="OAuth2"
|
||||
value="OAUTH2" /><el-option label="APP_SIGNATURE" value="APP_SIGNATURE" /></el-select></el-form-item></el-col></el-row
|
||||
><el-form-item label="请求配置 JSON" prop="requestConfigText"
|
||||
><el-input v-model="apiForm.requestConfigText" type="textarea" :rows="6" /></el-form-item
|
||||
><el-form-item label="响应配置 JSON" prop="responseConfigText"
|
||||
><el-input v-model="apiForm.responseConfigText" type="textarea" :rows="5" /></el-form-item
|
||||
><el-form-item label="限流配置 JSON" prop="limitConfigText"
|
||||
><el-input v-model="apiForm.limitConfigText" type="textarea" :rows="4" /></el-form-item
|
||||
><el-form-item label="表结构定义 JSON" prop="tableDefinitionText"
|
||||
><el-input v-model="apiForm.tableDefinitionText" type="textarea" :rows="6" /></el-form-item></el-form
|
||||
><template #footer
|
||||
><el-button @click="apiDialog.visible = false">取消</el-button
|
||||
><el-button type="primary" :loading="apiDialog.saving" @click="saveApi">确定</el-button></template
|
||||
></el-dialog
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default { name: 'cidApis' };
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
||||
|
||||
const queryRef = ref<FormInstance>();
|
||||
const formRef = ref<FormInstance>();
|
||||
const ids = ref<string[]>([]);
|
||||
|
||||
const tableData = reactive({
|
||||
data: [] as any[],
|
||||
total: 0,
|
||||
param: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyword: '',
|
||||
},
|
||||
});
|
||||
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
saving: false,
|
||||
});
|
||||
|
||||
const form = reactive({
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { getApiErrorMessage } from '/@/utils/request';
|
||||
import {
|
||||
createDatasourcePlatform,
|
||||
deleteDatasourcePlatform,
|
||||
getDatasourcePlatform,
|
||||
listDatasourcePlatforms,
|
||||
updateDatasourcePlatform,
|
||||
} from '/@/api/cid/datasource';
|
||||
import {
|
||||
createApiInterface,
|
||||
deleteApiInterface,
|
||||
getApiInterface,
|
||||
listApiInterfaces,
|
||||
updateApiInterface,
|
||||
type ApiInterfaceInfo,
|
||||
} from '/@/api/cid/apis';
|
||||
defineOptions({ name: 'cidApis' });
|
||||
const tab = ref('platform'),
|
||||
methods = ['GET', 'POST', 'PUT', 'DELETE'],
|
||||
platforms = ref<any[]>([]),
|
||||
platformRows = ref<any[]>([]),
|
||||
apiRows = ref<ApiInterfaceInfo[]>([]),
|
||||
platformTotal = ref(0),
|
||||
apiTotal = ref(0),
|
||||
platformLoading = ref(false),
|
||||
apiLoading = ref(false);
|
||||
const pqf = ref<FormInstance>(),
|
||||
aqf = ref<FormInstance>(),
|
||||
platformFormRef = ref<FormInstance>(),
|
||||
apiFormRef = ref<FormInstance>();
|
||||
const pq = reactive({ pageNum: 1, pageSize: 10, keyword: '', status: '' }),
|
||||
aq = reactive({ pageNum: 1, pageSize: 10, keyword: '', platformId: '', status: '', method: '' });
|
||||
const platformDialog = reactive({ visible: false, title: '', loading: false, saving: false }),
|
||||
apiDialog = reactive({ visible: false, title: '', loading: false, saving: false });
|
||||
const dpf = () => ({
|
||||
id: '',
|
||||
name: '',
|
||||
path: '',
|
||||
method: 'GET',
|
||||
datasourceId: '',
|
||||
platformCode: '',
|
||||
platformName: '',
|
||||
description: '',
|
||||
status: 1,
|
||||
apiBaseUrl: '',
|
||||
authType: 'TOKEN',
|
||||
status: 'ACTIVE',
|
||||
token: '',
|
||||
apiKey: '',
|
||||
clientId: '',
|
||||
clientSecret: '',
|
||||
authConfigText: '{}',
|
||||
rateLimitPerMinute: 60,
|
||||
rateLimitPerHour: 1000,
|
||||
concurrencyLimit: 10,
|
||||
requestTimeoutMs: 30000,
|
||||
maxRetries: 3,
|
||||
retryDelayMs: 1000,
|
||||
});
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入接口名称', trigger: 'blur' }],
|
||||
path: [{ required: true, message: '请输入接口路径', trigger: 'blur' }],
|
||||
method: [{ required: true, message: '请选择请求方式', trigger: 'change' }],
|
||||
};
|
||||
|
||||
const getList = () => {
|
||||
// TODO: 调用列表接口
|
||||
};
|
||||
|
||||
const resetQuery = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleSelectionChange = (selection: any[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
};
|
||||
|
||||
const onOpenAdd = () => {
|
||||
dialog.title = '新增接口';
|
||||
dialog.visible = true;
|
||||
form.id = '';
|
||||
form.name = '';
|
||||
form.path = '';
|
||||
form.method = 'GET';
|
||||
form.datasourceId = '';
|
||||
form.description = '';
|
||||
form.status = 1;
|
||||
};
|
||||
|
||||
const onOpenEdit = (row: any) => {
|
||||
dialog.title = '修改接口';
|
||||
dialog.visible = true;
|
||||
form.id = row.id;
|
||||
form.name = row.name;
|
||||
form.path = row.path;
|
||||
form.method = row.method;
|
||||
form.datasourceId = row.datasourceId;
|
||||
form.description = row.description;
|
||||
form.status = row.status;
|
||||
};
|
||||
|
||||
const onSubmit = () => {
|
||||
if (!formRef.value) return;
|
||||
formRef.value.validate((valid) => {
|
||||
if (!valid) return;
|
||||
dialog.saving = true;
|
||||
// TODO: 调用新增/编辑接口
|
||||
dialog.saving = false;
|
||||
dialog.visible = false;
|
||||
getList();
|
||||
});
|
||||
};
|
||||
|
||||
const onRowDel = (row: any) => {
|
||||
const delIds = row ? [row.id] : ids.value;
|
||||
if (delIds.length === 0) {
|
||||
ElMessage.error('请选择要删除的数据');
|
||||
return;
|
||||
const daf = () => ({
|
||||
id: '',
|
||||
platformId: '',
|
||||
code: '',
|
||||
name: '',
|
||||
url: '',
|
||||
method: 'GET',
|
||||
status: 'active',
|
||||
authType: '',
|
||||
requestConfigText: '{}',
|
||||
responseConfigText: '{}',
|
||||
limitConfigText: '{}',
|
||||
tableDefinitionText: '{}',
|
||||
});
|
||||
const platformForm = reactive(dpf()),
|
||||
apiForm = reactive(daf());
|
||||
const jv = (v: string, cb: (e?: Error) => void, l: string) => {
|
||||
if (!v) return cb();
|
||||
try {
|
||||
JSON.parse(v);
|
||||
cb();
|
||||
} catch {
|
||||
cb(new Error(`${l} 格式错误`));
|
||||
}
|
||||
ElMessageBox.confirm(`确定要删除选中的接口吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
// TODO: 调用删除接口
|
||||
ElMessage.success('删除成功');
|
||||
getList();
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
const platformRules: FormRules = {
|
||||
platformCode: [{ required: true, message: '请输入平台编码', trigger: 'blur' }],
|
||||
platformName: [{ required: true, message: '请输入平台名称', trigger: 'blur' }],
|
||||
authType: [{ required: true, message: '请选择认证类型', trigger: 'change' }],
|
||||
authConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '认证配置 JSON'), trigger: 'blur' }],
|
||||
};
|
||||
const apiRules: FormRules = {
|
||||
platformId: [{ required: true, message: '请选择所属平台', trigger: 'change' }],
|
||||
code: [{ required: true, message: '请输入接口编码', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '请输入接口名称', trigger: 'blur' }],
|
||||
url: [{ required: true, message: '请输入接口 URL', trigger: 'blur' }],
|
||||
method: [{ required: true, message: '请选择请求方式', trigger: 'change' }],
|
||||
requestConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '请求配置 JSON'), trigger: 'blur' }],
|
||||
responseConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '响应配置 JSON'), trigger: 'blur' }],
|
||||
limitConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '接口独立限流配置 JSON'), trigger: 'blur' }],
|
||||
tableDefinitionText: [{ validator: (_r, v, cb) => jv(v, cb, '表结构定义 JSON'), trigger: 'blur' }],
|
||||
};
|
||||
const ft = (t?: number) => (!t ? '' : new Date(String(t).length === 10 ? t * 1000 : t).toLocaleString('zh-CN', { hour12: false })),
|
||||
ns = (s?: string) => (String(s || '').toLowerCase() === 'active' ? 'active' : 'inactive');
|
||||
const loadPlatforms = async () => {
|
||||
const r = await listDatasourcePlatforms({ pageNum: 1, pageSize: 100 });
|
||||
platforms.value = r.data?.list || [];
|
||||
};
|
||||
const getPlatforms = async () => {
|
||||
platformLoading.value = true;
|
||||
try {
|
||||
const r = await listDatasourcePlatforms({
|
||||
pageNum: pq.pageNum,
|
||||
pageSize: pq.pageSize,
|
||||
...(pq.keyword ? { keyword: pq.keyword } : {}),
|
||||
...(pq.status ? { status: pq.status } : {}),
|
||||
});
|
||||
platformRows.value = r.data?.list || [];
|
||||
platformTotal.value = r.data?.total || 0;
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || '获取平台列表失败');
|
||||
} finally {
|
||||
platformLoading.value = false;
|
||||
}
|
||||
};
|
||||
const getApis = async () => {
|
||||
apiLoading.value = true;
|
||||
try {
|
||||
const r = await listApiInterfaces({
|
||||
pageNum: aq.pageNum,
|
||||
pageSize: aq.pageSize,
|
||||
...(aq.keyword ? { keyword: aq.keyword } : {}),
|
||||
...(aq.platformId ? { platformId: aq.platformId } : {}),
|
||||
...(aq.status ? { status: aq.status } : {}),
|
||||
...(aq.method ? { method: aq.method } : {}),
|
||||
});
|
||||
apiRows.value = r.data?.list || [];
|
||||
apiTotal.value = r.data?.total || 0;
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || '获取接口列表失败');
|
||||
} finally {
|
||||
apiLoading.value = false;
|
||||
}
|
||||
};
|
||||
const onTab = () => (tab.value === 'platform' ? getPlatforms() : getApis());
|
||||
const searchPlatform = () => {
|
||||
pq.pageNum = 1;
|
||||
getPlatforms();
|
||||
};
|
||||
const searchApi = () => {
|
||||
aq.pageNum = 1;
|
||||
getApis();
|
||||
};
|
||||
const resetPlatformQuery = () => {
|
||||
pqf.value?.resetFields();
|
||||
searchPlatform();
|
||||
};
|
||||
const resetApiQuery: any = () => {
|
||||
aqf.value?.resetFields();
|
||||
searchApi();
|
||||
};
|
||||
const openPlatform = async (row?: any) => {
|
||||
Object.assign(platformForm, dpf());
|
||||
platformFormRef.value?.clearValidate();
|
||||
platformDialog.title = row ? '编辑平台' : '新建平台';
|
||||
platformDialog.visible = true;
|
||||
if (!row) return;
|
||||
platformDialog.loading = true;
|
||||
try {
|
||||
const r = await getDatasourcePlatform(row.id);
|
||||
const d = r.data || {};
|
||||
Object.assign(platformForm, {
|
||||
id: String(d.id || row.id),
|
||||
platformCode: d.platformCode || '',
|
||||
platformName: d.platformName || '',
|
||||
description: d.description || '',
|
||||
apiBaseUrl: d.apiBaseUrl || '',
|
||||
authType: d.authType || 'TOKEN',
|
||||
status: d.status || 'ACTIVE',
|
||||
token: d.token || '',
|
||||
apiKey: d.apiKey || '',
|
||||
clientId: d.clientId || '',
|
||||
clientSecret: d.clientSecret || '',
|
||||
authConfigText: JSON.stringify(d.authConfig ?? {}, null, 2),
|
||||
rateLimitPerMinute: d.rateLimitPerMinute ?? 60,
|
||||
rateLimitPerHour: d.rateLimitPerHour ?? 1000,
|
||||
concurrencyLimit: d.concurrencyLimit ?? 10,
|
||||
requestTimeoutMs: d.requestTimeoutMs ?? 30000,
|
||||
maxRetries: d.maxRetries ?? 3,
|
||||
retryDelayMs: d.retryDelayMs ?? 1000,
|
||||
});
|
||||
} catch (e) {
|
||||
platformDialog.visible = false;
|
||||
ElMessage.error(getApiErrorMessage(e) || '获取平台详情失败');
|
||||
} finally {
|
||||
platformDialog.loading = false;
|
||||
}
|
||||
};
|
||||
const savePlatform = async () => {
|
||||
if (!platformFormRef.value) return;
|
||||
const ok = await platformFormRef.value.validate().catch(() => false);
|
||||
if (!ok) return;
|
||||
platformDialog.saving = true;
|
||||
try {
|
||||
const p = {
|
||||
platformCode: platformForm.platformCode,
|
||||
platformName: platformForm.platformName,
|
||||
description: platformForm.description,
|
||||
apiBaseUrl: platformForm.apiBaseUrl,
|
||||
authType: platformForm.authType,
|
||||
status: platformForm.status,
|
||||
token: platformForm.token,
|
||||
apiKey: platformForm.apiKey,
|
||||
clientId: platformForm.clientId,
|
||||
clientSecret: platformForm.clientSecret,
|
||||
authConfig: JSON.parse(platformForm.authConfigText || '{}'),
|
||||
rateLimitPerMinute: platformForm.rateLimitPerMinute || 60,
|
||||
rateLimitPerHour: platformForm.rateLimitPerHour || 1000,
|
||||
concurrencyLimit: platformForm.concurrencyLimit || 10,
|
||||
requestTimeoutMs: platformForm.requestTimeoutMs || 30000,
|
||||
maxRetries: platformForm.maxRetries || 3,
|
||||
retryDelayMs: platformForm.retryDelayMs || 1000,
|
||||
};
|
||||
platformForm.id ? await updateDatasourcePlatform({ id: platformForm.id, ...p }) : await createDatasourcePlatform(p);
|
||||
ElMessage.success(platformForm.id ? '更新成功' : '创建成功');
|
||||
platformDialog.visible = false;
|
||||
await Promise.all([getPlatforms(), loadPlatforms()]);
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || (platformForm.id ? '更新失败' : '创建失败'));
|
||||
} finally {
|
||||
platformDialog.saving = false;
|
||||
}
|
||||
};
|
||||
const delPlatform = (row: any) => {
|
||||
const ids = [row.id];
|
||||
ElMessageBox.confirm(`确定删除平台「${row.platformName}」吗?`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
try {
|
||||
for (const id of ids) await deleteDatasourcePlatform(id);
|
||||
ElMessage.success('删除成功');
|
||||
await Promise.all([getPlatforms(), loadPlatforms()]);
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || '删除失败');
|
||||
}
|
||||
})
|
||||
.catch(() => undefined);
|
||||
};
|
||||
const openApi = async (id = '', platformId = '') => {
|
||||
Object.assign(apiForm, daf(), platformId ? { platformId } : {});
|
||||
apiFormRef.value?.clearValidate();
|
||||
if (!platforms.value.length) await loadPlatforms();
|
||||
apiDialog.title = id ? '编辑接口' : '新建接口';
|
||||
apiDialog.visible = true;
|
||||
if (!id) return;
|
||||
apiDialog.loading = true;
|
||||
try {
|
||||
const r = await getApiInterface(id);
|
||||
const d = r.data || {};
|
||||
Object.assign(apiForm, {
|
||||
id: String(d.id || id),
|
||||
platformId: String(d.platformId || platformId || ''),
|
||||
code: d.code || '',
|
||||
name: d.name || '',
|
||||
url: d.url || '',
|
||||
method: d.method || 'GET',
|
||||
status: ns(d.status),
|
||||
authType: d.authType || '',
|
||||
requestConfigText: JSON.stringify(d.requestConfig ?? {}, null, 2),
|
||||
responseConfigText: JSON.stringify(d.responseConfig ?? {}, null, 2),
|
||||
limitConfigText: JSON.stringify(d.limitConfig ?? {}, null, 2),
|
||||
tableDefinitionText: JSON.stringify(d.tableDefinition ?? {}, null, 2),
|
||||
});
|
||||
} catch (e) {
|
||||
apiDialog.visible = false;
|
||||
ElMessage.error(getApiErrorMessage(e) || '获取接口详情失败');
|
||||
} finally {
|
||||
apiDialog.loading = false;
|
||||
}
|
||||
};
|
||||
const saveApi = async () => {
|
||||
if (!apiFormRef.value) return;
|
||||
const ok = await apiFormRef.value.validate().catch(() => false);
|
||||
if (!ok) return;
|
||||
apiDialog.saving = true;
|
||||
try {
|
||||
const p = {
|
||||
platformId: Number(apiForm.platformId),
|
||||
code: apiForm.code,
|
||||
name: apiForm.name,
|
||||
url: apiForm.url,
|
||||
method: apiForm.method,
|
||||
status: apiForm.status,
|
||||
authType: apiForm.authType || undefined,
|
||||
requestConfig: JSON.parse(apiForm.requestConfigText || '{}'),
|
||||
responseConfig: JSON.parse(apiForm.responseConfigText || '{}'),
|
||||
limitConfig: JSON.parse(apiForm.limitConfigText || '{}'),
|
||||
tableDefinition: JSON.parse(apiForm.tableDefinitionText || '{}'),
|
||||
};
|
||||
apiForm.id ? await updateApiInterface({ id: apiForm.id, ...p }) : await createApiInterface(p);
|
||||
ElMessage.success(apiForm.id ? '更新成功' : '创建成功');
|
||||
apiDialog.visible = false;
|
||||
await getApis();
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || (apiForm.id ? '更新失败' : '创建失败'));
|
||||
} finally {
|
||||
apiDialog.saving = false;
|
||||
}
|
||||
};
|
||||
const delApi = (row: any) => {
|
||||
ElMessageBox.confirm(`确定删除接口「${row.name}」吗?`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
try {
|
||||
await deleteApiInterface(String(row.id));
|
||||
ElMessage.success('删除成功');
|
||||
await getApis();
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || '删除失败');
|
||||
}
|
||||
})
|
||||
.catch(() => undefined);
|
||||
};
|
||||
onMounted(async () => {
|
||||
await loadPlatforms();
|
||||
await Promise.all([getPlatforms(), getApis()]);
|
||||
});
|
||||
</script>
|
||||
|
||||
68
src/views/settings/creation/component/PromptSelector.vue
Normal file
68
src/views/settings/creation/component/PromptSelector.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" title="编辑提示词" width="720px" :close-on-click-modal="false" destroy-on-close @close="handleClose">
|
||||
<div class="prompt-input-dialog">
|
||||
<el-input v-model="promptContent" type="textarea" :rows="12" maxlength="5000" show-word-limit placeholder="请输入提示词内容" />
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
defaultPrompt?: string;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'update:modelValue', value: boolean): void;
|
||||
(e: 'confirm', promptContent: string): void;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: false,
|
||||
defaultPrompt: '',
|
||||
});
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
const visible = ref(false);
|
||||
const promptContent = ref('');
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
visible.value = val;
|
||||
if (val) {
|
||||
promptContent.value = props.defaultPrompt || '';
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(visible, (val) => {
|
||||
if (!val) {
|
||||
emit('update:modelValue', false);
|
||||
}
|
||||
});
|
||||
|
||||
const handleConfirm = () => {
|
||||
emit('confirm', promptContent.value.trim());
|
||||
handleClose();
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.prompt-input-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
40
src/views/settings/creation/component/SaveWorkflowDialog.vue
Normal file
40
src/views/settings/creation/component/SaveWorkflowDialog.vue
Normal file
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="500px" :close-on-click-modal="false">
|
||||
<el-form :model="saveForm" label-position="top">
|
||||
<el-form-item label="工作流名称" required>
|
||||
<el-input v-model="saveForm.flowName" placeholder="请输入工作流名称" maxlength="50" show-word-limit />
|
||||
</el-form-item>
|
||||
<el-form-item label="工作流描述">
|
||||
<el-input v-model="saveForm.description" type="textarea" :rows="4" placeholder="请输入工作流描述(选填)" maxlength="200" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="emit('confirm')">{{ confirmText }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean;
|
||||
saveForm: { flowName: string; description: string };
|
||||
currentEditingWorkflowId: string | null;
|
||||
saving: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: boolean): void;
|
||||
(e: 'confirm'): void;
|
||||
}>();
|
||||
|
||||
const dialogVisible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value: boolean) => emit('update:modelValue', value),
|
||||
});
|
||||
|
||||
const dialogTitle = computed(() => (props.currentEditingWorkflowId ? '编辑工作流' : '保存工作流'));
|
||||
const confirmText = computed(() => (props.currentEditingWorkflowId ? '确定更新' : '确定保存'));
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -240,18 +240,54 @@ const handleCreatePrivateModelAndSetChat = async () => {
|
||||
|
||||
// 基于内置模型创建新模型(继承原模型的所有配置,只替换 apiKey)
|
||||
const builtInModel = builtInModelToClone.value;
|
||||
|
||||
// Parse headMsg to Record<string, string> - it might be stored as string or already as object
|
||||
let headMsgRecord: Record<string, string> = {};
|
||||
if (builtInModel.headMsg && typeof builtInModel.headMsg === 'string') {
|
||||
// Try to parse as JSON first (new format stored as string)
|
||||
try {
|
||||
const parsed = JSON.parse(builtInModel.headMsg);
|
||||
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
||||
Object.entries(parsed).forEach(([k, v]) => {
|
||||
headMsgRecord[k] = String(v);
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
// If JSON parse fails, parse as old format "key1:value1,key2:value2"
|
||||
const pairs = builtInModel.headMsg.split(',');
|
||||
pairs.forEach((pair: string) => {
|
||||
const idx = pair.indexOf(':');
|
||||
if (idx === -1) return;
|
||||
const key = pair.slice(0, idx).trim();
|
||||
const value = pair.slice(idx + 1).trim();
|
||||
if (key) {
|
||||
headMsgRecord[key] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (builtInModel.headMsg && typeof builtInModel.headMsg === 'object' && !Array.isArray(builtInModel.headMsg)) {
|
||||
// Already an object
|
||||
Object.entries(builtInModel.headMsg).forEach(([k, v]) => {
|
||||
headMsgRecord[k] = String(v);
|
||||
});
|
||||
}
|
||||
|
||||
const createParams = {
|
||||
modelName: apiKeyForm.modelName,
|
||||
modelType: builtInModel.modelType,
|
||||
baseUrl: builtInModel.baseUrl,
|
||||
httpMethod: builtInModel.httpMethod || 'POST',
|
||||
headMsg: builtInModel.headMsg || '',
|
||||
headMsg: headMsgRecord,
|
||||
isPrivate: builtInModel.isPrivate ?? 1,
|
||||
enabled: builtInModel.enabled ?? 1,
|
||||
isChatModel: 1, // 设置为会话模型
|
||||
callMode: builtInModel.callMode ?? builtInModel.isAsync ?? 0,
|
||||
apiKey: apiKeyForm.apiKey,
|
||||
form: builtInModel.form || {},
|
||||
requestMapping: builtInModel.requestMapping || {},
|
||||
requiredFields: Array.isArray(builtInModel.requiredFields) ? builtInModel.requiredFields : [],
|
||||
firstFrame: String(builtInModel.firstFrame || ''),
|
||||
lastFrame: String(builtInModel.lastFrame || ''),
|
||||
responseMapping: builtInModel.responseMapping || {},
|
||||
responseBody: builtInModel.responseBody || {},
|
||||
tokenMapping: builtInModel.tokenMapping || '',
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
<template>
|
||||
<div class="system-model-type-container layout-padding">
|
||||
<el-card shadow="hover" class="layout-padding-auto">
|
||||
<div class="system-model-type-search mb15">
|
||||
<el-input v-model="state.tableData.param.keyword" size="default" placeholder="请输入模型类型名称" style="max-width: 180px" clearable> </el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button size="default" type="success" class="ml10" @click="onOpenAddType('add')">
|
||||
<el-icon>
|
||||
<ele-FolderAdd />
|
||||
</el-icon>
|
||||
新增模型类型
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column prop="typeName" label="类型名称" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="typeCode" label="类型编码" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="description" label="描述" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">{{ scope.row.status === 1 ? '启用' : '禁用' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="onOpenEditType('edit', scope.row)">修改</el-button>
|
||||
<el-button size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total"
|
||||
>
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="digitalHumanModelType">
|
||||
import { reactive, onMounted } from 'vue';
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
|
||||
const state = reactive({
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyword: '',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
// TODO: 调用API获取数据
|
||||
setTimeout(() => {
|
||||
state.tableData.data = [];
|
||||
state.tableData.total = 0;
|
||||
state.tableData.loading = false;
|
||||
}, 500);
|
||||
};
|
||||
|
||||
// 打开新增模型类型弹窗
|
||||
const onOpenAddType = (type: string) => {
|
||||
ElMessage.info('功能开发中...');
|
||||
};
|
||||
|
||||
// 打开修改模型类型弹窗
|
||||
const onOpenEditType = (type: string, row: any) => {
|
||||
ElMessage.info('功能开发中...');
|
||||
};
|
||||
|
||||
// 删除模型类型
|
||||
const onRowDel = (row: any) => {
|
||||
ElMessage.info('功能开发中...');
|
||||
};
|
||||
|
||||
// 分页改变
|
||||
const onHandleSizeChange = (val: number) => {
|
||||
state.tableData.param.pageSize = val;
|
||||
getTableData();
|
||||
};
|
||||
|
||||
// 分页改变
|
||||
const onHandleCurrentChange = (val: number) => {
|
||||
state.tableData.param.pageNum = val;
|
||||
getTableData();
|
||||
};
|
||||
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
getTableData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.system-model-type-container {
|
||||
:deep(.el-card__body) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
314
src/views/settings/promptManager/index.vue
Normal file
314
src/views/settings/promptManager/index.vue
Normal file
@@ -0,0 +1,314 @@
|
||||
<template>
|
||||
<div class="prompt-manager-container">
|
||||
<!-- 搜索栏 -->
|
||||
<div class="search-bar">
|
||||
<el-input v-model="searchQuery" placeholder="搜索提示词内容..." prefix-icon="Search" style="width: 300px" clearable @input="handleSearch" />
|
||||
<el-button type="primary" @click="showCreateDialog = true">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增提示词
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<div class="table-container">
|
||||
<el-table :data="filteredList" v-loading="loading" border style="width: 100%">
|
||||
<el-table-column prop="nodeType" label="节点类型" width="150" />
|
||||
<el-table-column prop="prompt" label="提示词内容" min-width="350">
|
||||
<template #default="{ row }">
|
||||
<el-tooltip v-if="row.prompt.length > 80" content="hover" :enterable="false">
|
||||
<template #content>
|
||||
<div style="max-width: 400px; white-space: pre-wrap">{{ row.prompt }}</div>
|
||||
</template>
|
||||
<span>{{ row.prompt.slice(0, 80) }}...</span>
|
||||
</el-tooltip>
|
||||
<span v-else>{{ row.prompt }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sourceType" label="来源" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.sourceType === 1" type="success">管理员</el-tag>
|
||||
<el-tag v-else-if="row.sourceType === 2">用户</el-tag>
|
||||
<el-tag v-else type="info">{{ row.sourceType }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creator" label="创建者" width="120" />
|
||||
<el-table-column prop="createdAt" label="创建时间" width="170" />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link size="small" @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button type="danger" link size="small" @click="handleDeleteConfirm(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
v-model:current-page="pagination.current"
|
||||
v-model:page-size="pagination.size"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, sizes, ->, prev, pager, next, jumper"
|
||||
:total="pagination.total"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog v-model="showCreateDialog" :title="isEdit ? '编辑提示词' : '新增提示词'" width="600px" :close-on-click-modal="false">
|
||||
<el-form ref="createFormRef" :model="createForm" label-width="100px">
|
||||
<el-form-item label="节点类型" required>
|
||||
<el-select v-model="createForm.nodeType" placeholder="请选择节点类型" style="width: 100%" clearable v-loading="nodeLibraryLoading">
|
||||
<el-option v-for="option in nodeOptions" :key="option.value" :label="option.label" :value="option.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="提示词内容" required>
|
||||
<el-input v-model="createForm.prompt" type="textarea" :rows="8" placeholder="请输入提示词内容..." clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="cancelCreate">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSubmitCreate" :loading="submitLoading">
|
||||
{{ isEdit ? '保存修改' : '确 定' }}
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 删除确认弹窗 -->
|
||||
<el-dialog v-model="showDeleteDialog" title="确认删除" width="400px" :close-on-click-modal="false">
|
||||
<div>确定要删除这个提示词吗?</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="showDeleteDialog = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleDelete" :loading="deleteLoading">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="promptManager">
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { Plus } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { getNodeLibraryList, getMyPromptList, createPrompt, updatePrompt, deletePrompt, type NodeLibraryGroup, type NodeLibraryNode, type PromptItem } from '/@/api/settings/promptManager/index';
|
||||
|
||||
const searchQuery = ref('');
|
||||
const loading = ref(false);
|
||||
const list = ref<PromptItem[]>([]);
|
||||
const showCreateDialog = ref(false);
|
||||
const isEdit = ref(false);
|
||||
const submitLoading = ref(false);
|
||||
const createFormRef = ref();
|
||||
const editId = ref<number | string | null>(null);
|
||||
const nodeLibraryLoading = ref(false);
|
||||
const nodeLibraryGroups = ref<NodeLibraryGroup[]>([]);
|
||||
const showDeleteDialog = ref(false);
|
||||
const deleteLoading = ref(false);
|
||||
const deleteId = ref<number | string | null>(null);
|
||||
const nodeOptions = computed(() => {
|
||||
const options: Array<{ label: string; value: string }> = [];
|
||||
nodeLibraryGroups.value.forEach((group: NodeLibraryGroup) => {
|
||||
group.items.forEach((item: NodeLibraryNode) => {
|
||||
// 只显示支持提示词配置的节点
|
||||
if (item.promptOption) {
|
||||
options.push({
|
||||
label: item.nodeName,
|
||||
value: item.nodeCode,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
return options;
|
||||
});
|
||||
|
||||
const createForm = reactive({
|
||||
nodeType: '',
|
||||
prompt: '',
|
||||
sourceType: 2 as number,
|
||||
});
|
||||
|
||||
// 加载节点库
|
||||
const loadNodeLibrary = async () => {
|
||||
nodeLibraryLoading.value = true;
|
||||
try {
|
||||
const res = await getNodeLibraryList();
|
||||
if (res && res.data && res.data.groups) {
|
||||
nodeLibraryGroups.value = res.data.groups;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载节点库失败:', e);
|
||||
ElMessage.error('加载节点类型失败');
|
||||
} finally {
|
||||
nodeLibraryLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const pagination = reactive({
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
});
|
||||
|
||||
// 过滤后的列表
|
||||
const filteredList = computed(() => {
|
||||
if (!searchQuery.value) {
|
||||
return list.value;
|
||||
}
|
||||
const query = searchQuery.value.toLowerCase();
|
||||
return list.value.filter(
|
||||
(item) => item.nodeType.toLowerCase().includes(query) || item.prompt.toLowerCase().includes(query) || item.creator?.toLowerCase().includes(query)
|
||||
);
|
||||
});
|
||||
|
||||
// 加载列表
|
||||
const loadList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getMyPromptList({
|
||||
pageNum: pagination.current,
|
||||
pageSize: pagination.size,
|
||||
});
|
||||
if (res && res.data && res.data.list) {
|
||||
list.value = res.data.list;
|
||||
pagination.total = res.data.total || 0;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
ElMessage.error('加载失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const handleSearch = () => {
|
||||
pagination.current = 1;
|
||||
loadList();
|
||||
};
|
||||
|
||||
// 新增
|
||||
const handleSubmitCreate = async () => {
|
||||
// 验证
|
||||
if (!createForm.nodeType?.trim()) {
|
||||
ElMessage.warning('请选择节点类型');
|
||||
return;
|
||||
}
|
||||
if (!createForm.prompt?.trim()) {
|
||||
ElMessage.warning('请输入提示词内容');
|
||||
return;
|
||||
}
|
||||
|
||||
submitLoading.value = true;
|
||||
try {
|
||||
if (isEdit.value && editId.value) {
|
||||
await updatePrompt({
|
||||
id: editId.value,
|
||||
...createForm,
|
||||
});
|
||||
ElMessage.success('修改成功');
|
||||
} else {
|
||||
await createPrompt({
|
||||
nodeType: createForm.nodeType.trim(),
|
||||
prompt: createForm.prompt.trim(),
|
||||
sourceType: createForm.sourceType,
|
||||
});
|
||||
ElMessage.success('创建成功');
|
||||
}
|
||||
showCreateDialog.value = false;
|
||||
cancelCreate();
|
||||
loadList();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
ElMessage.error('操作失败');
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const handleEdit = (row: PromptItem) => {
|
||||
isEdit.value = true;
|
||||
editId.value = row.id;
|
||||
createForm.nodeType = row.nodeType || '';
|
||||
createForm.prompt = row.prompt || '';
|
||||
createForm.sourceType = row.sourceType || 0;
|
||||
showCreateDialog.value = true;
|
||||
};
|
||||
|
||||
// 打开删除确认弹窗
|
||||
const handleDeleteConfirm = (id: number | string) => {
|
||||
deleteId.value = id;
|
||||
showDeleteDialog.value = true;
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = async () => {
|
||||
if (!deleteId.value) return;
|
||||
deleteLoading.value = true;
|
||||
try {
|
||||
await deletePrompt(deleteId.value);
|
||||
ElMessage.success('删除成功');
|
||||
showDeleteDialog.value = false;
|
||||
loadList();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
ElMessage.error('删除失败');
|
||||
} finally {
|
||||
deleteLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 取消
|
||||
const cancelCreate = () => {
|
||||
createFormRef.value?.resetFields();
|
||||
isEdit.value = false;
|
||||
editId.value = null;
|
||||
createForm.nodeType = '';
|
||||
createForm.prompt = '';
|
||||
createForm.sourceType = 2;
|
||||
};
|
||||
|
||||
// 分页
|
||||
const handleSizeChange = (size: number) => {
|
||||
pagination.size = size;
|
||||
pagination.current = 1;
|
||||
loadList();
|
||||
};
|
||||
|
||||
const handleCurrentChange = (current: number) => {
|
||||
pagination.current = current;
|
||||
loadList();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadNodeLibrary();
|
||||
loadList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.prompt-manager-container {
|
||||
padding: 16px;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
|
||||
.search-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
.pagination-container {
|
||||
margin-top: 16px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
279
src/views/settings/workflow/component/InputSourceManager.vue
Normal file
279
src/views/settings/workflow/component/InputSourceManager.vue
Normal file
@@ -0,0 +1,279 @@
|
||||
<template>
|
||||
<div class="input-source-manager">
|
||||
<el-divider content-position="left">上级参数引用</el-divider>
|
||||
|
||||
<!-- 已引用的参数列表 -->
|
||||
<div v-if="currentInputSource && currentInputSource.length > 0" class="input-source-list">
|
||||
<div v-for="(sourceNode, index) in currentInputSource" :key="index" class="input-source-item">
|
||||
<div class="input-source-header">
|
||||
<span class="input-source-node-name">{{ getNodeName(sourceNode.nodeId) }}</span>
|
||||
</div>
|
||||
<div v-if="sourceNode.field && sourceNode.field.length > 0" class="input-source-fields">
|
||||
<div v-for="fieldName in sourceNode.field" :key="fieldName" class="field-tag">
|
||||
<el-tag size="small">{{ fieldName }}</el-tag>
|
||||
<el-button type="danger" link size="small" @click="emit('removeField', sourceNode.nodeId, fieldName)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-source-output">
|
||||
<el-switch
|
||||
:model-value="sourceNode.quoteOutput === true"
|
||||
@change="(val: boolean) => emit('toggleOutput', sourceNode.nodeId, val)"
|
||||
size="small"
|
||||
active-text="引入输出"
|
||||
inactive-text=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 显示所有上级节点的输出引用选项 -->
|
||||
<div v-if="availableParentNodes.length > 0" class="parent-nodes-output">
|
||||
<div class="parent-nodes-title">上级节点输出</div>
|
||||
<div v-for="parentNode in availableParentNodes" :key="parentNode.id" class="parent-node-output-item">
|
||||
<span class="parent-node-name">{{ parentNode.name }}</span>
|
||||
<el-switch
|
||||
:model-value="isNodeOutputQuoted(parentNode.id)"
|
||||
@change="(val: boolean) => emit('toggleOutput', parentNode.id, val)"
|
||||
size="small"
|
||||
active-text="引入输出"
|
||||
inactive-text=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 选择参数下拉框 -->
|
||||
<el-form-item label="选择参数">
|
||||
<el-select :model-value="selectedParam" @update:model-value="handleParamSelect" placeholder="选择上级节点的参数" class="w100">
|
||||
<el-option v-for="param in availableParams" :key="param.value" :label="param.label" :value="param.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import type { Node } from '@vue-flow/core';
|
||||
|
||||
interface NodeData {
|
||||
label?: string;
|
||||
nodeCode?: string;
|
||||
inputSource?: Array<{ nodeId: string; field: string[]; quoteOutput?: boolean }> | null;
|
||||
formConfig?: any[];
|
||||
modelConfig?: any;
|
||||
skillName?: string;
|
||||
}
|
||||
|
||||
interface ParentNode {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface ParamOption {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
selectedNode: Node<NodeData, any, string> | null;
|
||||
nodes: Node<NodeData, any, string>[];
|
||||
edges: any[];
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'removeField', nodeId: string, fieldName: string): void;
|
||||
(e: 'toggleOutput', nodeId: string, enabled: boolean): void;
|
||||
(e: 'addParam', paramValue: string): void;
|
||||
}>();
|
||||
|
||||
const selectedParam = ref('');
|
||||
|
||||
// 当前节点的 inputSource
|
||||
const currentInputSource = computed(() => {
|
||||
if (!props.selectedNode?.data?.inputSource) return [];
|
||||
return props.selectedNode.data.inputSource.filter((item) => item.field && item.field.length > 0);
|
||||
});
|
||||
|
||||
// 获取节点名称
|
||||
const getNodeName = (nodeId: string) => {
|
||||
const node = props.nodes.find((n) => n.id === nodeId);
|
||||
return node?.data?.label || nodeId;
|
||||
};
|
||||
|
||||
// 获取所有上级节点(用于显示输出引用选项)
|
||||
const availableParentNodes = computed(() => {
|
||||
if (!props.selectedNode?.data) return [];
|
||||
|
||||
// 获取已经引用了字段的节点ID列表
|
||||
const inputSource = props.selectedNode.data.inputSource;
|
||||
const nodesWithFields = new Set<string>();
|
||||
if (Array.isArray(inputSource)) {
|
||||
inputSource.forEach((item) => {
|
||||
if (item.field && item.field.length > 0) {
|
||||
nodesWithFields.add(item.nodeId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 递归查找所有上级节点
|
||||
const findAllParentNodes = (nodeId: string, visited = new Set<string>()): string[] => {
|
||||
if (visited.has(nodeId)) return [];
|
||||
visited.add(nodeId);
|
||||
|
||||
const incomingEdges = props.edges.filter((e) => e.target === nodeId);
|
||||
const parentIds: string[] = [];
|
||||
|
||||
incomingEdges.forEach((edge) => {
|
||||
parentIds.push(edge.source);
|
||||
parentIds.push(...findAllParentNodes(edge.source, visited));
|
||||
});
|
||||
|
||||
return parentIds;
|
||||
};
|
||||
|
||||
const allParentIds = findAllParentNodes(props.selectedNode.id);
|
||||
const parentNodes = allParentIds
|
||||
.map((parentId) => {
|
||||
const parentNode = props.nodes.find((n) => n.id === parentId);
|
||||
if (!parentNode?.data) return null;
|
||||
|
||||
const nodeCode = String(parentNode.data.nodeCode || '').toLowerCase();
|
||||
const isJudge = ['判断', 'judge', 'condition', 'if', 'branch', 'gateway'].some((k) => nodeCode.includes(k));
|
||||
const isStart = nodeCode === '__start__';
|
||||
|
||||
if (isJudge || isStart || nodesWithFields.has(parentId)) return null;
|
||||
|
||||
return {
|
||||
id: parentId,
|
||||
name: parentNode.data.label || parentId,
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
return parentNodes as ParentNode[];
|
||||
});
|
||||
|
||||
// 检查节点输出是否被引用
|
||||
const isNodeOutputQuoted = (nodeId: string): boolean => {
|
||||
if (!props.selectedNode?.data) return false;
|
||||
const inputSource = props.selectedNode.data.inputSource;
|
||||
if (!Array.isArray(inputSource)) return false;
|
||||
|
||||
const node = inputSource.find((item) => item.nodeId === nodeId);
|
||||
return node?.quoteOutput === true;
|
||||
};
|
||||
|
||||
// 获取可用的参数选项
|
||||
const availableParams = computed(() => {
|
||||
if (!props.selectedNode) return [];
|
||||
|
||||
const params: ParamOption[] = [];
|
||||
const visited = new Set<string>();
|
||||
|
||||
const findParents = (nodeId: string) => {
|
||||
if (visited.has(nodeId)) return;
|
||||
visited.add(nodeId);
|
||||
|
||||
props.edges
|
||||
.filter((e) => e.target === nodeId)
|
||||
.forEach((edge) => {
|
||||
const parent = props.nodes.find((n) => n.id === edge.source);
|
||||
if (parent?.data && parent.data.nodeCode !== '__start__' && parent.data.nodeCode !== 'judge') {
|
||||
params.push({
|
||||
label: `${parent.data.label}.output`,
|
||||
value: `\${${parent.id}.output}`,
|
||||
});
|
||||
}
|
||||
findParents(edge.source);
|
||||
});
|
||||
};
|
||||
|
||||
findParents(props.selectedNode.id);
|
||||
return params;
|
||||
});
|
||||
|
||||
const handleParamSelect = (value: string) => {
|
||||
if (!value) return;
|
||||
emit('addParam', value);
|
||||
selectedParam.value = '';
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.input-source-manager {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.input-source-list {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.input-source-item {
|
||||
padding: 12px;
|
||||
margin-bottom: 12px;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.input-source-header {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.input-source-node-name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #334155;
|
||||
}
|
||||
|
||||
.input-source-fields {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.field-tag {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 4px 8px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.input-source-output {
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.parent-nodes-output {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.parent-nodes-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #64748b;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.parent-node-output-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 12px;
|
||||
margin-bottom: 6px;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.parent-node-name {
|
||||
font-size: 13px;
|
||||
color: #475569;
|
||||
}
|
||||
|
||||
.w100 {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
263
src/views/settings/workflow/component/NodeConfigPanel.vue
Normal file
263
src/views/settings/workflow/component/NodeConfigPanel.vue
Normal file
@@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<div class="config-panel">
|
||||
<h3>节点配置</h3>
|
||||
<div v-if="selectedNode">
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="节点名称">
|
||||
<el-input :model-value="selectedNode.data?.label" @update:model-value="updateNodeLabel" />
|
||||
</el-form-item>
|
||||
<el-form-item label="节点类型">
|
||||
<el-tag>{{ selectedNode.data?.nodeCode }}</el-tag>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 模型选择 -->
|
||||
<el-form-item v-if="nodeConfig?.modelConfig && nodeConfig.modelConfig.length > 0" label="选择模型">
|
||||
<el-button type="primary" @click="emit('openModelSelector')" style="width: 100%">选择模型</el-button>
|
||||
<div v-if="selectedNode.data?.modelConfig?.modelName" class="selected-tag">
|
||||
<el-tag type="success" size="large" closable @close="emit('removeModel')">
|
||||
{{ selectedNode.data.modelConfig.modelName }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 技能选择 -->
|
||||
<el-form-item v-if="nodeConfig?.skillOption" label="选择技能">
|
||||
<el-button type="primary" @click="emit('openSkillSelector')" style="width: 100%">选择技能</el-button>
|
||||
<div v-if="selectedNode.data?.skillName" class="selected-tag">
|
||||
<el-tag type="success" size="large" closable @close="emit('removeSkill')">
|
||||
{{ selectedNode.data.skillName }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 动态表单字段 -->
|
||||
<template v-if="nodeConfig?.formConfig && nodeConfig.formConfig.length > 0">
|
||||
<el-divider content-position="left">节点参数</el-divider>
|
||||
<el-form-item v-for="field in nodeConfig.formConfig" :key="field.field" :label="field.label" :required="field.required">
|
||||
<el-input
|
||||
v-if="field.type === 'input' || field.type === 'string'"
|
||||
:model-value="getFieldValue(field.field)"
|
||||
@update:model-value="updateFieldValue(field.field, $event)"
|
||||
:placeholder="field.required ? '必填' : '选填'"
|
||||
/>
|
||||
<el-input-number
|
||||
v-else-if="field.type === 'number' || field.type === 'inputNumber'"
|
||||
:model-value="getFieldValue(field.field)"
|
||||
@update:model-value="updateFieldValue(field.field, $event)"
|
||||
class="w100"
|
||||
/>
|
||||
<el-input
|
||||
v-else-if="field.type === 'textarea'"
|
||||
:model-value="getFieldValue(field.field)"
|
||||
@update:model-value="updateFieldValue(field.field, $event)"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
:placeholder="field.required ? '必填' : '选填'"
|
||||
/>
|
||||
<el-switch
|
||||
v-else-if="field.type === 'switch'"
|
||||
:model-value="getFieldValue(field.field)"
|
||||
@update:model-value="updateFieldValue(field.field, $event)"
|
||||
/>
|
||||
<el-select
|
||||
v-else-if="field.type === 'select' && field.options"
|
||||
:model-value="getFieldValue(field.field)"
|
||||
@update:model-value="updateFieldValue(field.field, $event)"
|
||||
:placeholder="field.required ? '必填' : '选填'"
|
||||
class="w100"
|
||||
>
|
||||
<el-option v-for="opt in field.options" :key="opt.value" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
<el-input
|
||||
v-else
|
||||
:model-value="getFieldValue(field.field)"
|
||||
@update:model-value="updateFieldValue(field.field, $event)"
|
||||
:placeholder="field.required ? '必填' : '选填'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
|
||||
<!-- 上级参数管理 -->
|
||||
<InputSourceManager
|
||||
v-if="selectedNode.data?.nodeCode !== '__start__'"
|
||||
:selected-node="selectedNode"
|
||||
:nodes="allNodes"
|
||||
:edges="allEdges"
|
||||
@remove-field="(nodeId: string, fieldName: string) => emit('removeField', nodeId, fieldName)"
|
||||
@toggle-output="(nodeId: string, enabled: boolean) => emit('toggleOutput', nodeId, enabled)"
|
||||
@add-param="(paramValue: string) => emit('addParamByValue', paramValue)"
|
||||
/>
|
||||
</div>
|
||||
<el-empty v-else description="请选择一个节点" :image-size="100" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Node } from '@vue-flow/core';
|
||||
import InputSourceManager from './InputSourceManager.vue';
|
||||
|
||||
interface NodeData {
|
||||
label?: string;
|
||||
nodeCode?: string;
|
||||
inputSource?: Array<{ nodeId: string; field: string[]; quoteOutput?: boolean }> | null;
|
||||
formConfig?: any[];
|
||||
modelConfig?: any;
|
||||
skillName?: string;
|
||||
}
|
||||
|
||||
interface ParamRef {
|
||||
id: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
interface NodeConfig {
|
||||
formConfig: any[];
|
||||
modelConfig: any[];
|
||||
skillOption: boolean;
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
selectedNode: Node<NodeData, any, string> | null;
|
||||
availableParams: ParamRef[];
|
||||
nodeConfig: NodeConfig | null;
|
||||
allNodes: Node<NodeData, any, string>[];
|
||||
allEdges: any[];
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:selectedNode', node: Node<NodeData, any, string>): void;
|
||||
(e: 'addParam', param: ParamRef): void;
|
||||
(e: 'openModelSelector'): void;
|
||||
(e: 'removeModel'): void;
|
||||
(e: 'openSkillSelector'): void;
|
||||
(e: 'removeSkill'): void;
|
||||
(e: 'removeField', nodeId: string, fieldName: string): void;
|
||||
(e: 'toggleOutput', nodeId: string, enabled: boolean): void;
|
||||
(e: 'addParamByValue', paramValue: string): void;
|
||||
}>();
|
||||
|
||||
const updateNodeLabel = (newLabel: string) => {
|
||||
if (!props.selectedNode?.data) return;
|
||||
const updatedNode = {
|
||||
...props.selectedNode,
|
||||
data: {
|
||||
...props.selectedNode.data,
|
||||
label: newLabel,
|
||||
},
|
||||
};
|
||||
emit('update:selectedNode', updatedNode);
|
||||
};
|
||||
|
||||
const getFieldValue = (fieldName: string) => {
|
||||
if (!props.selectedNode?.data?.formConfig) return '';
|
||||
const field = props.selectedNode.data.formConfig.find((f: any) => f.field === fieldName);
|
||||
return field?.value ?? '';
|
||||
};
|
||||
|
||||
const updateFieldValue = (fieldName: string, value: any) => {
|
||||
if (!props.selectedNode?.data) return;
|
||||
|
||||
const formConfig = props.selectedNode.data.formConfig || [];
|
||||
const existingIndex = formConfig.findIndex((f: any) => f.field === fieldName);
|
||||
|
||||
let updatedFormConfig;
|
||||
if (existingIndex >= 0) {
|
||||
updatedFormConfig = [...formConfig];
|
||||
updatedFormConfig[existingIndex] = { ...updatedFormConfig[existingIndex], value };
|
||||
} else {
|
||||
const fieldDef = props.nodeConfig?.formConfig.find((f) => f.field === fieldName);
|
||||
if (fieldDef) {
|
||||
updatedFormConfig = [...formConfig, { ...fieldDef, value }];
|
||||
} else {
|
||||
updatedFormConfig = formConfig;
|
||||
}
|
||||
}
|
||||
|
||||
const updatedNode = {
|
||||
...props.selectedNode,
|
||||
data: {
|
||||
...props.selectedNode.data,
|
||||
formConfig: updatedFormConfig,
|
||||
},
|
||||
};
|
||||
emit('update:selectedNode', updatedNode);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.config-panel {
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
padding: 16px;
|
||||
overflow-y: auto;
|
||||
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
|
||||
border: 1px solid #e6eaf0;
|
||||
|
||||
h3 {
|
||||
margin: 0 0 16px 0;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: #334155;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
:deep(.el-form) {
|
||||
.el-form-item {
|
||||
margin-bottom: 14px;
|
||||
|
||||
.el-form-item__label {
|
||||
font-weight: 600;
|
||||
color: #475569;
|
||||
margin-bottom: 6px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.el-input__wrapper {
|
||||
border-radius: 6px;
|
||||
box-shadow: none;
|
||||
border: 1px solid #dbe3ee;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: #b8c4d6;
|
||||
}
|
||||
|
||||
&.is-focus {
|
||||
border-color: #3b82f6;
|
||||
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.param-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 12px;
|
||||
margin-bottom: 8px;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 8px;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: #cbd5e1;
|
||||
background: #f1f5f9;
|
||||
}
|
||||
}
|
||||
|
||||
.selected-tag {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.w100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.el-empty) {
|
||||
padding: 32px 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
164
src/views/settings/workflow/component/NodeLibraryPanel.vue
Normal file
164
src/views/settings/workflow/component/NodeLibraryPanel.vue
Normal file
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div class="node-library-panel" :class="{ collapsed: collapsed }">
|
||||
<div class="node-library-header">
|
||||
<span>节点库</span>
|
||||
<el-button class="collapse-btn" text circle @click="emit('update:collapsed', !collapsed)">
|
||||
<el-icon>
|
||||
<ArrowRightBold v-if="collapsed" />
|
||||
<ArrowLeftBold v-else />
|
||||
</el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-if="!collapsed" class="node-library-content">
|
||||
<el-empty v-if="nodeLibraryGroups.length === 0" description="暂无节点" :image-size="40" />
|
||||
<div v-else class="node-library-groups">
|
||||
<div v-for="group in nodeLibraryGroups" :key="group.group" class="node-group">
|
||||
<div class="node-group-title">{{ group.label }}</div>
|
||||
<div class="node-group-items">
|
||||
<el-button
|
||||
v-for="item in group.items"
|
||||
:key="item.nodeCode"
|
||||
text
|
||||
class="node-item"
|
||||
@click="emit('addNode', item.nodeCode, item.nodeName)"
|
||||
>
|
||||
{{ item.nodeName }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ArrowLeftBold, ArrowRightBold } from '@element-plus/icons-vue';
|
||||
import type { NodeLibraryGroup } from '/@/api/settings/creation';
|
||||
|
||||
defineProps<{
|
||||
nodeLibraryGroups: NodeLibraryGroup[];
|
||||
collapsed: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:collapsed', value: boolean): void;
|
||||
(e: 'addNode', nodeCode: string, nodeName: string): void;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.node-library-panel {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 10;
|
||||
background: #fff;
|
||||
border: 1px solid #d8e0eb;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
|
||||
width: 132px;
|
||||
max-height: calc(100% - 20px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
transition: width 0.18s ease;
|
||||
|
||||
&.collapsed {
|
||||
width: 40px;
|
||||
|
||||
.node-library-header {
|
||||
padding: 8px;
|
||||
border-bottom: none;
|
||||
|
||||
> span {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.node-library-content {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.node-library-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px;
|
||||
border-bottom: 1px solid #e7ecf3;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: #1f2937;
|
||||
background: #f8fafc;
|
||||
|
||||
.collapse-btn {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 1px solid #cfd8e6;
|
||||
color: #64748b;
|
||||
}
|
||||
}
|
||||
|
||||
.node-library-content {
|
||||
padding: 12px;
|
||||
overflow-y: auto;
|
||||
max-height: 480px;
|
||||
}
|
||||
|
||||
.node-library-groups {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.node-group {
|
||||
.node-group-title {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: #64748b;
|
||||
margin-bottom: 8px;
|
||||
padding-bottom: 4px;
|
||||
border-bottom: 1px solid #e7ecf3;
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
.node-group-items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.node-item {
|
||||
justify-content: flex-start !important;
|
||||
width: 100%;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
color: #475569;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
background: transparent;
|
||||
border: none;
|
||||
transition: all 0.15s ease;
|
||||
text-align: left !important;
|
||||
min-height: 34px;
|
||||
height: auto !important;
|
||||
display: block !important;
|
||||
|
||||
&:hover {
|
||||
background: #f1f5f9;
|
||||
color: #1e293b;
|
||||
}
|
||||
|
||||
:deep(.el-button__inner) {
|
||||
width: 100%;
|
||||
padding: 8px !important;
|
||||
margin: 0 !important;
|
||||
text-align: left !important;
|
||||
justify-content: flex-start !important;
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
40
src/views/settings/workflow/component/SaveWorkflowDialog.vue
Normal file
40
src/views/settings/workflow/component/SaveWorkflowDialog.vue
Normal file
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="500px" :close-on-click-modal="false">
|
||||
<el-form :model="saveForm" label-position="top">
|
||||
<el-form-item label="工作流名称" required>
|
||||
<el-input v-model="saveForm.flowName" placeholder="请输入工作流名称" maxlength="50" show-word-limit />
|
||||
</el-form-item>
|
||||
<el-form-item label="工作流描述">
|
||||
<el-input v-model="saveForm.description" type="textarea" :rows="4" placeholder="请输入工作流描述(选填)" maxlength="200" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="emit('confirm')">{{ confirmText }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean;
|
||||
saveForm: { flowName: string; description: string };
|
||||
currentEditingWorkflowId: string | null;
|
||||
saving: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: boolean): void;
|
||||
(e: 'confirm'): void;
|
||||
}>();
|
||||
|
||||
const dialogVisible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value: boolean) => emit('update:modelValue', value),
|
||||
});
|
||||
|
||||
const dialogTitle = computed(() => (props.currentEditingWorkflowId ? '编辑工作流' : '保存工作流'));
|
||||
const confirmText = computed(() => (props.currentEditingWorkflowId ? '确定更新' : '确定保存'));
|
||||
</script>
|
||||
190
src/views/settings/workflow/component/WorkflowListPanel.vue
Normal file
190
src/views/settings/workflow/component/WorkflowListPanel.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div class="workflow-list-panel">
|
||||
<div class="panel-header">
|
||||
<el-tabs v-model="activeTab" class="workflow-tabs">
|
||||
<el-tab-pane label="我的工作流" name="user"></el-tab-pane>
|
||||
<el-tab-pane label="模板工作流" name="template"></el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div class="workflow-list-content" v-loading="loading">
|
||||
<el-empty v-if="currentList.length === 0" description="暂无工作流" :image-size="60" />
|
||||
<div v-else class="workflow-items">
|
||||
<div
|
||||
v-for="workflow in currentList"
|
||||
:key="workflow.id"
|
||||
class="workflow-item"
|
||||
:class="{ active: currentEditingId === workflow.id }"
|
||||
@click="emit('edit', workflow)"
|
||||
>
|
||||
<div class="workflow-item-content">
|
||||
<div class="workflow-item-name">{{ workflow.flowName || workflow.flowTemplateName || '未命名工作流' }}</div>
|
||||
<div class="workflow-item-desc">{{ workflow.description || '暂无描述' }}</div>
|
||||
</div>
|
||||
<div class="workflow-item-actions">
|
||||
<el-button type="primary" link size="small" @click.stop="emit('edit', workflow)">编辑</el-button>
|
||||
<el-button type="danger" link size="small" @click.stop="emit('delete', workflow)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import type { WorkflowItem } from '/@/api/settings/creation';
|
||||
|
||||
const props = defineProps<{
|
||||
userWorkflowList: WorkflowItem[];
|
||||
templateWorkflowList: WorkflowItem[];
|
||||
currentEditingId: string | null;
|
||||
loading: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'edit', workflow: WorkflowItem): void;
|
||||
(e: 'delete', workflow: WorkflowItem): void;
|
||||
(e: 'create'): void;
|
||||
}>();
|
||||
|
||||
const activeTab = ref<'user' | 'template'>('user');
|
||||
|
||||
const currentList = computed(() => {
|
||||
return activeTab.value === 'user' ? props.userWorkflowList : props.templateWorkflowList;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.workflow-list-panel {
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
padding: 16px;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
|
||||
border: 1px solid #e6eaf0;
|
||||
|
||||
.panel-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 14px;
|
||||
|
||||
:deep(.el-button) {
|
||||
border-radius: 6px;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.workflow-tabs {
|
||||
flex: 1;
|
||||
|
||||
:deep(.el-tabs__header) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__nav-wrap::after) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__item) {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #64748b;
|
||||
padding: 0 16px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
|
||||
&.is-active {
|
||||
color: #3b82f6;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-tabs__active-bar) {
|
||||
background-color: #3b82f6;
|
||||
}
|
||||
}
|
||||
|
||||
.workflow-list-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: rgba(102, 126, 234, 0.05);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.workflow-items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.workflow-item {
|
||||
padding: 12px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
background: #fff;
|
||||
|
||||
&:hover {
|
||||
border-color: #c5d2e6;
|
||||
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #3b82f6;
|
||||
background: #eff6ff;
|
||||
}
|
||||
}
|
||||
|
||||
.workflow-item-content {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.workflow-item-name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
margin-bottom: 4px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.workflow-item-desc {
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.workflow-item-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
justify-content: flex-end;
|
||||
|
||||
:deep(.el-button) {
|
||||
border-radius: 6px;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1064
src/views/settings/workflow/index.vue
Normal file
1064
src/views/settings/workflow/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
207
src/views/system/pwconfig/index.vue
Normal file
207
src/views/system/pwconfig/index.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<div class="system-pwconfig-container">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>密码策略配置</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="ruleForm" ref="formRef" :rules="rules" label-width="180px" style="max-width: 800px;">
|
||||
<el-form-item label="启用密码策略" prop="enabled">
|
||||
<el-switch v-model="ruleForm.enabled" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="最小密码长度" prop="minLength">
|
||||
<el-input-number v-model="ruleForm.minLength" :min="4" :max="32" placeholder="请输入最小密码长度" />
|
||||
<span class="ml10 text-muted">位</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="最大密码长度" prop="maxLength">
|
||||
<el-input-number v-model="ruleForm.maxLength" :min="4" :max="128" placeholder="请输入最大密码长度" />
|
||||
<span class="ml10 text-muted">位</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="必须包含大写字母" prop="requireUppercase">
|
||||
<el-switch v-model="ruleForm.requireUppercase" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="必须包含小写字母" prop="requireLowercase">
|
||||
<el-switch v-model="ruleForm.requireLowercase" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="必须包含数字" prop="requireDigit">
|
||||
<el-switch v-model="ruleForm.requireDigit" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="必须包含特殊字符" prop="requireSpecialChar">
|
||||
<el-switch v-model="ruleForm.requireSpecialChar" />
|
||||
<div class="text-muted mt5" style="font-size: 12px;">特殊字符包括:!@#$%^&*()_+-=[]{}|;:,.<>?</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="密码过期天数" prop="expireDays">
|
||||
<el-input-number v-model="ruleForm.expireDays" :min="0" :max="365" placeholder="请输入密码过期天数" />
|
||||
<span class="ml10 text-muted">天(0表示永不过期)</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="登录失败锁定次数" prop="maxRetryCount">
|
||||
<el-input-number v-model="ruleForm.maxRetryCount" :min="0" :max="10" placeholder="请输入登录失败锁定次数" />
|
||||
<span class="ml10 text-muted">次(0表示不锁定)</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="锁定时长" prop="lockTimeMinutes">
|
||||
<el-input-number v-model="ruleForm.lockTimeMinutes" :min="1" :max="1440" placeholder="请输入锁定时长" />
|
||||
<span class="ml10 text-muted">分钟</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="ruleForm.remark" type="textarea" :rows="3" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit" :loading="loading">保存配置</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { reactive, toRefs, defineComponent, ref, onMounted, unref } from 'vue';
|
||||
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
||||
import { getPwConfig, savePwConfig } from "/@/api/system/pwconfig";
|
||||
|
||||
interface RuleFormState {
|
||||
enabled: boolean;
|
||||
minLength: number;
|
||||
maxLength: number;
|
||||
requireUppercase: boolean;
|
||||
requireLowercase: boolean;
|
||||
requireDigit: boolean;
|
||||
requireSpecialChar: boolean;
|
||||
expireDays: number;
|
||||
maxRetryCount: number;
|
||||
lockTimeMinutes: number;
|
||||
remark: string;
|
||||
}
|
||||
|
||||
interface PwConfigState {
|
||||
ruleForm: RuleFormState;
|
||||
rules: FormRules;
|
||||
loading: boolean;
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'systemPwConfig',
|
||||
setup() {
|
||||
const formRef = ref<FormInstance>();
|
||||
const state = reactive<PwConfigState>({
|
||||
loading: false,
|
||||
ruleForm: {
|
||||
enabled: false,
|
||||
minLength: 8,
|
||||
maxLength: 32,
|
||||
requireUppercase: false,
|
||||
requireLowercase: true,
|
||||
requireDigit: true,
|
||||
requireSpecialChar: false,
|
||||
expireDays: 90,
|
||||
maxRetryCount: 5,
|
||||
lockTimeMinutes: 30,
|
||||
remark: '',
|
||||
},
|
||||
rules: {
|
||||
minLength: [
|
||||
{ required: true, message: '请输入最小密码长度', trigger: 'blur' }
|
||||
],
|
||||
maxLength: [
|
||||
{ required: true, message: '请输入最大密码长度', trigger: 'blur' }
|
||||
],
|
||||
expireDays: [
|
||||
{ required: true, message: '请输入密码过期天数', trigger: 'blur' }
|
||||
],
|
||||
maxRetryCount: [
|
||||
{ required: true, message: '请输入登录失败锁定次数', trigger: 'blur' }
|
||||
],
|
||||
lockTimeMinutes: [
|
||||
{ required: true, message: '请输入锁定时长', trigger: 'blur' }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
// 获取配置
|
||||
const loadConfig = async () => {
|
||||
try {
|
||||
const res: any = await getPwConfig();
|
||||
if (res.code === 0 && res.data) {
|
||||
state.ruleForm = {
|
||||
...state.ruleForm,
|
||||
...res.data,
|
||||
};
|
||||
}
|
||||
} catch {
|
||||
// 错误由全局拦截器处理
|
||||
}
|
||||
};
|
||||
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
loadConfig();
|
||||
};
|
||||
|
||||
// 保存配置
|
||||
const onSubmit = async () => {
|
||||
const formWrap = unref(formRef);
|
||||
if (!formWrap) return;
|
||||
|
||||
await formWrap.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
// 验证最小长度不大于最大长度
|
||||
if (state.ruleForm.minLength > state.ruleForm.maxLength) {
|
||||
ElMessage.error('最小密码长度不能大于最大密码长度');
|
||||
return;
|
||||
}
|
||||
|
||||
state.loading = true;
|
||||
try {
|
||||
await savePwConfig(state.ruleForm);
|
||||
ElMessage.success('保存成功');
|
||||
} finally {
|
||||
state.loading = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
loadConfig();
|
||||
});
|
||||
|
||||
return {
|
||||
formRef,
|
||||
onSubmit,
|
||||
resetForm,
|
||||
...toRefs(state),
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.text-muted {
|
||||
color: var(--el-text-color-placeholder);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.system-pwconfig-container {
|
||||
:deep(.el-card__body) {
|
||||
padding-top: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,19 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDCTCCAfGgAwIBAgIUYPm47gB5/E1nGqiCSdyGLE6hK/MwDQYJKoZIhvcNAQEL
|
||||
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI2MDUyMDA1NDg1MVoXDTM2MDUx
|
||||
NzA1NDg1MVowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAQ8AMIIBCgKCAQEAiXk9CZgDdtkAmIfw/3iFo2G9WA7ctgBSjG+0MKe2rp0P
|
||||
WfnpiBAG3jiFLT+TUvcleXEUdukcN2wlr8e3jaHSv6cEI4OKk5OsBk8FY1QnenD1
|
||||
NeYUovKppMklAG9PfzOtFY0upu3bQtG5+P2j0+9s3+Rci2YHVX/T5L8TnKGqUkDw
|
||||
gEY//KtUSmvmCbqNOw5t13GYTUvEsfrDVicwlWgyvPCbmPtLRKF4gTBGvGh0Q8x6
|
||||
PqWRU80/MU0NXHYcdPYtHljjRU5tLq/YxTqYvGKCd1fLq2BlG54mjUU9wfDvyh/N
|
||||
YGkX+Pw8JWbvka5V9K1sqxM4j3wqPJPiIJbrAf561wIDAQABo1MwUTAdBgNVHQ4E
|
||||
FgQUOws9qwD3ykeP1cFoVkAh3w3MzIIwHwYDVR0jBBgwFoAUOws9qwD3ykeP1cFo
|
||||
VkAh3w3MzIIwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAJytt
|
||||
ZQj8E+PohYYKzNjWj+NwoldKpNeCTr73zIwTB20C1GdusxU5AiGC6spT3hKk2rMU
|
||||
CRIlhpfFbTQX5GIxOsWAQ2ru1zmN0L0mA25TZ6c/D6RZPVMjTTolLKIghdQkAyFm
|
||||
Twclb7yTILu7HEj4xf2xiVT98ZxZMGfiwCm3PlB7ur9CqMBRF4IDxQ+s60oHKdcj
|
||||
tHmUv/g/t4y9aIaqyqQuPeERU7BWdDLEyE4WrPijw2cif6IhaJeK29iqIHqb3vo8
|
||||
YMj9Ef/83Csks8idDz5r0rVa2MB5hf11FBe+gLVAh8vOiXMaBnoiTBPhiGfIZTBl
|
||||
uJjuVzPObt0drvdZwQ==
|
||||
-----END CERTIFICATE-----
|
||||
27
ssl/gitea.redpowerfuture.com.key
Normal file
27
ssl/gitea.redpowerfuture.com.key
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEAqlbH8ExzyW3D87glDgjSz6IoKWmV1iZh33DIYmDFzbaGqdBZ
|
||||
gWyW4TWbBn9huVDrglShjeIEjAdfK3BcHKv4/xh+XjGjzp/GyvKkggLGB2Itc3Wq
|
||||
wxlyAhlm7tgU0bmQGPu/+CnIvmss7lKWx9b5L9eYU+ToU3r/GOP4juGqcUYHLyhW
|
||||
ZDjy2fjO5Ju4/W0U1OcaLho1Sapn9EFXFIjJ5RbiiOF8QVo8Ez3EbV/EsQowaIvp
|
||||
OoqLT1GGBRd6sz/L1TMliw6UPcGd+TTaADTh4PxSklYsXqro0vstft0kiuAElah3
|
||||
Hw3XZMNiRfAqJVvhc8/pXdA6kH4FuZKfxAF8CwIDAQABAoIBAEwB8DKKMsppZ9wr
|
||||
SaGTD1pmHayo+Bq4Qsj83vWDABCUh09j8GR/i23PyS6jjXwvHv+nevVAKs4/Bdjw
|
||||
yLFkjXVqvQyT8ueixQZPMlfvG+U0ilpwYXOwOX61Tgh6tAOHXUTApT77ih9p3IE1
|
||||
qiFfDA8skUSyKncBta2qIAHFsZPcNGB+44hv5AT1aaXtZbuFdwAoptIpNDaWVmbo
|
||||
cjm6AEHOoiTfXx437ORAx+F3e2umzBVkLQZNLPlYsz0pFN8elZAde1e13kAPUaHa
|
||||
q5g49Yad4UA3iIO6xo3kZz90BGMlcbe0ckY8wOg9biF4zTxVg0unbvk4DZve8iTZ
|
||||
hDrrAF0CgYEA3oakLouCgo/JWERfXVTYVyTvuh8wkYmsndV4s7hENIjhEiKrgfW1
|
||||
4RfnVNEjgEbsukgyMj8GpeXp9d8mC5Jz9uhKbbpCbLIuTdZpeNvob4RA1a+rgP6L
|
||||
Fan3W9yrMqmrz7gLW2PsPmU3vnn8SI/8QlgwmNLutbMPncWJzNukMM0CgYEAw/Zy
|
||||
dqFjNIgHemnYpK1R0xcLVs6MTOOwqEv0xUor1fZujLittRbb4JAqDlUwQNU6Zn6K
|
||||
xxuSJ3TrRHqpjLcT812yPeMXd1f7jzCnZXDkWYoUT/ILjIB9cEJuycTwDwMJGkPd
|
||||
RGV+gyBPHYBM6+hhxh1YSYm0CebDPMRMC7anADcCgYBg/KYKc1vKtAi5o/M8poI0
|
||||
WTDzGiz9AdhuYmBdVG7FxvLyCJJf7kv7c4OsAAtNGZyMBHN8WuP24qJ6O2xFlutc
|
||||
LhpigM/6uB5eZplJx+8iy63GdO53JnpQUugw7ZjgV/s+aaTpjD+nYk5NgrVmmvsD
|
||||
n5Rux2CraQPha/uHgiOp8QKBgQCwqh6ZOnfgZP4w6vmnxKUu4+iSEtXDf8XEg+2g
|
||||
a3THiUoyzU+1IW2Krw1rLHu7B0CGJHDifcWukqaDbv4p4Oc4kPDfADsomYYtmhRf
|
||||
zH3hBy22wSSOP0xXB10vw78UGY18Q1BYmBONDXSlyQQP7ckvvUbZzS4lewfqYaGZ
|
||||
Mcqu0wKBgDh2tcdxuHUizlRAPwfoZ3JhbITJqGytkpZT96WpQ0fpzcSovNJf0shC
|
||||
5gXCzWWRKQPxV7cUXmB6hBm1Q6WoZ/VKN36+R+7L8Pt7yTmZhBxQKVjVn3k849JC
|
||||
tcWDXiZd5qINC7dsH/vjLahnr76cFtYfNM5stomJkKNRjC7hZfnw
|
||||
-----END RSA PRIVATE KEY-----
|
||||
62
ssl/gitea.redpowerfuture.com.pem
Normal file
62
ssl/gitea.redpowerfuture.com.pem
Normal file
@@ -0,0 +1,62 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIGJTCCBQ2gAwIBAgIQCXpUlFT9Cue3+TsPpxvnWjANBgkqhkiG9w0BAQsFADBu
|
||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||
d3cuZGlnaWNlcnQuY29tMS0wKwYDVQQDEyRFbmNyeXB0aW9uIEV2ZXJ5d2hlcmUg
|
||||
RFYgVExTIENBIC0gRzIwHhcNMjYwNjEwMDAwMDAwWhcNMjYwOTA3MjM1OTU5WjAj
|
||||
MSEwHwYDVQQDExhnaXRlYS5yZWRwb3dlcmZ1dHVyZS5jb20wggEiMA0GCSqGSIb3
|
||||
DQEBAQUAA4IBDwAwggEKAoIBAQCqVsfwTHPJbcPzuCUOCNLPoigpaZXWJmHfcMhi
|
||||
YMXNtoap0FmBbJbhNZsGf2G5UOuCVKGN4gSMB18rcFwcq/j/GH5eMaPOn8bK8qSC
|
||||
AsYHYi1zdarDGXICGWbu2BTRuZAY+7/4Kci+ayzuUpbH1vkv15hT5OhTev8Y4/iO
|
||||
4apxRgcvKFZkOPLZ+M7km7j9bRTU5xouGjVJqmf0QVcUiMnlFuKI4XxBWjwTPcRt
|
||||
X8SxCjBoi+k6iotPUYYFF3qzP8vVMyWLDpQ9wZ35NNoANOHg/FKSVixequjS+y1+
|
||||
3SSK4ASVqHcfDddkw2JF8ColW+Fzz+ld0DqQfgW5kp/EAXwLAgMBAAGjggMIMIID
|
||||
BDAfBgNVHSMEGDAWgBR435GQX+7erPbFdevVTFVT7yRKtjAdBgNVHQ4EFgQUOiq0
|
||||
OCRofHA6BrxoM9do+AWnNgowQQYDVR0RBDowOIIYZ2l0ZWEucmVkcG93ZXJmdXR1
|
||||
cmUuY29tghx3d3cuZ2l0ZWEucmVkcG93ZXJmdXR1cmUuY29tMD4GA1UdIAQ3MDUw
|
||||
MwYGZ4EMAQIBMCkwJwYIKwYBBQUHAgEWG2h0dHA6Ly93d3cuZGlnaWNlcnQuY29t
|
||||
L0NQUzAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF
|
||||
BwMCMIGABggrBgEFBQcBAQR0MHIwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRp
|
||||
Z2ljZXJ0LmNvbTBKBggrBgEFBQcwAoY+aHR0cDovL2NhY2VydHMuZGlnaWNlcnQu
|
||||
Y29tL0VuY3J5cHRpb25FdmVyeXdoZXJlRFZUTFNDQS1HMi5jcnQwDAYDVR0TAQH/
|
||||
BAIwADCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHUAwjF+V0UZo0XufzjespBB
|
||||
68fCIVoiv3/Vta12mtkOUs0AAAGesEYy8QAABAMARjBEAiBD7255l5PRI6mZXWxU
|
||||
iC7txvWxkLlBgVFzAkRrMW7RXQIgZyupslAslfGDqDMk9H948AFZGe0JwB6YiuXK
|
||||
lx1sox0AdgDYCVU7lE96/8gWGW+UT4WrsPj8XodVJg8V0S5yu0VLFAAAAZ6wRjNI
|
||||
AAAEAwBHMEUCIBqfIfl4sL0ME60NI0KG6JIHImcJjR5qkLGDjCp3sEhrAiEA4cvy
|
||||
yFaz3BSjjQa+UspsqgfKxeTjCLJq5pLbDcgBgGQAdgCUTkOH+uzB74HzGSQmqBhl
|
||||
AcfTXzgCAT9yZ31VNy4Z2AAAAZ6wRjL3AAAEAwBHMEUCIQDIIa8mLpO6BmhgCecw
|
||||
pI+QNznn4lhIxmtJQyHmZo7qRAIgFPq9xlLLqqe5/+WgcNwoawggpi8skhg8t/yT
|
||||
JJ5TmV0wDQYJKoZIhvcNAQELBQADggEBAOeiZrRwpNh/bNIuKe+1vWBrLHu2Zj70
|
||||
cKAVUhT08ZAl8scEYusbuqtSAq+oz9sm595YyPgmrB0wSZEMTd/+pUy5GrrJAXal
|
||||
kOx1a3TBxCvpK9F4T7KmBaBWA5HuljHfw9833jXi7v9jLYShDjyNRzSWeKl41kdt
|
||||
Hq4CbDLXp9XVzVPBlOongGZV/6cDrvy4hoJcBq8UANU/QWw0PaJQWxPwHcULekBw
|
||||
AefTX7JwKbHcZ3gGV4EzJU/eoycBOu9VsYgJu9U+p1nNjYHwS8RQjij+cgs8r5Wx
|
||||
r4+wYkdN2767iK2+NRRdQD/ZqBMTgSZ6AXCM7gS8oP/ylLwnzyq7ikc=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEqjCCA5KgAwIBAgIQDeD/te5iy2EQn2CMnO1e0zANBgkqhkiG9w0BAQsFADBh
|
||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
|
||||
MjAeFw0xNzExMjcxMjQ2NDBaFw0yNzExMjcxMjQ2NDBaMG4xCzAJBgNVBAYTAlVT
|
||||
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
|
||||
b20xLTArBgNVBAMTJEVuY3J5cHRpb24gRXZlcnl3aGVyZSBEViBUTFMgQ0EgLSBH
|
||||
MjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO8Uf46i/nr7pkgTDqnE
|
||||
eSIfCFqvPnUq3aF1tMJ5hh9MnO6Lmt5UdHfBGwC9Si+XjK12cjZgxObsL6Rg1njv
|
||||
NhAMJ4JunN0JGGRJGSevbJsA3sc68nbPQzuKp5Jc8vpryp2mts38pSCXorPR+sch
|
||||
QisKA7OSQ1MjcFN0d7tbrceWFNbzgL2csJVQeogOBGSe/KZEIZw6gXLKeFe7mupn
|
||||
NYJROi2iC11+HuF79iAttMc32Cv6UOxixY/3ZV+LzpLnklFq98XORgwkIJL1HuvP
|
||||
ha8yvb+W6JislZJL+HLFtidoxmI7Qm3ZyIV66W533DsGFimFJkz3y0GeHWuSVMbI
|
||||
lfsCAwEAAaOCAU8wggFLMB0GA1UdDgQWBBR435GQX+7erPbFdevVTFVT7yRKtjAf
|
||||
BgNVHSMEGDAWgBROIlQgGJXm427mD/r6uRLtBhePOTAOBgNVHQ8BAf8EBAMCAYYw
|
||||
HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8C
|
||||
AQAwNAYIKwYBBQUHAQEEKDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdp
|
||||
Y2VydC5jb20wQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybDMuZGlnaWNlcnQu
|
||||
Y29tL0RpZ2lDZXJ0R2xvYmFsUm9vdEcyLmNybDBMBgNVHSAERTBDMDcGCWCGSAGG
|
||||
/WwBAjAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5jb20vQ1BT
|
||||
MAgGBmeBDAECATANBgkqhkiG9w0BAQsFAAOCAQEAoBs1eCLKakLtVRPFRjBIJ9LJ
|
||||
L0s8ZWum8U8/1TMVkQMBn+CPb5xnCD0GSA6L/V0ZFrMNqBirrr5B241OesECvxIi
|
||||
98bZ90h9+q/X5eMyOD35f8YTaEMpdnQCnawIwiHx06/0BfiTj+b/XQih+mqt3ZXe
|
||||
xNCJqKexdiB2IWGSKcgahPacWkk/BAQFisKIFYEqHzV974S3FAz/8LIfD58xnsEN
|
||||
GfzyIDkH3JrwYZ8caPTf6ZX9M1GrISN8HnWTtdNCH2xEajRa/h9ZBXjUyFKQrGk2
|
||||
n2hcLrfZSbynEC/pSw/ET7H5nWwckjmAJ1l9fcnbqkU/pf6uMQmnfl0JQjJNSg==
|
||||
-----END CERTIFICATE-----
|
||||
27
ssl/minio.redpowerfuture.com.key
Normal file
27
ssl/minio.redpowerfuture.com.key
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAvoMUrxhR2vYC/tyGZlplkANptmFfqcglnd+ETk1ppE/tMyrI
|
||||
PxBLvjN1BIcbBFkHthuv/Ut/dSgtS0hbI52Z1bMACbJ5SdPLTBZzNpXgHWXUHf/S
|
||||
OsQB8s7gsCekcVly3Tf1emsXxcyeXQ7u8/ZrNEAKGZwT3xkAvtte01NqJeaIMddY
|
||||
1o/nrlVhgV6CvDtCAFLRVvw2p5zc/Vejc/MLEXV4l9g3VIODfcIbLsczUmsT98zO
|
||||
LOwwgVssCQcdnA12T1X3U4sX4U0Pin0MexT5L8/Kx3pHbajpQK+ID0TDpmP4QKf5
|
||||
QkAHJxM7py4u1EHNBo3nkrxWNPfZTTnhbvowjwIDAQABAoIBAAcLQ14FU615ZXtK
|
||||
kxZAvGWamAjcHn82vRv9EjVvoPrS0Q3lxI6ptGs9bX5eh84ILq6kj8QZS7FSFs6k
|
||||
R75lit+/D77MCwutmY7gJkq74ulOBQ2bkl3a4R7lraLFwcubx5FMtYuyXv17cdWL
|
||||
V6Qh6y0nkFgJuyWyFSLOwKRRVBOU8KTldFLR+iF7oULALpUZeci9RF+EEGKarFmp
|
||||
07OjPbLjdBl+FT05c2KRy4lVl+BRQB6YfU+Al84VQPdoE8byE3mrzomo6CiMTCQ9
|
||||
aNN2QfpVZ6x16gOEcgpJZHYvD+gC5H7q//TWBJ/jdR6ToKYcRK7HOJQjZgUFLSUs
|
||||
wCf1ybkCgYEA7V7XkB10SdfT2axO2jdsRM3kW1U86k//dF26G4OKlRmWpibcJXnk
|
||||
i0M3be0b1VrqefYEWot3MVhJheQCCa+tNR4hSovN7FqCNVUzXZ8YWrTaycXi46po
|
||||
urfRLUeupTXJinBfmIPCdbqr0bPOJ0q5NfpG+LeG0LlsAfxjALgjGrcCgYEAzXbG
|
||||
0TLaDNwB3aXTUPpsL7DrrQTaVi9ScH5sa2IJjes2Pv/MyTB05JyHG9rqAtIShjJi
|
||||
/N3qMnN0q40GSnzPj99+Sep3p+41LvxfvRma9HMZRnczyPZIT31TMQF++QP3d8gz
|
||||
giDVNND0GXY11bwcqIuS+ouNwU4P6tvLKznQIOkCgYEAxBZ0JuZeGV5E8O2p2hSs
|
||||
yQ35FgYNI1dgpUWEJ5R71/3ieHFjrUXLqcumL5YPRyoqxwOXxyCtH0NawVOA53WL
|
||||
tXSldcqWGykNpXczzqRN3yjGEKb7bq1ohM6y6x/rQylyy31XS0uVSeIibEKIC+dr
|
||||
pw6QsIgTw7tZYS6YrpBu13MCgYBb5t7zP+2shtQG0l98/yZZBqfEEkGe/ze+va29
|
||||
MnLXmff/oed1rkj64NDGMtstO82xXORN+u0AeAgdm8zOkJk+31bbtRakdLYxOA2S
|
||||
xds7sCgEDtmI8DBT7djCOMsUkyOj3la7w/fZ0gT9RpS575RaB2RM0RMs/b+862cr
|
||||
BIcF0QKBgQCrO6f1zj9vr4h3nWohSjgpAkZHpeUxDf6s39U960JU5Dvz/bhCHr51
|
||||
uuVO183cFmx9W8IW6BI4dwEKk5MrXD2hdM8uGAIi+ip/SwBqej072HuY1xD2Elp9
|
||||
mWXLESLAedhWvp9QhNQbHib1RzaPV8TUgCDN/QLGQE+jdVqfk/Smfw==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
62
ssl/minio.redpowerfuture.com.pem
Normal file
62
ssl/minio.redpowerfuture.com.pem
Normal file
@@ -0,0 +1,62 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIGJTCCBQ2gAwIBAgIQAWng8l3t5rBYcCmLpCDdJTANBgkqhkiG9w0BAQsFADBu
|
||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||
d3cuZGlnaWNlcnQuY29tMS0wKwYDVQQDEyRFbmNyeXB0aW9uIEV2ZXJ5d2hlcmUg
|
||||
RFYgVExTIENBIC0gRzIwHhcNMjYwNjEyMDAwMDAwWhcNMjYwOTA5MjM1OTU5WjAj
|
||||
MSEwHwYDVQQDExhtaW5pby5yZWRwb3dlcmZ1dHVyZS5jb20wggEiMA0GCSqGSIb3
|
||||
DQEBAQUAA4IBDwAwggEKAoIBAQC+gxSvGFHa9gL+3IZmWmWQA2m2YV+pyCWd34RO
|
||||
TWmkT+0zKsg/EEu+M3UEhxsEWQe2G6/9S391KC1LSFsjnZnVswAJsnlJ08tMFnM2
|
||||
leAdZdQd/9I6xAHyzuCwJ6RxWXLdN/V6axfFzJ5dDu7z9ms0QAoZnBPfGQC+217T
|
||||
U2ol5ogx11jWj+euVWGBXoK8O0IAUtFW/DannNz9V6Nz8wsRdXiX2DdUg4N9whsu
|
||||
xzNSaxP3zM4s7DCBWywJBx2cDXZPVfdTixfhTQ+KfQx7FPkvz8rHekdtqOlAr4gP
|
||||
RMOmY/hAp/lCQAcnEzunLi7UQc0GjeeSvFY099lNOeFu+jCPAgMBAAGjggMIMIID
|
||||
BDAfBgNVHSMEGDAWgBR435GQX+7erPbFdevVTFVT7yRKtjAdBgNVHQ4EFgQUm+W1
|
||||
VEi2C0CdxtuncyBFtX9cS5UwQQYDVR0RBDowOIIYbWluaW8ucmVkcG93ZXJmdXR1
|
||||
cmUuY29tghx3d3cubWluaW8ucmVkcG93ZXJmdXR1cmUuY29tMD4GA1UdIAQ3MDUw
|
||||
MwYGZ4EMAQIBMCkwJwYIKwYBBQUHAgEWG2h0dHA6Ly93d3cuZGlnaWNlcnQuY29t
|
||||
L0NQUzAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF
|
||||
BwMCMIGABggrBgEFBQcBAQR0MHIwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRp
|
||||
Z2ljZXJ0LmNvbTBKBggrBgEFBQcwAoY+aHR0cDovL2NhY2VydHMuZGlnaWNlcnQu
|
||||
Y29tL0VuY3J5cHRpb25FdmVyeXdoZXJlRFZUTFNDQS1HMi5jcnQwDAYDVR0TAQH/
|
||||
BAIwADCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHUAwjF+V0UZo0XufzjespBB
|
||||
68fCIVoiv3/Vta12mtkOUs0AAAGeucefAgAABAMARjBEAiBdD793ndAhFw/xk4gS
|
||||
Pycc/U4IGSbSFNg1wXMMBkma9gIgSK8LNW9lqHn4wEYFRQrBfmYMUkJhUR51JmOb
|
||||
rUESBu8AdgDXbX0Q0af1d8LH6V/XAL/5gskzWmXh0LMBcxfAyMVpdwAAAZ65x57r
|
||||
AAAEAwBHMEUCIALrNS+sHrfHVl72YGHkqSb4quYzH6xZ0JNCTLakfjK4AiEA0jbR
|
||||
ORUL7BLzYbw5geZfMb8NJmD+7CbgXdHNPWmowdYAdgCUTkOH+uzB74HzGSQmqBhl
|
||||
AcfTXzgCAT9yZ31VNy4Z2AAAAZ65x58NAAAEAwBHMEUCIQCn753LSIK5ODnAw8za
|
||||
2BUf7PZQhtwhe1I0fEfrFjwcAAIgPZtnV83cNV8UK9zGQhWso4QX/oK+ziXQMuP5
|
||||
+lApPpcwDQYJKoZIhvcNAQELBQADggEBAKceFp1JWPgaR5TGrMXQNY0qgRPhY0ZC
|
||||
MSVLqtbgWPeODl3p+BTpLJ/taGR1v1mlL/2cM+EU/RQVDobYUu91Td0Tibp1T8vv
|
||||
KKgnGTj8fVTzimTR5YsFHKc0XFqHpbneArZFb9tbMnRLheDjAqJ3Xs5H5t/XNDSi
|
||||
vasqxdvAYZPP+7JZPRrFqq/fPZR79NRz7kl45YiQX199d/8oPRVFRrq1TGtp41Nk
|
||||
7rP31tq0YZDpBHXXmpYXmOZalWBHoASnZJDq0+H5bSBzNVHR25eOZe0dt5lWMzrf
|
||||
bzFMatWnPKI/aLhc3GGZAxyy7PCRA5pJGB+qnaJAakODvB02VvJey/Y=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEqjCCA5KgAwIBAgIQDeD/te5iy2EQn2CMnO1e0zANBgkqhkiG9w0BAQsFADBh
|
||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
|
||||
MjAeFw0xNzExMjcxMjQ2NDBaFw0yNzExMjcxMjQ2NDBaMG4xCzAJBgNVBAYTAlVT
|
||||
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
|
||||
b20xLTArBgNVBAMTJEVuY3J5cHRpb24gRXZlcnl3aGVyZSBEViBUTFMgQ0EgLSBH
|
||||
MjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO8Uf46i/nr7pkgTDqnE
|
||||
eSIfCFqvPnUq3aF1tMJ5hh9MnO6Lmt5UdHfBGwC9Si+XjK12cjZgxObsL6Rg1njv
|
||||
NhAMJ4JunN0JGGRJGSevbJsA3sc68nbPQzuKp5Jc8vpryp2mts38pSCXorPR+sch
|
||||
QisKA7OSQ1MjcFN0d7tbrceWFNbzgL2csJVQeogOBGSe/KZEIZw6gXLKeFe7mupn
|
||||
NYJROi2iC11+HuF79iAttMc32Cv6UOxixY/3ZV+LzpLnklFq98XORgwkIJL1HuvP
|
||||
ha8yvb+W6JislZJL+HLFtidoxmI7Qm3ZyIV66W533DsGFimFJkz3y0GeHWuSVMbI
|
||||
lfsCAwEAAaOCAU8wggFLMB0GA1UdDgQWBBR435GQX+7erPbFdevVTFVT7yRKtjAf
|
||||
BgNVHSMEGDAWgBROIlQgGJXm427mD/r6uRLtBhePOTAOBgNVHQ8BAf8EBAMCAYYw
|
||||
HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8C
|
||||
AQAwNAYIKwYBBQUHAQEEKDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdp
|
||||
Y2VydC5jb20wQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybDMuZGlnaWNlcnQu
|
||||
Y29tL0RpZ2lDZXJ0R2xvYmFsUm9vdEcyLmNybDBMBgNVHSAERTBDMDcGCWCGSAGG
|
||||
/WwBAjAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5jb20vQ1BT
|
||||
MAgGBmeBDAECATANBgkqhkiG9w0BAQsFAAOCAQEAoBs1eCLKakLtVRPFRjBIJ9LJ
|
||||
L0s8ZWum8U8/1TMVkQMBn+CPb5xnCD0GSA6L/V0ZFrMNqBirrr5B241OesECvxIi
|
||||
98bZ90h9+q/X5eMyOD35f8YTaEMpdnQCnawIwiHx06/0BfiTj+b/XQih+mqt3ZXe
|
||||
xNCJqKexdiB2IWGSKcgahPacWkk/BAQFisKIFYEqHzV974S3FAz/8LIfD58xnsEN
|
||||
GfzyIDkH3JrwYZ8caPTf6ZX9M1GrISN8HnWTtdNCH2xEajRa/h9ZBXjUyFKQrGk2
|
||||
n2hcLrfZSbynEC/pSw/ET7H5nWwckjmAJ1l9fcnbqkU/pf6uMQmnfl0JQjJNSg==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,28 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCJeT0JmAN22QCY
|
||||
h/D/eIWjYb1YDty2AFKMb7Qwp7aunQ9Z+emIEAbeOIUtP5NS9yV5cRR26Rw3bCWv
|
||||
x7eNodK/pwQjg4qTk6wGTwVjVCd6cPU15hSi8qmkySUAb09/M60VjS6m7dtC0bn4
|
||||
/aPT72zf5FyLZgdVf9PkvxOcoapSQPCARj/8q1RKa+YJuo07Dm3XcZhNS8Sx+sNW
|
||||
JzCVaDK88JuY+0tEoXiBMEa8aHRDzHo+pZFTzT8xTQ1cdhx09i0eWONFTm0ur9jF
|
||||
Opi8YoJ3V8urYGUbniaNRT3B8O/KH81gaRf4/DwlZu+RrlX0rWyrEziPfCo8k+Ig
|
||||
lusB/nrXAgMBAAECggEAAgqvqp0/++vv6OOM1AQVe8kBVbXp8u1hDmv2mGcQqZBN
|
||||
wJCT1Yod0i26/fW6/Y2XnhZwesdVFci62K5rQxkL46i1peufedr+7r+J6cfTFGYU
|
||||
oOlY/msaT4NGDieNbXqPeIujO/9sdRoCCRoC6PYYUoNfEWe7qJs5nBsxPiW7YCwK
|
||||
Kg2h932FOvI+7AxllV0vUsHfPYbirH4jl0b00lKoeUdQh8pB4hTUMgksCEWnJwr3
|
||||
4YQz3iqwIbWTy3/c1EULV0x5QmP0CsadSLSddo8gOB8k4aJStfNGzTuuLsrsETSU
|
||||
NifQGsP1YzHMieKT3BqwoZeoIqXng0O1dGyPsaZMKQKBgQC9i/Ii6HL2UdpgDTq4
|
||||
m+jFyEaSAXkOoIivhjRmoZhpBUNRJsIpm4xQPjYiO68USl5XkxxHqiMqF1SDxLAW
|
||||
9WViuytkDM/uawSY8F/f3PoKKPdJCM1NE34oEWOp7Hs+HWOhhtJqUxDzKJLwfASV
|
||||
blwLGJ5XlEbMuf/D79hW2kez7wKBgQC5q6r0C4c+ayfAn7RftopIu8VCquNNwdGh
|
||||
qQfMuGKDXPZfwBYDlZWHXwbH8CrlNHfPpZCRH8fmPK5T6zCX6XrrccJ+GMcFFwuw
|
||||
vOMkVYQOfL8Y6WfnzRpC2hZPIbNxSJbt8PEzZleCWuyvl2RULj+XCEDBRrSnzkRf
|
||||
UW3bBUYfmQKBgQCmQXYlgFY2EB3HWlNDUh2ePckIkBoq5kx+CO01iFAy7dbZ+3Eb
|
||||
JcCxMaAx7r/mwER39CU+BtHJPaV33rHFsYE4VIv+ue44Zc4mh9DQfvciqkQc34eU
|
||||
L6DcbERK644+MXEOYT92211mqxQXs/AhUieR5AofL4PaVtssddgAdn2mKQKBgQCd
|
||||
08Rc8RPExlejUN6F4ehIjXzP/+16YoAtGD8uEaqEGdjAacsMvvG9gdSEzq3X6jLS
|
||||
St3JzycgmoJhiXHkIC9BxpDamXtL41wnn1jBwQOhQP88UOPnUhy5qSL/nxkm+dp6
|
||||
Zq7Rz3QhteKuHFXHjQy2+Of6o3zbi+Xo1JI6dJA4OQKBgGK/L+ImW1930CwBEvR/
|
||||
pLwCvwEhP5EXd7SJtCuubPiKsnNS3Bb8FqiKYlOX3ANz2z2EoBdJQvTGhca6ORhU
|
||||
Gr5s61dui2np1aH2NduxmeJx2ywhkaNfz/j1mbESh2CjqkO5qvN96z6EST5KlDqP
|
||||
zFDSFLd4cs0yRko2tulKVAAU
|
||||
-----END PRIVATE KEY-----
|
||||
62
ssl/scs1779764972146_redpowerfuture.com_server.crt
Normal file
62
ssl/scs1779764972146_redpowerfuture.com_server.crt
Normal file
@@ -0,0 +1,62 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIGCTCCBPGgAwIBAgIQCbk8r0AqeDTQmt8tQBlLTzANBgkqhkiG9w0BAQsFADBu
|
||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||
d3cuZGlnaWNlcnQuY29tMS0wKwYDVQQDEyRFbmNyeXB0aW9uIEV2ZXJ5d2hlcmUg
|
||||
RFYgVExTIENBIC0gRzIwHhcNMjYwNTI2MDAwMDAwWhcNMjYwODI1MjM1OTU5WjAd
|
||||
MRswGQYDVQQDExJyZWRwb3dlcmZ1dHVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUA
|
||||
A4IBDwAwggEKAoIBAQDaa/u6fK1eth80Wnn3Er/tzwUrWNT+yKeXd6Hus35C4lwD
|
||||
euIv9nG+45iggLVDJvD/NCT4LlNUbZ/57MEIagpanOfbVKW+xSaYpFbhLoy+hwWU
|
||||
pK4mDyv0MtzSTiFbZKU+LepiJwyjwnnbyR71Xik0nbxb68lBC/wYlMtuvn8oIfdB
|
||||
j/xDxhsel4rt+gekSmmycFS4Jh5HVky8ofUVN3SbdFWgCkyPM68zc+hw2MqRHjfK
|
||||
sgjx2b/WaLfSi8qBJF1oqLlqX9BsNzCP7tTBUH1o5VTPtgP1ICkp+JTlQp3WM6ua
|
||||
sljXnTUdAHdvytCFd/mSFFQ1HeaYceFtRcNYxf7PAgMBAAGjggLyMIIC7jAfBgNV
|
||||
HSMEGDAWgBR435GQX+7erPbFdevVTFVT7yRKtjAdBgNVHQ4EFgQUhlGg1Q8rQeyT
|
||||
BZpspLDJcVphGZ0wNQYDVR0RBC4wLIIScmVkcG93ZXJmdXR1cmUuY29tghZ3d3cu
|
||||
cmVkcG93ZXJmdXR1cmUuY29tMD4GA1UdIAQ3MDUwMwYGZ4EMAQIBMCkwJwYIKwYB
|
||||
BQUHAgEWG2h0dHA6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzAOBgNVHQ8BAf8EBAMC
|
||||
BaAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwgYAGCCsGAQUFBwEBBHQwcjAkBggrBgEF
|
||||
BQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMEoGCCsGAQUFBzAChj5odHRw
|
||||
Oi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRW5jcnlwdGlvbkV2ZXJ5d2hlcmVEVlRM
|
||||
U0NBLUcyLmNydDAMBgNVHRMBAf8EAjAAMIIBfQYKKwYBBAHWeQIEAgSCAW0EggFp
|
||||
AWcAdgDCMX5XRRmjRe5/ON6ykEHrx8IhWiK/f9W1rXaa2Q5SzQAAAZ5iSF5XAAAE
|
||||
AwBHMEUCIAr6FBJHXrAg0wjPX0PStK+tIhQ/94KkU4PBR4WsTxRtAiEArtDnplV+
|
||||
9hbjOs0j2cRlxGuE8QtM/pmlIV+jtkZwgsQAdQDXbX0Q0af1d8LH6V/XAL/5gskz
|
||||
WmXh0LMBcxfAyMVpdwAAAZ5iSF4uAAAEAwBGMEQCICS/ddUJMlaxmEvuk4My/cZ4
|
||||
TNmensyP/TbnJSpyoYdIAiBy0v/DYnFCYU+Y6KXUUJj8kTJlBR87sloDEIS/HdOl
|
||||
7AB2AJROQ4f67MHvgfMZJCaoGGUBx9NfOAIBP3JnfVU3LhnYAAABnmJIXmUAAAQD
|
||||
AEcwRQIgDZdQPgnfZBGbDfk01SeAbliEycANB1pkcLzIdc+L15UCIQCzk0mg544c
|
||||
efvISO7fIbjx0tEnUrItMLTsYXrxpzMwZzANBgkqhkiG9w0BAQsFAAOCAQEApYQk
|
||||
hfTsipwGQ/RDgmnbBrX54qHAU+u4ru3vKmQfWLt306fMw3njxWjxll0vv59Tst/v
|
||||
idaA57NocaYmPV3IvaWn2XNUwZt+YIO9xmbgJ8nRse3uGrfmu8oRrulWr0xu2Gh6
|
||||
FleqmGgYDP+2IGfupX+T5rhiAgH37ViG2Y8EmFZVKwG1JSzQPdUFwgiLQhU98PjR
|
||||
V0iZeUkHna2HhqLEMIYpQ2cC61AS4qkx2aQ9osg4wsYInqLuaCIbEYv5UEgLU5lR
|
||||
IyMfIKw8TSl9LekeksjIgKAVZQk6gYGqoQHR9HP0UIbFcu5yJ6Oar+IFBHPgWFCb
|
||||
D5k/3VsDjhXUNgLs1A==
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEqjCCA5KgAwIBAgIQDeD/te5iy2EQn2CMnO1e0zANBgkqhkiG9w0BAQsFADBh
|
||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
|
||||
MjAeFw0xNzExMjcxMjQ2NDBaFw0yNzExMjcxMjQ2NDBaMG4xCzAJBgNVBAYTAlVT
|
||||
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
|
||||
b20xLTArBgNVBAMTJEVuY3J5cHRpb24gRXZlcnl3aGVyZSBEViBUTFMgQ0EgLSBH
|
||||
MjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO8Uf46i/nr7pkgTDqnE
|
||||
eSIfCFqvPnUq3aF1tMJ5hh9MnO6Lmt5UdHfBGwC9Si+XjK12cjZgxObsL6Rg1njv
|
||||
NhAMJ4JunN0JGGRJGSevbJsA3sc68nbPQzuKp5Jc8vpryp2mts38pSCXorPR+sch
|
||||
QisKA7OSQ1MjcFN0d7tbrceWFNbzgL2csJVQeogOBGSe/KZEIZw6gXLKeFe7mupn
|
||||
NYJROi2iC11+HuF79iAttMc32Cv6UOxixY/3ZV+LzpLnklFq98XORgwkIJL1HuvP
|
||||
ha8yvb+W6JislZJL+HLFtidoxmI7Qm3ZyIV66W533DsGFimFJkz3y0GeHWuSVMbI
|
||||
lfsCAwEAAaOCAU8wggFLMB0GA1UdDgQWBBR435GQX+7erPbFdevVTFVT7yRKtjAf
|
||||
BgNVHSMEGDAWgBROIlQgGJXm427mD/r6uRLtBhePOTAOBgNVHQ8BAf8EBAMCAYYw
|
||||
HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8C
|
||||
AQAwNAYIKwYBBQUHAQEEKDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdp
|
||||
Y2VydC5jb20wQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybDMuZGlnaWNlcnQu
|
||||
Y29tL0RpZ2lDZXJ0R2xvYmFsUm9vdEcyLmNybDBMBgNVHSAERTBDMDcGCWCGSAGG
|
||||
/WwBAjAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5jb20vQ1BT
|
||||
MAgGBmeBDAECATANBgkqhkiG9w0BAQsFAAOCAQEAoBs1eCLKakLtVRPFRjBIJ9LJ
|
||||
L0s8ZWum8U8/1TMVkQMBn+CPb5xnCD0GSA6L/V0ZFrMNqBirrr5B241OesECvxIi
|
||||
98bZ90h9+q/X5eMyOD35f8YTaEMpdnQCnawIwiHx06/0BfiTj+b/XQih+mqt3ZXe
|
||||
xNCJqKexdiB2IWGSKcgahPacWkk/BAQFisKIFYEqHzV974S3FAz/8LIfD58xnsEN
|
||||
GfzyIDkH3JrwYZ8caPTf6ZX9M1GrISN8HnWTtdNCH2xEajRa/h9ZBXjUyFKQrGk2
|
||||
n2hcLrfZSbynEC/pSw/ET7H5nWwckjmAJ1l9fcnbqkU/pf6uMQmnfl0JQjJNSg==
|
||||
-----END CERTIFICATE-----
|
||||
27
ssl/scs1779764972146_redpowerfuture.com_server.key
Normal file
27
ssl/scs1779764972146_redpowerfuture.com_server.key
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEA2mv7unytXrYfNFp59xK/7c8FK1jU/sinl3eh7rN+QuJcA3ri
|
||||
L/ZxvuOYoIC1Qybw/zQk+C5TVG2f+ezBCGoKWpzn21SlvsUmmKRW4S6MvocFlKSu
|
||||
Jg8r9DLc0k4hW2SlPi3qYicMo8J528ke9V4pNJ28W+vJQQv8GJTLbr5/KCH3QY/8
|
||||
Q8YbHpeK7foHpEppsnBUuCYeR1ZMvKH1FTd0m3RVoApMjzOvM3PocNjKkR43yrII
|
||||
8dm/1mi30ovKgSRdaKi5al/QbDcwj+7UwVB9aOVUz7YD9SApKfiU5UKd1jOrmrJY
|
||||
1501HQB3b8rQhXf5khRUNR3mmHHhbUXDWMX+zwIDAQABAoIBAEFYoxQ07s1yIT3R
|
||||
f8HKiz9De2FvjzG2qGUpdnnqm3C5NhwYbIk66ubYQrZqK1Cu2tUPLaxOd8G/lmf4
|
||||
S/wPdY+Md9Vnqrq7UwPBzvhJq/Pog2PoLO3YBidl/CizFUm5f7JtnDzHQAHSUhDO
|
||||
SAPSqvNB6bN6hFiAlGhqQ76bIYHIsfAmeUK6d0fmvBHWY57436VhiEMExtX29GTw
|
||||
dKgePgBE+1R0Lwykwx2/CANPs+zs67b/tqDTDjk7Kxecz7LrrGoRbmOFRx2p27FQ
|
||||
5lftdJqHAP5sBdVPlA+97z5cJBlU02yUb2mLfOIsCerpxl+FLdqQcQ1v16I6kXsP
|
||||
B+dn37ECgYEA+jLgs3x13pzIWMLBPKGYXLDjZ8nnKza/XSoiRizEmt7tbq6An4Cw
|
||||
ClYKuHd+/hygf04UsPn2sJ+zSvfmxYFnUr6YuzmVNN3S1igcBwz98kQkOSBsPqvT
|
||||
YB1KgDF079QS99ixfB4idOG5NdCuXGn7PZbYgt610K/dcRZ2PcCEyQcCgYEA33x8
|
||||
KZjL5RoFxdTBW9DuNRYcvDJFI+L8WsFE8nEtotpf3kSs3rMy+HxLVIcmFBnrc+N+
|
||||
pwt9La8ZHvLM7eshXSi2kAUbyPe7kPrOdcv7ye7L84sVBNCw7J/d3jn+Zpvepvhc
|
||||
E1B0LYhQJYzwv97pH/98epQI8QXWQsAeQN9TEfkCgYEAqrIba1j2cbI1XZlBjMQS
|
||||
1uo3u4+cD3eCh2U/jPDuEVsWUfTr++YoNGUPW1rrYSLWvQPgSf2/uDC8eeE3qHfo
|
||||
riMqwFFA4piUR1eGB6ltd+PVcsQUFY3U4DYbpeoYBaeCaWWFcVB94ZA+c+CzlIkZ
|
||||
x6Mqg9693GqfgY/5i5fU//ECfydIuoqVUUH0UQ91VofNMhIi0OpD6+NjAvjxAC2d
|
||||
t2fo+vEXIUwEM/F558Pz/b2K0NiOJLU4T8i3/rJx+5PWwQafIXgvbbLl2RKjA6ex
|
||||
M5FLaI5m5Er0ZCUz9MwbZZyjyX+QKJ88hS97xprTK36OsGvvfPIPE4NKg184ZhkB
|
||||
KJkCgYEAjk5kR/HyHLcLVrkrc0iQHCHYpuYRP4zCL1FdTmsXy0toAdvlA2D4nB/L
|
||||
2Sdh+0Tj9qRF2zdCA4LBlpEbEPY5oYzDuurJ1lw9LV2gek+yi0wTsbPR+3pMwQ/2
|
||||
M4JfUkjAldpKBIx/V68vA2mc226wlInpBkRMz6V63GIMjj8WDz8=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
Reference in New Issue
Block a user