diff --git a/frontend/package-lock.json b/frontend/package-lock.json index fe052de2..6bcd8dae 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -26,11 +26,13 @@ "@logicflow/extension": "^2.0.13", "@monaco-editor/react": "^4.6.0", "@radix-ui/react-avatar": "^1.1.2", + "@radix-ui/react-dialog": "^1.1.4", "@radix-ui/react-label": "^2.1.1", "@radix-ui/react-progress": "^1.1.1", "@radix-ui/react-select": "^2.1.4", "@radix-ui/react-separator": "^1.1.1", "@radix-ui/react-slot": "^1.1.1", + "@radix-ui/react-switch": "^1.1.2", "@radix-ui/react-tabs": "^1.1.2", "@reduxjs/toolkit": "^2.0.1", "@types/recharts": "^1.8.29", @@ -2058,6 +2060,41 @@ } } }, + "node_modules/@radix-ui/react-dialog": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-dialog/-/react-dialog-1.1.4.tgz", + "integrity": "sha512-Ur7EV1IwQGCyaAuyDRiOLA5JIUZxELJljF+MbM/2NC0BYwfuRrbpS30BiQBJrVruscgUkieKkqXYDOoByaxIoA==", + "dependencies": { + "@radix-ui/primitive": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-dismissable-layer": "1.1.3", + "@radix-ui/react-focus-guards": "1.1.1", + "@radix-ui/react-focus-scope": "1.1.1", + "@radix-ui/react-id": "1.1.0", + "@radix-ui/react-portal": "1.1.3", + "@radix-ui/react-presence": "1.1.2", + "@radix-ui/react-primitive": "2.0.1", + "@radix-ui/react-slot": "1.1.1", + "@radix-ui/react-use-controllable-state": "1.1.0", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "^2.6.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-direction": { "version": "1.1.0", "resolved": "https://registry.npmmirror.com/@radix-ui/react-direction/-/react-direction-1.1.0.tgz", @@ -2423,6 +2460,34 @@ } } }, + "node_modules/@radix-ui/react-switch": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-switch/-/react-switch-1.1.2.tgz", + "integrity": "sha512-zGukiWHjEdBCRyXvKR6iXAQG6qXm2esuAD6kDOi9Cn+1X6ev3ASo4+CsYaD6Fov9r/AQFekqnD/7+V0Cs6/98g==", + "dependencies": { + "@radix-ui/primitive": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-primitive": "2.0.1", + "@radix-ui/react-use-controllable-state": "1.1.0", + "@radix-ui/react-use-previous": "1.1.0", + "@radix-ui/react-use-size": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-tabs": { "version": "1.1.2", "resolved": "https://registry.npmmirror.com/@radix-ui/react-tabs/-/react-tabs-1.1.2.tgz", diff --git a/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx b/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx index a17fc6cd..d7ab2b76 100644 --- a/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx +++ b/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import { Dialog, DialogContent, @@ -9,39 +9,49 @@ import { import { Button } from "@/components/ui/button"; import { BetaSchemaForm } from '@ant-design/pro-form'; import { convertJsonSchemaToColumns } from '@/utils/jsonSchemaUtils'; +import { message } from 'antd'; +import type { DeploymentConfig } from '@/pages/Deploy/Deployment/List/types'; interface DeploymentFormModalProps { open: boolean; onClose: () => void; formSchema: any; + deployConfig: DeploymentConfig; } const DeploymentFormModal: React.FC = ({ open, onClose, - formSchema + formSchema, + deployConfig }) => { const handleSubmit = async (values: any) => { - console.log('Form values:', values); - // TODO: 处理表单提交 - onClose(); + try { + console.log('Form values:', values); + // TODO: 调用部署接口 + message.success('部署任务已提交'); + onClose(); + } catch (error) { + message.error('部署失败:' + (error instanceof Error ? error.message : '未知错误')); + } }; const columns = convertJsonSchemaToColumns(formSchema); - console.log('Form schema:', formSchema); - console.log('Generated columns:', columns); return ( - 部署前表单 + 部署 {deployConfig.application.appName}
diff --git a/frontend/src/pages/Dashboard/index.tsx b/frontend/src/pages/Dashboard/index.tsx index 2b83d50a..75c297d1 100644 --- a/frontend/src/pages/Dashboard/index.tsx +++ b/frontend/src/pages/Dashboard/index.tsx @@ -236,9 +236,10 @@ const Dashboard: React.FC = () => { }; const handleDeploy = (config: DeploymentConfig) => { - console.log('Deploy config:', config); - console.log('Workflow definition:', config.publishedWorkflowDefinition); - console.log('Form variables:', config.publishedWorkflowDefinition?.formVariables); + if (!config.publishedWorkflowDefinition?.formVariablesSchema) { + message.error('工作流配置有误,请检查工作流定义'); + return; + } setSelectedConfig(config); setDeployModalOpen(true); }; @@ -433,19 +434,15 @@ const Dashboard: React.FC = () => { )} {selectedConfig && selectedConfig.publishedWorkflowDefinition && ( - <> - {console.log('Selected config:', selectedConfig)} - {console.log('Workflow definition:', selectedConfig.publishedWorkflowDefinition)} - {console.log('Form variables:', selectedConfig.publishedWorkflowDefinition.formVariables)} - { - setDeployModalOpen(false); - setSelectedConfig(null); - }} - formSchema={selectedConfig.publishedWorkflowDefinition.formVariables} - /> - + { + setDeployModalOpen(false); + setSelectedConfig(null); + }} + formSchema={selectedConfig.publishedWorkflowDefinition.formVariablesSchema} + deployConfig={selectedConfig} + /> )} ); diff --git a/frontend/src/pages/Login/index.tsx b/frontend/src/pages/Login/index.tsx index 318bfbb3..01aef80c 100644 --- a/frontend/src/pages/Login/index.tsx +++ b/frontend/src/pages/Login/index.tsx @@ -78,7 +78,7 @@ const Login: React.FC = () => { {/* 左侧区域 */}
-

Deploy Ease Platform

+

链宇DevOps门户管理系统

@@ -91,7 +91,7 @@ const Login: React.FC = () => {
-

管理系统

+

Deploy Ease Platform

输入您的账号密码登录系统

@@ -152,17 +152,6 @@ const Login: React.FC = () => { - -
- 登录即表示您同意我们的 - - 服务条款 - - 和 - - 隐私政策 - -
diff --git a/frontend/src/pages/Workflow/Definition/types.ts b/frontend/src/pages/Workflow/Definition/types.ts index 268b873c..51fca817 100644 --- a/frontend/src/pages/Workflow/Definition/types.ts +++ b/frontend/src/pages/Workflow/Definition/types.ts @@ -16,6 +16,26 @@ export interface WorkflowDefinition extends BaseResponse { formConfig: { formItems: any[]; }; + formVariablesSchema?: { + type: string; + required?: string[]; + properties: { + [key: string]: { + type: string; + title: string; + description?: string; + dataSource?: { + url: string; + type: string; + params?: Record; + dependsOn?: string[]; + labelField?: string; + valueField?: string; + }; + }; + }; + }; + bpmnXml?: string; } export interface WorkflowDefinitionNode {