mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-07 21:19:51 +00:00
style(ui): eslint-sort-imports
This commit is contained in:
parent
1588179bc9
commit
b6dd2248c8
@ -86,6 +86,12 @@ module.exports = {
|
|||||||
allowConstantExport: true,
|
allowConstantExport: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
"sort-imports": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
ignoreDeclarationSort: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
"import/resolver": {
|
"import/resolver": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useLayoutEffect, useMemo, useState } from "react";
|
import { useEffect, useLayoutEffect, useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { RouterProvider } from "react-router-dom";
|
import { RouterProvider } from "react-router-dom";
|
||||||
import { App, ConfigProvider, theme, type ThemeConfig } from "antd";
|
import { App, ConfigProvider, type ThemeConfig, theme } from "antd";
|
||||||
import { type Locale } from "antd/es/locale";
|
import { type Locale } from "antd/es/locale";
|
||||||
import AntdLocaleEnUs from "antd/locale/en_US";
|
import AntdLocaleEnUs from "antd/locale/en_US";
|
||||||
import AntdLocaleZhCN from "antd/locale/zh_CN";
|
import AntdLocaleZhCN from "antd/locale/zh_CN";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from "react";
|
import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useCreation } from "ahooks";
|
import { useCreation } from "ahooks";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, Select, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input, Select } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { flushSync } from "react-dom";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { UploadOutlined as UploadOutlinedIcon } from "@ant-design/icons";
|
import { UploadOutlined as UploadOutlinedIcon } from "@ant-design/icons";
|
||||||
import { useDeepCompareEffect } from "ahooks";
|
import { useDeepCompareEffect } from "ahooks";
|
||||||
import { Button, Form, Input, Upload, type FormInstance, type UploadFile, type UploadProps } from "antd";
|
import { Button, Form, type FormInstance, Input, Upload, type UploadFile, type UploadProps } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { flushSync } from "react-dom";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { UploadOutlined as UploadOutlinedIcon } from "@ant-design/icons";
|
import { UploadOutlined as UploadOutlinedIcon } from "@ant-design/icons";
|
||||||
import { useDeepCompareEffect } from "ahooks";
|
import { useDeepCompareEffect } from "ahooks";
|
||||||
import { Button, Form, Input, InputNumber, Upload, type FormInstance, type UploadFile, type UploadProps } from "antd";
|
import { Button, Form, type FormInstance, Input, InputNumber, Upload, type UploadFile, type UploadProps } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Form, Input, type FormInstance } from "antd";
|
import { Form, type FormInstance, Input } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { memo } from "react";
|
import { memo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Avatar, Select, Space, Tag, Typography, type SelectProps } from "antd";
|
import { Avatar, Select, type SelectProps, Space, Tag, Typography } from "antd";
|
||||||
|
|
||||||
import { ACCESS_USAGES, accessProvidersMap } from "@/domain/provider";
|
import { ACCESS_USAGES, accessProvidersMap } from "@/domain/provider";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Avatar, Select, Space, Typography, type SelectProps } from "antd";
|
import { Avatar, Select, type SelectProps, Space, Typography } from "antd";
|
||||||
|
|
||||||
import { type AccessModel } from "@/domain/access";
|
import { type AccessModel } from "@/domain/access";
|
||||||
import { accessProvidersMap } from "@/domain/provider";
|
import { accessProvidersMap } from "@/domain/provider";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { CopyToClipboard } from "react-copy-to-clipboard";
|
import { CopyToClipboard } from "react-copy-to-clipboard";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { CopyOutlined as CopyOutlinedIcon, DownOutlined as DownOutlinedIcon, LikeOutlined as LikeOutlinedIcon } from "@ant-design/icons";
|
import { CopyOutlined as CopyOutlinedIcon, DownOutlined as DownOutlinedIcon, LikeOutlined as LikeOutlinedIcon } from "@ant-design/icons";
|
||||||
import { Button, Dropdown, Form, Input, message, Space, Tooltip } from "antd";
|
import { Button, Dropdown, Form, Input, Space, Tooltip, message } from "antd";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
import { type CertificateModel } from "@/domain/certificate";
|
import { type CertificateModel } from "@/domain/certificate";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useControllableValue } from "ahooks";
|
import { useControllableValue } from "ahooks";
|
||||||
import { Button, Drawer, Form, Space, type DrawerProps, type FormProps, type ModalProps } from "antd";
|
import { Button, Drawer, type DrawerProps, Form, type FormProps, type ModalProps, Space } from "antd";
|
||||||
|
|
||||||
import { useAntdForm, useTriggerElement } from "@/hooks";
|
import { useAntdForm, useTriggerElement } from "@/hooks";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useControllableValue } from "ahooks";
|
import { useControllableValue } from "ahooks";
|
||||||
import { Form, Modal, type FormProps, type ModalProps } from "antd";
|
import { Form, type FormProps, Modal, type ModalProps } from "antd";
|
||||||
|
|
||||||
import { useAntdForm, useTriggerElement } from "@/hooks";
|
import { useAntdForm, useTriggerElement } from "@/hooks";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { forwardRef, useImperativeHandle, useMemo, useRef, type ChangeEvent } from "react";
|
import { type ChangeEvent, forwardRef, useImperativeHandle, useMemo, useRef } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import {
|
import {
|
||||||
ArrowDownOutlined as ArrowDownOutlinedIcon,
|
ArrowDownOutlined as ArrowDownOutlinedIcon,
|
||||||
@ -7,7 +7,7 @@ import {
|
|||||||
PlusOutlined as PlusOutlinedIcon,
|
PlusOutlined as PlusOutlinedIcon,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useControllableValue } from "ahooks";
|
import { useControllableValue } from "ahooks";
|
||||||
import { Button, Input, Space, type InputRef, type InputProps } from "antd";
|
import { Button, Input, type InputProps, type InputRef, Space } from "antd";
|
||||||
import { produce } from "immer";
|
import { produce } from "immer";
|
||||||
|
|
||||||
export type MultipleInputProps = Omit<InputProps, "count" | "defaultValue" | "showCount" | "value" | "onChange" | "onPressEnter" | "onClear"> & {
|
export type MultipleInputProps = Omit<InputProps, "count" | "defaultValue" | "showCount" | "value" | "onChange" | "onPressEnter" | "onClear"> & {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useDeepCompareMemo } from "@ant-design/pro-components";
|
import { useDeepCompareMemo } from "@ant-design/pro-components";
|
||||||
import { Button, Collapse, message, notification, Skeleton, Space, Switch, type CollapseProps } from "antd";
|
import { Button, Collapse, type CollapseProps, Skeleton, Space, Switch, message, notification } from "antd";
|
||||||
|
|
||||||
import Show from "@/components/Show";
|
import Show from "@/components/Show";
|
||||||
import { notifyChannelsMap } from "@/domain/settings";
|
import { notifyChannelsMap } from "@/domain/settings";
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useRequest } from "ahooks";
|
import { useRequest } from "ahooks";
|
||||||
import { Button, Form, Input, message, notification, Skeleton } from "antd";
|
import { Button, Form, Input, Skeleton, message, notification } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { ClientResponseError } from "pocketbase";
|
import { ClientResponseError } from "pocketbase";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import Show from "@/components/Show";
|
import Show from "@/components/Show";
|
||||||
import { defaultNotifyTemplate, SETTINGS_NAMES, type NotifyTemplatesSettingsContent } from "@/domain/settings";
|
import { type NotifyTemplatesSettingsContent, SETTINGS_NAMES, defaultNotifyTemplate } from "@/domain/settings";
|
||||||
import { useAntdForm } from "@/hooks";
|
import { useAntdForm } from "@/hooks";
|
||||||
import { get as getSettings, save as saveSettings } from "@/repository/settings";
|
import { get as getSettings, save as saveSettings } from "@/repository/settings";
|
||||||
import { getErrMsg } from "@/utils/error";
|
import { getErrMsg } from "@/utils/error";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useRequest } from "ahooks";
|
import { useRequest } from "ahooks";
|
||||||
import { Button, message, notification, type ButtonProps } from "antd";
|
import { Button, type ButtonProps, message, notification } from "antd";
|
||||||
|
|
||||||
import { notifyTest } from "@/api/notify";
|
import { notifyTest } from "@/api/notify";
|
||||||
import { getErrMsg } from "@/utils/error";
|
import { getErrMsg } from "@/utils/error";
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
import { CloudUpload, GitFork, Megaphone, NotebookPen } from "lucide-react";
|
|
||||||
|
|
||||||
import { WorkflowNodeType } from "@/domain/workflow";
|
|
||||||
|
|
||||||
type NodeTypesPanelProps = {
|
|
||||||
onTypeSelected: (type: WorkflowNodeType) => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
const NodeTypesPanel = ({ onTypeSelected }: NodeTypesPanelProps) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div className="flex space-x-2">
|
|
||||||
<div
|
|
||||||
className="flex w-1/2 items-center space-x-2 hover:bg-stone-100 p-2 rounded-md"
|
|
||||||
onClick={() => {
|
|
||||||
onTypeSelected(WorkflowNodeType.Apply);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="bg-primary h-12 w-12 flex items-center justify-center rounded-full">
|
|
||||||
<NotebookPen className="text-white" size={18} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-slate-600">申请</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="flex w-1/2 items-center space-x-2 hover:bg-stone-100 p-2 rounded-md"
|
|
||||||
onClick={() => {
|
|
||||||
onTypeSelected(WorkflowNodeType.Deploy);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="bg-primary h-12 w-12 flex items-center justify-center rounded-full">
|
|
||||||
<CloudUpload className="text-white" size={18} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-slate-600">部署</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex space-x-2">
|
|
||||||
<div
|
|
||||||
className="flex w-1/2 items-center space-x-2 hover:bg-stone-100 p-2 rounded-md"
|
|
||||||
onClick={() => {
|
|
||||||
onTypeSelected(WorkflowNodeType.Branch);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="bg-primary h-12 w-12 flex items-center justify-center rounded-full">
|
|
||||||
<GitFork className="text-white" size={18} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-slate-600">分支</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="flex w-1/2 items-center space-x-2 hover:bg-stone-100 p-2 rounded-md"
|
|
||||||
onClick={() => {
|
|
||||||
onTypeSelected(WorkflowNodeType.Notify);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="bg-primary h-12 w-12 flex items-center justify-center rounded-full">
|
|
||||||
<Megaphone className="text-white" size={18} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-slate-600">推送</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default NodeTypesPanel;
|
|
@ -2,7 +2,7 @@ import { memo, useCallback, useEffect, useState } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { FormOutlined as FormOutlinedIcon, PlusOutlined as PlusOutlinedIcon, QuestionCircleOutlined as QuestionCircleOutlinedIcon } from "@ant-design/icons";
|
import { FormOutlined as FormOutlinedIcon, PlusOutlined as PlusOutlinedIcon, QuestionCircleOutlined as QuestionCircleOutlinedIcon } from "@ant-design/icons";
|
||||||
import { useControllableValue } from "ahooks";
|
import { useControllableValue } from "ahooks";
|
||||||
import { AutoComplete, Button, Divider, Form, Input, Select, Space, Switch, Tooltip, Typography, type AutoCompleteProps } from "antd";
|
import { AutoComplete, type AutoCompleteProps, Button, Divider, Form, Input, Select, Space, Switch, Tooltip, Typography } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { produce } from "immer";
|
import { produce } from "immer";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
@ -12,7 +12,7 @@ import AccessSelect from "@/components/access/AccessSelect";
|
|||||||
import ModalForm from "@/components/core/ModalForm";
|
import ModalForm from "@/components/core/ModalForm";
|
||||||
import MultipleInput from "@/components/core/MultipleInput";
|
import MultipleInput from "@/components/core/MultipleInput";
|
||||||
import { ACCESS_USAGES, accessProvidersMap } from "@/domain/provider";
|
import { ACCESS_USAGES, accessProvidersMap } from "@/domain/provider";
|
||||||
import { type WorkflowNode, type WorkflowNodeConfig } from "@/domain/workflow";
|
import { type WorkflowNode } from "@/domain/workflow";
|
||||||
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
||||||
import { useContactEmailsStore } from "@/stores/contact";
|
import { useContactEmailsStore } from "@/stores/contact";
|
||||||
import { useWorkflowStore } from "@/stores/workflow";
|
import { useWorkflowStore } from "@/stores/workflow";
|
||||||
@ -25,7 +25,7 @@ export type ApplyNodeFormProps = {
|
|||||||
|
|
||||||
const MULTIPLE_INPUT_DELIMITER = ";";
|
const MULTIPLE_INPUT_DELIMITER = ";";
|
||||||
|
|
||||||
const initFormModel = (): WorkflowNodeConfig => {
|
const initFormModel = () => {
|
||||||
return {
|
return {
|
||||||
domain: "",
|
domain: "",
|
||||||
keyAlgorithm: "RSA2048",
|
keyAlgorithm: "RSA2048",
|
||||||
|
@ -8,8 +8,8 @@ import { z } from "zod";
|
|||||||
|
|
||||||
import AccessEditModal from "@/components/access/AccessEditModal";
|
import AccessEditModal from "@/components/access/AccessEditModal";
|
||||||
import AccessSelect from "@/components/access/AccessSelect";
|
import AccessSelect from "@/components/access/AccessSelect";
|
||||||
import { ACCESS_USAGES, accessProvidersMap, DEPLOY_PROVIDERS, deployProvidersMap } from "@/domain/provider";
|
import { ACCESS_USAGES, DEPLOY_PROVIDERS, accessProvidersMap, deployProvidersMap } from "@/domain/provider";
|
||||||
import { type WorkflowNode, type WorkflowNodeConfig } from "@/domain/workflow";
|
import { type WorkflowNode } from "@/domain/workflow";
|
||||||
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
||||||
import { useWorkflowStore } from "@/stores/workflow";
|
import { useWorkflowStore } from "@/stores/workflow";
|
||||||
import { usePanel } from "../PanelProvider";
|
import { usePanel } from "../PanelProvider";
|
||||||
@ -42,7 +42,7 @@ export type DeployFormProps = {
|
|||||||
defaultProivderType?: string;
|
defaultProivderType?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const initFormModel = (): WorkflowNodeConfig => {
|
const initFormModel = () => {
|
||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import { produce } from "immer";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { notifyChannelsMap } from "@/domain/settings";
|
import { notifyChannelsMap } from "@/domain/settings";
|
||||||
import { type WorkflowNode, type WorkflowNodeConfig } from "@/domain/workflow";
|
import { type WorkflowNode } from "@/domain/workflow";
|
||||||
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
||||||
import { useNotifyChannelsStore } from "@/stores/notify";
|
import { useNotifyChannelsStore } from "@/stores/notify";
|
||||||
import { useWorkflowStore } from "@/stores/workflow";
|
import { useWorkflowStore } from "@/stores/workflow";
|
||||||
@ -18,7 +18,7 @@ export type NotifyNodeFormProps = {
|
|||||||
data: WorkflowNode;
|
data: WorkflowNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
const initFormModel = (): WorkflowNodeConfig => {
|
const initFormModel = () => {
|
||||||
return {
|
return {
|
||||||
subject: "Completed!",
|
subject: "Completed!",
|
||||||
message: "Your workflow has been completed on Certimate.",
|
message: "Your workflow has been completed on Certimate.",
|
||||||
|
@ -7,17 +7,17 @@ import { produce } from "immer";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import Show from "@/components/Show";
|
import Show from "@/components/Show";
|
||||||
import { type WorkflowNode, type WorkflowNodeConfig } from "@/domain/workflow";
|
import { type WorkflowNode } from "@/domain/workflow";
|
||||||
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
||||||
import { useWorkflowStore } from "@/stores/workflow";
|
import { useWorkflowStore } from "@/stores/workflow";
|
||||||
import { validCronExpression, getNextCronExecutions } from "@/utils/cron";
|
import { getNextCronExecutions, validCronExpression } from "@/utils/cron";
|
||||||
import { usePanel } from "../PanelProvider";
|
import { usePanel } from "../PanelProvider";
|
||||||
|
|
||||||
export type StartNodeFormProps = {
|
export type StartNodeFormProps = {
|
||||||
data: WorkflowNode;
|
data: WorkflowNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
const initFormModel = (): WorkflowNodeConfig => {
|
const initFormModel = () => {
|
||||||
return {
|
return {
|
||||||
executionMethod: "auto",
|
executionMethod: "auto",
|
||||||
crontab: "0 0 * * *",
|
crontab: "0 0 * * *",
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
SelectOutlined as SelectOutlinedIcon,
|
SelectOutlined as SelectOutlinedIcon,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useRequest } from "ahooks";
|
import { useRequest } from "ahooks";
|
||||||
import { Button, Empty, notification, Space, Table, theme, Typography, type TableProps } from "antd";
|
import { Button, Empty, Space, Table, type TableProps, Typography, notification, theme } from "antd";
|
||||||
import { ClientResponseError } from "pocketbase";
|
import { ClientResponseError } from "pocketbase";
|
||||||
|
|
||||||
import { type WorkflowRunModel } from "@/domain/workflowRun";
|
import { type WorkflowRunModel } from "@/domain/workflowRun";
|
||||||
|
6
ui/src/global.d.ts
vendored
6
ui/src/global.d.ts
vendored
@ -2,12 +2,16 @@
|
|||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
declare interface BaseModel extends PbBaseModel {
|
declare interface BaseModel extends PbBaseModel {
|
||||||
deleted?: string;
|
created: ISO8601String;
|
||||||
|
updated: ISO8601String;
|
||||||
|
deleted?: ISO8601String;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare type MaybeModelRecord<T extends BaseModel = BaseModel> = T | Omit<T, "id" | "created" | "updated" | "deleted">;
|
declare type MaybeModelRecord<T extends BaseModel = BaseModel> = T | Omit<T, "id" | "created" | "updated" | "deleted">;
|
||||||
|
|
||||||
declare type MaybeModelRecordWithId<T extends BaseModel = BaseModel> = T | Pick<T, "id">;
|
declare type MaybeModelRecordWithId<T extends BaseModel = BaseModel> = T | Pick<T, "id">;
|
||||||
|
|
||||||
|
declare type ISO8601String = string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { cloneElement, createElement, Fragment, isValidElement, useMemo } from "react";
|
import { Fragment, cloneElement, createElement, isValidElement, useMemo } from "react";
|
||||||
|
|
||||||
export type UseTriggerElementOptions = {
|
export type UseTriggerElementOptions = {
|
||||||
onClick?: (e: MouseEvent) => void;
|
onClick?: (e: MouseEvent) => void;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useRef } from "react";
|
import { useRef } from "react";
|
||||||
import { pick, isArray } from "radash";
|
import { isArray, pick } from "radash";
|
||||||
import { shallow } from "zustand/shallow";
|
import { shallow } from "zustand/shallow";
|
||||||
|
|
||||||
type MaybeMany<T> = T | readonly T[];
|
type MaybeMany<T> = T | readonly T[];
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
SettingOutlined as SettingOutlinedIcon,
|
SettingOutlined as SettingOutlinedIcon,
|
||||||
SunOutlined as SunOutlinedIcon,
|
SunOutlined as SunOutlinedIcon,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { Button, Drawer, Dropdown, Layout, Menu, Tooltip, theme, type ButtonProps, type MenuProps } from "antd";
|
import { Button, type ButtonProps, Drawer, Dropdown, Layout, Menu, type MenuProps, Tooltip, theme } from "antd";
|
||||||
|
|
||||||
import Version from "@/components/core/Version";
|
import Version from "@/components/core/Version";
|
||||||
import { useBrowserTheme } from "@/hooks";
|
import { useBrowserTheme } from "@/hooks";
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { PageHeader } from "@ant-design/pro-components";
|
import { PageHeader } from "@ant-design/pro-components";
|
||||||
import { useRequest } from "ahooks";
|
import { useRequest } from "ahooks";
|
||||||
import { Avatar, Button, Empty, Modal, notification, Space, Table, Tooltip, Typography, type TableProps } from "antd";
|
import { Avatar, Button, Empty, Modal, Space, Table, type TableProps, Tooltip, Typography, notification } from "antd";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { ClientResponseError } from "pocketbase";
|
import { ClientResponseError } from "pocketbase";
|
||||||
|
|
||||||
|
@ -4,13 +4,13 @@ import { useNavigate, useSearchParams } from "react-router-dom";
|
|||||||
import { DeleteOutlined as DeleteOutlinedIcon, SelectOutlined as SelectOutlinedIcon } from "@ant-design/icons";
|
import { DeleteOutlined as DeleteOutlinedIcon, SelectOutlined as SelectOutlinedIcon } from "@ant-design/icons";
|
||||||
import { PageHeader } from "@ant-design/pro-components";
|
import { PageHeader } from "@ant-design/pro-components";
|
||||||
import { useRequest } from "ahooks";
|
import { useRequest } from "ahooks";
|
||||||
import { Button, Divider, Empty, Menu, notification, Radio, Space, Table, theme, Tooltip, Typography, type MenuProps, type TableProps } from "antd";
|
import { Button, Divider, Empty, Menu, type MenuProps, Radio, Space, Table, type TableProps, Tooltip, Typography, notification, theme } from "antd";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { ClientResponseError } from "pocketbase";
|
import { ClientResponseError } from "pocketbase";
|
||||||
|
|
||||||
import CertificateDetailDrawer from "@/components/certificate/CertificateDetailDrawer";
|
import CertificateDetailDrawer from "@/components/certificate/CertificateDetailDrawer";
|
||||||
import { type CertificateModel } from "@/domain/certificate";
|
import { type CertificateModel } from "@/domain/certificate";
|
||||||
import { list as listCertificate, type ListCertificateRequest } from "@/repository/certificate";
|
import { type ListCertificateRequest, list as listCertificate } from "@/repository/certificate";
|
||||||
import { getErrMsg } from "@/utils/error";
|
import { getErrMsg } from "@/utils/error";
|
||||||
|
|
||||||
const CertificateList = () => {
|
const CertificateList = () => {
|
||||||
|
@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { PageHeader } from "@ant-design/pro-components";
|
import { PageHeader } from "@ant-design/pro-components";
|
||||||
import { useRequest } from "ahooks";
|
import { useRequest } from "ahooks";
|
||||||
import { Card, Col, Divider, notification, Row, Space, Statistic, theme, Typography } from "antd";
|
import { Card, Col, Divider, Row, Space, Statistic, Typography, notification, theme } from "antd";
|
||||||
import {
|
import {
|
||||||
CalendarClock as CalendarClockIcon,
|
CalendarClock as CalendarClockIcon,
|
||||||
CalendarX2 as CalendarX2Icon,
|
CalendarX2 as CalendarX2Icon,
|
||||||
|
@ -2,13 +2,13 @@ import { createContext, useContext, useEffect, useMemo, useState } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { CheckCard } from "@ant-design/pro-components";
|
import { CheckCard } from "@ant-design/pro-components";
|
||||||
import { useDeepCompareEffect } from "ahooks";
|
import { useDeepCompareEffect } from "ahooks";
|
||||||
import { Button, Form, Input, message, notification, Skeleton } from "antd";
|
import { Button, Form, Input, Skeleton, message, notification } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { produce } from "immer";
|
import { produce } from "immer";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import Show from "@/components/Show";
|
import Show from "@/components/Show";
|
||||||
import { SETTINGS_NAMES, SSLPROVIDERS, type SettingsModel, type SSLProviderSettingsContent, type SSLProviders } from "@/domain/settings";
|
import { SETTINGS_NAMES, SSLPROVIDERS, type SSLProviderSettingsContent, type SSLProviders, type SettingsModel } from "@/domain/settings";
|
||||||
import { useAntdForm } from "@/hooks";
|
import { useAntdForm } from "@/hooks";
|
||||||
import { get as getSettings, save as saveSettings } from "@/repository/settings";
|
import { get as getSettings, save as saveSettings } from "@/repository/settings";
|
||||||
import { getErrMsg } from "@/utils/error";
|
import { getErrMsg } from "@/utils/error";
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { PageHeader } from "@ant-design/pro-components";
|
import { PageHeader } from "@ant-design/pro-components";
|
||||||
import { useDeepCompareEffect } from "ahooks";
|
import { useDeepCompareEffect } from "ahooks";
|
||||||
import { Button, Card, Dropdown, Form, Input, message, Modal, notification, Space, Tabs, Typography } from "antd";
|
import { Button, Card, Dropdown, Form, Input, Modal, Space, Tabs, Typography, message, notification } from "antd";
|
||||||
import { createSchemaFieldRule } from "antd-zod";
|
import { createSchemaFieldRule } from "antd-zod";
|
||||||
import { ClientResponseError } from "pocketbase";
|
import { ClientResponseError } from "pocketbase";
|
||||||
import { isEqual } from "radash";
|
import { isEqual } from "radash";
|
||||||
@ -24,7 +24,7 @@ import End from "@/components/workflow/End";
|
|||||||
import NodeRender from "@/components/workflow/NodeRender";
|
import NodeRender from "@/components/workflow/NodeRender";
|
||||||
import WorkflowProvider from "@/components/workflow/WorkflowProvider";
|
import WorkflowProvider from "@/components/workflow/WorkflowProvider";
|
||||||
import WorkflowRuns from "@/components/workflow/run/WorkflowRuns";
|
import WorkflowRuns from "@/components/workflow/run/WorkflowRuns";
|
||||||
import { isAllNodesValidated, type WorkflowModel, type WorkflowNode } from "@/domain/workflow";
|
import { type WorkflowModel, type WorkflowNode, isAllNodesValidated } from "@/domain/workflow";
|
||||||
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
import { useAntdForm, useZustandShallowSelector } from "@/hooks";
|
||||||
import { remove as removeWorkflow } from "@/repository/workflow";
|
import { remove as removeWorkflow } from "@/repository/workflow";
|
||||||
import { useWorkflowStore } from "@/stores/workflow";
|
import { useWorkflowStore } from "@/stores/workflow";
|
||||||
|
@ -9,23 +9,23 @@ import {
|
|||||||
Divider,
|
Divider,
|
||||||
Empty,
|
Empty,
|
||||||
Menu,
|
Menu,
|
||||||
message,
|
type MenuProps,
|
||||||
Modal,
|
Modal,
|
||||||
notification,
|
|
||||||
Radio,
|
Radio,
|
||||||
Space,
|
Space,
|
||||||
Switch,
|
Switch,
|
||||||
Table,
|
Table,
|
||||||
theme,
|
type TableProps,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Typography,
|
Typography,
|
||||||
type MenuProps,
|
message,
|
||||||
type TableProps,
|
notification,
|
||||||
|
theme,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { ClientResponseError } from "pocketbase";
|
import { ClientResponseError } from "pocketbase";
|
||||||
|
|
||||||
import { isAllNodesValidated, type WorkflowModel } from "@/domain/workflow";
|
import { type WorkflowModel, isAllNodesValidated } from "@/domain/workflow";
|
||||||
import { list as listWorkflow, remove as removeWorkflow, save as saveWorkflow } from "@/repository/workflow";
|
import { list as listWorkflow, remove as removeWorkflow, save as saveWorkflow } from "@/repository/workflow";
|
||||||
import { getErrMsg } from "@/utils/error";
|
import { getErrMsg } from "@/utils/error";
|
||||||
|
|
||||||
@ -239,6 +239,10 @@ const WorkflowList = () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleCreateClick = () => {
|
||||||
|
navigate("/workflows/new");
|
||||||
|
};
|
||||||
|
|
||||||
const handleEnabledChange = async (workflow: WorkflowModel) => {
|
const handleEnabledChange = async (workflow: WorkflowModel) => {
|
||||||
try {
|
try {
|
||||||
if (!workflow.enabled && !isAllNodesValidated(workflow.content!)) {
|
if (!workflow.enabled && !isAllNodesValidated(workflow.content!)) {
|
||||||
@ -284,10 +288,6 @@ const WorkflowList = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCreateClick = () => {
|
|
||||||
alert("TODO");
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-4">
|
<div className="p-4">
|
||||||
{MessageContextHolder}
|
{MessageContextHolder}
|
||||||
|
@ -13,6 +13,7 @@ import SettingsPassword from "./pages/settings/SettingsPassword";
|
|||||||
import SettingsSSLProvider from "./pages/settings/SettingsSSLProvider";
|
import SettingsSSLProvider from "./pages/settings/SettingsSSLProvider";
|
||||||
import WorkflowDetail from "./pages/workflows/WorkflowDetail";
|
import WorkflowDetail from "./pages/workflows/WorkflowDetail";
|
||||||
import WorkflowList from "./pages/workflows/WorkflowList";
|
import WorkflowList from "./pages/workflows/WorkflowList";
|
||||||
|
import WorkflowNew from "./pages/workflows/WorkflowNew";
|
||||||
|
|
||||||
export const router = createHashRouter([
|
export const router = createHashRouter([
|
||||||
{
|
{
|
||||||
@ -35,6 +36,10 @@ export const router = createHashRouter([
|
|||||||
path: "/workflows",
|
path: "/workflows",
|
||||||
element: <WorkflowList />,
|
element: <WorkflowList />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/workflows/new",
|
||||||
|
element: <WorkflowNew />,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/workflows/:id",
|
path: "/workflows/:id",
|
||||||
element: <WorkflowDetail />,
|
element: <WorkflowDetail />,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
|
|
||||||
import { type AccessModel } from "@/domain/access";
|
import { type AccessModel } from "@/domain/access";
|
||||||
import { list as listAccess, save as saveAccess, remove as removeAccess } from "@/repository/access";
|
import { list as listAccess, remove as removeAccess, save as saveAccess } from "@/repository/access";
|
||||||
|
|
||||||
export interface AccessesState {
|
export interface AccessesState {
|
||||||
accesses: AccessModel[];
|
accesses: AccessModel[];
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { produce } from "immer";
|
import { produce } from "immer";
|
||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
|
|
||||||
import { SETTINGS_NAMES, type EmailsSettingsContent, type SettingsModel } from "@/domain/settings";
|
import { type EmailsSettingsContent, SETTINGS_NAMES, type SettingsModel } from "@/domain/settings";
|
||||||
import { get as getSettings, save as saveSettings } from "@/repository/settings";
|
import { get as getSettings, save as saveSettings } from "@/repository/settings";
|
||||||
|
|
||||||
export interface ContactEmailsState {
|
export interface ContactEmailsState {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { produce } from "immer";
|
import { produce } from "immer";
|
||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
|
|
||||||
import { SETTINGS_NAMES, type NotifyChannelsSettingsContent, type SettingsModel } from "@/domain/settings";
|
import { type NotifyChannelsSettingsContent, SETTINGS_NAMES, type SettingsModel } from "@/domain/settings";
|
||||||
import { get as getSettings, save as saveSettings } from "@/repository/settings";
|
import { get as getSettings, save as saveSettings } from "@/repository/settings";
|
||||||
|
|
||||||
export interface NotifyChannelsState {
|
export interface NotifyChannelsState {
|
||||||
|
@ -3,7 +3,7 @@ import path from "node:path";
|
|||||||
import legacyPlugin from "@vitejs/plugin-legacy";
|
import legacyPlugin from "@vitejs/plugin-legacy";
|
||||||
import reactPlugin from "@vitejs/plugin-react";
|
import reactPlugin from "@vitejs/plugin-react";
|
||||||
import fs from "fs-extra";
|
import fs from "fs-extra";
|
||||||
import { defineConfig, type Plugin } from "vite";
|
import { type Plugin, defineConfig } from "vite";
|
||||||
|
|
||||||
const preserveFilesPlugin = (filesToPreserve: string[]): Plugin => {
|
const preserveFilesPlugin = (filesToPreserve: string[]): Plugin => {
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user