【修复】条件节点前fromNodeId传值问题

【修复】部署参数默认错误问题
【测设】部分项目代码结构
【同步】前端项目代码
This commit is contained in:
chudong
2025-05-09 18:44:33 +08:00
parent 6e2fe8cf52
commit d147bc7a82
237 changed files with 8705 additions and 8741 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,117 +1,5 @@
# ALLinSSL
# Vue 3 + TypeScript + Vite
## 项目简介
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
ALLinSSL是一个SSL证书管理平台提供证书申请、管理、部署、监控等功能帮助用户轻松管理和部署SSL证书保障网站安全。
## 技术栈
- 框架Vue 3.5.x
- 开发语言TypeScript
- 构建工具Vite 6.x
- 状态管理Pinia 2.x
- 路由Vue Router 4.x
- UI组件库Naive UI 2.x
- CSS框架TailwindCSS 3.x
- 国际化Vue I18n 11.x
- HTTP客户端Axios
- 工具库VueUse、UUID、CryptoJS等
## 项目结构
```
src/
├── api/ # API接口定义
├── assets/ # 静态资源
├── components/ # 公共组件
├── config/ # 全局配置
├── locales/ # 国际化资源
├── router/ # 路由配置
├── styles/ # 全局样式
├── types/ # 类型定义
├── views/ # 页面组件
│ ├── autoDeploy/ # 自动部署
│ ├── authApiManage/ # API管理
│ ├── certApply/ # 证书申请
│ ├── certManage/ # 证书管理
│ ├── home/ # 首页
│ ├── layout/ # 布局组件
│ ├── login/ # 登录页面
│ ├── monitor/ # 监控页面
│ └── settings/ # 设置页面
├── App.tsx # 应用根组件
└── main.ts # 入口文件
```
## 功能模块
- **证书管理**集中管理所有SSL证书包括查看、更新、删除等操作
- **证书申请**:提供证书申请流程
- **自动部署**自动部署SSL证书到目标服务器
- **监控系统**:监控证书状态,到期提醒等
- **系统设置**:系统全局配置管理
## 安装与运行
### 环境要求
- Node.js 16.x 或更高版本
- pnpm 7.x 或更高版本(推荐使用)
### 安装依赖
```bash
pnpm install
```
### 开发模式
```bash
pnpm dev
```
### 构建生产版本
```bash
pnpm build
```
### 预览构建结果
```bash
pnpm preview
```
### 运行测试
```bash
pnpm test
```
### 代码检查
```bash
pnpm lint
```
## 开发指南
本项目采用模块化和组件化开发方式,开发新功能时请遵循以下原则:
1. 遵循项目已有的代码风格和组织方式
2. 新增API请在api目录下对应文件中添加
3. 公共组件放在components目录
4. 页面组件放在views目录下对应模块文件夹中
5. 路由配置自动导入
6. 使用CSS变量和TailwindCSS进行样式管理
## 浏览器兼容性
- Chrome >= 60
- Firefox >= 55
- Safari >= 11
- Edge >= 79
## 许可证
私有项目,未经授权不得使用
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -1,5 +1,4 @@
import { Transition, type Component as ComponentType, h } from 'vue'
import { RouterView } from 'vue-router'
import CustomProvider from '@baota/naive-ui/components/customProvider'

Binary file not shown.

View File

@@ -10,6 +10,7 @@ import DnsProviderSelect from '@/components/dnsProviderSelect'
import styles from './index.module.css'
import verifyRules from './verify'
import { isArray } from '@baota/utils/type'
type StepStatus = 'process' | 'wait' | 'finish' | 'error'
@@ -63,10 +64,7 @@ export default defineComponent({
// 表单参数
const param = ref(
Object.keys(props.node.config).length > 0
? {
...props.node.config,
inputs: Array.isArray(props.node.inputs) ? props.node.inputs[0] : { fromNodeId: '', name: '' },
}
? props.node.config
: {
provider: '',
provider_id: '',
@@ -151,18 +149,20 @@ export default defineComponent({
* @returns
*/
const nextStep = async () => {
if (!param.value.provider) return message.error($t('t_19_1745735766810'))
if (!props.node.config.provider) return message.error($t('t_19_1745735766810'))
// 加载证书来源选项
certOptions.value = findApplyUploadNodesUp(props.node.id).map((item) => {
return { label: item.name, value: item.id }
})
if (!certOptions.value.length) {
message.warning($t('t_3_1745748298161'))
} else if (!(param.value.inputs && param.value.inputs.fromNodeId)) {
param.value.inputs = {} as DeployNodeInputsConfig
param.value.inputs.name = certOptions.value[0]?.label || ''
param.value.inputs.fromNodeId = certOptions.value[0]?.value || ''
} else if (!props.node.config.inputs?.fromNodeId) {
param.value.inputs = {
name: certOptions.value[0]?.label || '',
fromNodeId: certOptions.value[0]?.value || '',
} as DeployNodeInputsConfig
}
current.value++
next.value = false
@@ -195,15 +195,7 @@ export default defineComponent({
await example.value?.validate()
const tempData = param.value
const inputs = tempData.inputs
console.log(inputs, 'inputs', props.node)
updateNode(
props.node.id,
{
inputs: [inputs],
config: {},
},
false,
)
updateNode(props.node.id, { inputs: [inputs], config: {} }, false)
delete tempData.inputs
updateNodeConfig(props.node.id, {
...tempData,
@@ -221,7 +213,7 @@ export default defineComponent({
modalOptions.value.footer = false
// 如果已经选择了部署类型,则跳转到下一步
if (param.value.provider) {
if (props.node.inputs) param.value.inputs = props.node.inputs
if (props.node.inputs) param.value.inputs = props.node.inputs[0]
nextStep()
}
})

View File

@@ -27,7 +27,7 @@
/* Add triangle in bottom-right corner for selected item */
.optionCardSelected::before {
content: '';
@apply absolute -bottom-[.1rem] -right-[.1rem] w-0 h-0 z-10 text-white text-xs flex items-center justify-center;
@apply absolute -bottom-[.1rem] -right-[.1rem] w-0 h-0 z-10 text-white text-[1.2rem] flex items-center justify-center;
border-style: solid;
border-width: 0 0 20px 20px;
border-color: transparent transparent var(--n-primary-color) transparent;

View File

@@ -304,7 +304,6 @@ export const useFlowStore = defineStore('flow-store', () => {
console.warn(`Node with id ${nodeId} not found`)
return
}
console.log(nodeId, node)
// 更新原始数据
updateNodeRecursive(flowData.value.childNode, nodeId, (node, parent) => {
@@ -312,20 +311,26 @@ export const useFlowStore = defineStore('flow-store', () => {
console.warn('Cannot remove root node')
return
}
const { type, conditionNodes } = parent as BranchNodeData | ExecuteResultBranchNodeData
// 处理条件节点(分支节点、执行结果分支节点)
// console.log(type, conditionNodes, node)
// 如果当前子节点存在条件节点,需要判断删除后是否支持条件节点,则需要更新 fromNodeId
if (node.childNode?.type === EXECUTE_RESULT_BRANCH && node.childNode?.config) {
node.childNode.config.fromNodeId = parent.id
}
// console.log(node.childNode, parent)
// 条件一:当前节点为普通节点
const nodeTypeList = [CONDITION, EXECUTE_RESULT_CONDITION, BRANCH, EXECUTE_RESULT_BRANCH]
if (!nodeTypeList.includes(node.type) && parent.childNode?.id === nodeId) {
console.log(deep)
// 处理普通节点
if (deep) {
// 深度删除,直接移除
parent.childNode = undefined
} else {
console.log(parent.childNode, node.childNode)
// 非深度删除,子节点上移
if (node.childNode) {
parent.childNode = node.childNode

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "المهام الآلية",
"t_0_1744098811152": "تحذير: لقد دخلتم منطقة غير معروفة، الصفحة التي تحاول زيارتها غير موجودة، يرجى الضغط على الزر للعودة إلى الصفحة الرئيسية.",
"t_1_1744098801860": "رجوع إلى الصفحة الرئيسية",
"t_2_1744098804908": "نصيحة أمنية: إذا كنت تعتقد أن هذا خطأ، يرجى الاتصال بالمدير على الفور",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Automated tasks",
"t_0_1744098811152": "Warning: You have entered an unknown area, the page you are visiting does not exist, please click the button to return to the homepage.",
"t_1_1744098801860": "Return Home",
"t_2_1744098804908": "Safety Tip: If you think this is an error, please contact the administrator immediately",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Tareas automatizadas",
"t_0_1744098811152": "Advertencia: Ha ingresado a una zona desconocida, la página que intenta visitar no existe, por favor, haga clic en el botón para regresar a la página de inicio.",
"t_1_1744098801860": "Volver al inicio",
"t_2_1744098804908": "Consejo de seguridad: Si piensa que es un error, póngase en contacto con el administrador inmediatamente",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Tâches automatisées",
"t_0_1744098811152": "Avertissement : Vous avez entré dans une zone inconnue, la page que vous visitez n'existe pas, veuillez cliquer sur le bouton pour revenir à la page d'accueil.",
"t_1_1744098801860": "Retour à l'accueil",
"t_2_1744098804908": "Avis de sécurité : Si vous pensez que c'est une erreur, veuillez contacter l'administrateur immédiatement",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "自動化タスク",
"t_0_1744098811152": "警告:未知のエリアに進入しました。アクセスしようとしたページは存在しません。ボタンをクリックしてホームページに戻ってください。",
"t_1_1744098801860": "ホームに戻る",
"t_2_1744098804908": "安全注意:これが誤りだと思われる場合は、すぐに管理者に連絡してください",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "자동화 작업",
"t_0_1744098811152": "경고: 알 수 없는 영역에 진입했습니다. 방문하려는 페이지가 존재하지 않습니다. 버튼을 클릭하여 홈페이지로 돌아가세요。",
"t_1_1744098801860": "홈으로 돌아가기",
"t_2_1744098804908": "안전 유의사항: 이가 오류라면 즉시 관리자에게 연락하십시오",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Tarefas automatizadas",
"t_0_1744098811152": "Aviso: Você entrou em uma área desconhecida, a página que você está visitando não existe, por favor, clique no botão para voltar para a página inicial.",
"t_1_1744098801860": "Voltar para a homepage",
"t_2_1744098804908": "Dica de Segurança: Se você acha que isso é um erro, entre em contato com o administrador imediatamente",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "Автоматизированные задачи",
"t_0_1744098811152": "Предупреждение: Вы вошли в неизвестную зону, посещаемая страница не существует, пожалуйста, нажмите кнопку, чтобы вернуться на главную страницу.",
"t_1_1744098801860": "Вернуться на главную",
"t_2_1744098804908": "Совет по безопасности: Если вы считаете, что это ошибка, немедленно свяжитесь с администратором",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "自动化任务",
"t_0_1744098811152": "警告:您已进入未知区域,所访问的页面不存在,请点击按钮返回首页。",
"t_1_1744098801860": "返回首页",
"t_2_1744098804908": "安全提示:如果您认为这是个错误,请立即联系管理员",

View File

@@ -1,4 +1,5 @@
{
"t_0_1746782379424": "自動化任務",
"t_0_1744098811152": "警告:您已進入未知區域,所訪問的頁面不存在,請點擊按鈕返回首頁。",
"t_1_1744098801860": "返回首頁",
"t_2_1744098804908": "安全提示:如果您認為這是個錯誤,請立即聯繫管理員",

View File

@@ -37,7 +37,7 @@ export default defineComponent({
<div class="flex items-center space-x-1">
<span class="w-4 h-4 rounded-full mr-[.6rem] bg-green-500"></span>
<span class={styles.tableText}>
{$t('t_0_1745457486299')}: {overviewData.value.workflow.active}
{$t('t_0_1746782379424')}: {overviewData.value.workflow.active}
</span>
</div>
<div class="flex items-center space-x-1 mt-3">