From ef9ddd27a5d4bf49c382dd25964abfd1c5406139 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Sat, 21 Dec 2024 12:46:22 +0800 Subject: [PATCH] chore: remove unused code --- internal/applicant/applicant.go | 4 +- internal/deployer/deployer.go | 4 +- internal/deployer/factory.go | 5 +- internal/notify/factory.go | 42 ++-- ui/.eslintrc.cjs | 16 +- ui/package-lock.json | 97 --------- ui/package.json | 3 - ui/src/components/ui/switch.tsx | 26 --- ui/src/components/ui/toast.tsx | 93 --------- ui/src/components/ui/toaster.tsx | 24 --- ui/src/components/ui/tooltip.tsx | 54 ----- ui/src/components/ui/use-toast.ts | 187 ----------------- ui/src/components/workflow/ApplyForm.tsx | 12 +- ui/src/pages/ConsoleLayout.tsx | 8 +- ui/src/pages/accesses/AccessList.tsx | 4 +- ui/src/pages/certificates/CertificateList.tsx | 4 +- ui/src/pages/dashboard/Dashboard.tsx | 4 +- ui/src/pages/settings/Settings.tsx | 4 +- ui/src/pages/workflows/WorkflowDetail.tsx | 192 ++++++++---------- ui/src/pages/workflows/WorkflowList.tsx | 4 +- 20 files changed, 151 insertions(+), 636 deletions(-) delete mode 100644 ui/src/components/ui/switch.tsx delete mode 100644 ui/src/components/ui/toast.tsx delete mode 100644 ui/src/components/ui/toaster.tsx delete mode 100644 ui/src/components/ui/tooltip.tsx delete mode 100644 ui/src/components/ui/use-toast.ts diff --git a/internal/applicant/applicant.go b/internal/applicant/applicant.go index 0f58364c..aec21749 100644 --- a/internal/applicant/applicant.go +++ b/internal/applicant/applicant.go @@ -29,8 +29,8 @@ import ( /* 提供商类型常量值。 - 注意:如果追加新的枚举值,请保持以 ASCII 排序。 - NOTICE: If you add new enum, please keep ASCII order. + 注意:如果追加新的常量值,请保持以 ASCII 排序。 + NOTICE: If you add new constant, please keep ASCII order. */ const ( configTypeACMEHttpReq = "acmehttpreq" diff --git a/internal/deployer/deployer.go b/internal/deployer/deployer.go index c5013d9d..44fb4af6 100644 --- a/internal/deployer/deployer.go +++ b/internal/deployer/deployer.go @@ -15,8 +15,8 @@ import ( /* 提供商部署目标常量值。 - 注意:如果追加新的枚举值,请保持以 ASCII 排序。 - NOTICE: If you add new enum, please keep ASCII order. + 注意:如果追加新的常量值,请保持以 ASCII 排序。 + NOTICE: If you add new constant, please keep ASCII order. */ const ( targetAliyunALB = "aliyun-alb" diff --git a/internal/deployer/factory.go b/internal/deployer/factory.go index f4fde3e7..d02800e1 100644 --- a/internal/deployer/factory.go +++ b/internal/deployer/factory.go @@ -33,10 +33,13 @@ import ( "github.com/usual2970/certimate/internal/pkg/utils/maps" ) -// TODO: 该方法目前未实际使用,将在后续迭代中替换 func createDeployer(target string, accessConfig string, deployConfig map[string]any) (deployer.Deployer, deployer.Logger, error) { logger := deployer.NewDefaultLogger() + /* + 注意:如果追加新的常量值,请保持以 ASCII 排序。 + NOTICE: If you add new constant, please keep ASCII order. + */ switch target { case targetAliyunALB, targetAliyunCDN, targetAliyunCLB, targetAliyunDCDN, targetAliyunNLB, targetAliyunOSS: { diff --git a/internal/notify/factory.go b/internal/notify/factory.go index e244b071..3088f246 100644 --- a/internal/notify/factory.go +++ b/internal/notify/factory.go @@ -16,7 +16,23 @@ import ( ) func createNotifier(channel string, channelConfig map[string]any) (notifier.Notifier, error) { + /* + 注意:如果追加新的常量值,请保持以 ASCII 排序。 + NOTICE: If you add new constant, please keep ASCII order. + */ switch channel { + case domain.NotifyChannelBark: + return providerBark.New(&providerBark.BarkNotifierConfig{ + DeviceKey: maps.GetValueAsString(channelConfig, "deviceKey"), + ServerUrl: maps.GetValueAsString(channelConfig, "serverUrl"), + }) + + case domain.NotifyChannelDingtalk: + return providerDingTalk.New(&providerDingTalk.DingTalkNotifierConfig{ + AccessToken: maps.GetValueAsString(channelConfig, "accessToken"), + Secret: maps.GetValueAsString(channelConfig, "secret"), + }) + case domain.NotifyChannelEmail: return providerEmail.New(&providerEmail.EmailNotifierConfig{ SmtpHost: maps.GetValueAsString(channelConfig, "smtpHost"), @@ -28,38 +44,26 @@ func createNotifier(channel string, channelConfig map[string]any) (notifier.Noti ReceiverAddress: maps.GetValueAsString(channelConfig, "receiverAddress"), }) - case domain.NotifyChannelWebhook: - return providerWebhook.New(&providerWebhook.WebhookNotifierConfig{ - Url: maps.GetValueAsString(channelConfig, "url"), - }) - - case domain.NotifyChannelDingtalk: - return providerDingTalk.New(&providerDingTalk.DingTalkNotifierConfig{ - AccessToken: maps.GetValueAsString(channelConfig, "accessToken"), - Secret: maps.GetValueAsString(channelConfig, "secret"), - }) - case domain.NotifyChannelLark: return providerLark.New(&providerLark.LarkNotifierConfig{ WebhookUrl: maps.GetValueAsString(channelConfig, "webhookUrl"), }) + case domain.NotifyChannelServerChan: + return providerServerChan.New(&providerServerChan.ServerChanNotifierConfig{ + Url: maps.GetValueAsString(channelConfig, "url"), + }) + case domain.NotifyChannelTelegram: return providerTelegram.New(&providerTelegram.TelegramNotifierConfig{ ApiToken: maps.GetValueAsString(channelConfig, "apiToken"), ChatId: maps.GetValueAsInt64(channelConfig, "chatId"), }) - case domain.NotifyChannelServerChan: - return providerServerChan.New(&providerServerChan.ServerChanNotifierConfig{ + case domain.NotifyChannelWebhook: + return providerWebhook.New(&providerWebhook.WebhookNotifierConfig{ Url: maps.GetValueAsString(channelConfig, "url"), }) - - case domain.NotifyChannelBark: - return providerBark.New(&providerBark.BarkNotifierConfig{ - DeviceKey: maps.GetValueAsString(channelConfig, "deviceKey"), - ServerUrl: maps.GetValueAsString(channelConfig, "serverUrl"), - }) } return nil, fmt.Errorf("unsupported notifier channel: %s", channelConfig) diff --git a/ui/.eslintrc.cjs b/ui/.eslintrc.cjs index 9c21321d..a2faf5ac 100644 --- a/ui/.eslintrc.cjs +++ b/ui/.eslintrc.cjs @@ -13,7 +13,21 @@ module.exports = { parser: "@typescript-eslint/parser", plugins: ["react-refresh"], rules: { - "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-explicit-any": [ + "warn", + { + ignoreRestArgs: true, + }, + ], + "@typescript-eslint/no-unused-vars": [ + "error", + { + argsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + destructuredArrayIgnorePattern: "^_", + varsIgnorePattern: "^_", + }, + ], "react-refresh/only-export-components": [ "warn", { diff --git a/ui/package-lock.json b/ui/package-lock.json index b4cfb0e3..88cd4038 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -19,9 +19,6 @@ "@radix-ui/react-scroll-area": "^1.1.0", "@radix-ui/react-select": "^2.1.1", "@radix-ui/react-slot": "^1.1.0", - "@radix-ui/react-switch": "^1.1.0", - "@radix-ui/react-toast": "^1.2.1", - "@radix-ui/react-tooltip": "^1.1.2", "@tanstack/react-table": "^8.20.5", "ahooks": "^3.8.4", "antd": "^5.22.2", @@ -3547,100 +3544,6 @@ } } }, - "node_modules/@radix-ui/react-switch": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-switch/-/react-switch-1.1.0.tgz", - "integrity": "sha512-OBzy5WAj641k0AOSpKQtreDMe+isX0MQJ1IVyF03ucdF3DunOnROVrjWs8zsXUxC3zfZ6JL9HFVCUlMghz9dJw==", - "dependencies": { - "@radix-ui/primitive": "1.1.0", - "@radix-ui/react-compose-refs": "1.1.0", - "@radix-ui/react-context": "1.1.0", - "@radix-ui/react-primitive": "2.0.0", - "@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-toast": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-toast/-/react-toast-1.2.1.tgz", - "integrity": "sha512-5trl7piMXcZiCq7MW6r8YYmu0bK5qDpTWz+FdEPdKyft2UixkspheYbjbrLXVN5NGKHFbOP7lm8eD0biiSqZqg==", - "dependencies": { - "@radix-ui/primitive": "1.1.0", - "@radix-ui/react-collection": "1.1.0", - "@radix-ui/react-compose-refs": "1.1.0", - "@radix-ui/react-context": "1.1.0", - "@radix-ui/react-dismissable-layer": "1.1.0", - "@radix-ui/react-portal": "1.1.1", - "@radix-ui/react-presence": "1.1.0", - "@radix-ui/react-primitive": "2.0.0", - "@radix-ui/react-use-callback-ref": "1.1.0", - "@radix-ui/react-use-controllable-state": "1.1.0", - "@radix-ui/react-use-layout-effect": "1.1.0", - "@radix-ui/react-visually-hidden": "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-tooltip": { - "version": "1.1.2", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-tooltip/-/react-tooltip-1.1.2.tgz", - "integrity": "sha512-9XRsLwe6Yb9B/tlnYCPVUd/TFS4J7HuOZW345DCeC6vKIxQGMZdx21RK4VoZauPD5frgkXTYVS5y90L+3YBn4w==", - "dependencies": { - "@radix-ui/primitive": "1.1.0", - "@radix-ui/react-compose-refs": "1.1.0", - "@radix-ui/react-context": "1.1.0", - "@radix-ui/react-dismissable-layer": "1.1.0", - "@radix-ui/react-id": "1.1.0", - "@radix-ui/react-popper": "1.2.0", - "@radix-ui/react-portal": "1.1.1", - "@radix-ui/react-presence": "1.1.0", - "@radix-ui/react-primitive": "2.0.0", - "@radix-ui/react-slot": "1.1.0", - "@radix-ui/react-use-controllable-state": "1.1.0", - "@radix-ui/react-visually-hidden": "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-use-callback-ref": { "version": "1.1.0", "resolved": "https://registry.npmmirror.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.0.tgz", diff --git a/ui/package.json b/ui/package.json index 36e83b06..719b5941 100644 --- a/ui/package.json +++ b/ui/package.json @@ -21,9 +21,6 @@ "@radix-ui/react-scroll-area": "^1.1.0", "@radix-ui/react-select": "^2.1.1", "@radix-ui/react-slot": "^1.1.0", - "@radix-ui/react-switch": "^1.1.0", - "@radix-ui/react-toast": "^1.2.1", - "@radix-ui/react-tooltip": "^1.1.2", "@tanstack/react-table": "^8.20.5", "ahooks": "^3.8.4", "antd": "^5.22.2", diff --git a/ui/src/components/ui/switch.tsx b/ui/src/components/ui/switch.tsx deleted file mode 100644 index 6c646216..00000000 --- a/ui/src/components/ui/switch.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import * as React from "react"; -import * as SwitchPrimitives from "@radix-ui/react-switch"; - -import { cn } from "./utils"; - -const Switch = React.forwardRef, React.ComponentPropsWithoutRef>( - ({ className, ...props }, ref) => ( - - - - ) -); -Switch.displayName = SwitchPrimitives.Root.displayName; - -export { Switch }; diff --git a/ui/src/components/ui/toast.tsx b/ui/src/components/ui/toast.tsx deleted file mode 100644 index 86ad83bb..00000000 --- a/ui/src/components/ui/toast.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import * as React from "react"; -import * as ToastPrimitives from "@radix-ui/react-toast"; -import { X } from "lucide-react"; -import { cva, type VariantProps } from "class-variance-authority"; - -import { cn } from "./utils"; - -const ToastProvider = ToastPrimitives.Provider; - -const ToastViewport = React.forwardRef, React.ComponentPropsWithoutRef>( - ({ className, ...props }, ref) => ( - - ) -); -ToastViewport.displayName = ToastPrimitives.Viewport.displayName; - -const toastVariants = cva( - "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", - { - variants: { - variant: { - default: "border bg-background text-foreground", - destructive: "destructive group border-destructive bg-destructive text-destructive-foreground", - }, - }, - defaultVariants: { - variant: "default", - }, - } -); - -const Toast = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & VariantProps ->(({ className, variant, ...props }, ref) => { - return ; -}); -Toast.displayName = ToastPrimitives.Root.displayName; - -const ToastAction = React.forwardRef, React.ComponentPropsWithoutRef>( - ({ className, ...props }, ref) => ( - - ) -); -ToastAction.displayName = ToastPrimitives.Action.displayName; - -const ToastClose = React.forwardRef, React.ComponentPropsWithoutRef>( - ({ className, ...props }, ref) => ( - - - - ) -); -ToastClose.displayName = ToastPrimitives.Close.displayName; - -const ToastTitle = React.forwardRef, React.ComponentPropsWithoutRef>( - ({ className, ...props }, ref) => -); -ToastTitle.displayName = ToastPrimitives.Title.displayName; - -const ToastDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ); -ToastDescription.displayName = ToastPrimitives.Description.displayName; - -type ToastProps = React.ComponentPropsWithoutRef; - -type ToastActionElement = React.ReactElement; - -export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction }; diff --git a/ui/src/components/ui/toaster.tsx b/ui/src/components/ui/toaster.tsx deleted file mode 100644 index 1850e503..00000000 --- a/ui/src/components/ui/toaster.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from "@/components/ui/toast"; -import { useToast } from "@/components/ui/use-toast"; - -export function Toaster() { - const { toasts } = useToast(); - - return ( - - {toasts.map(function ({ id, title, description, action, ...props }) { - return ( - -
- {title && {title}} - {description && {description}} -
- {action} - -
- ); - })} - -
- ); -} diff --git a/ui/src/components/ui/tooltip.tsx b/ui/src/components/ui/tooltip.tsx deleted file mode 100644 index 2390d4cd..00000000 --- a/ui/src/components/ui/tooltip.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from "react"; -import * as TooltipPrimitive from "@radix-ui/react-tooltip"; - -import { cn } from "./utils"; - -const TooltipProvider = TooltipPrimitive.Provider; - -const Tooltip = TooltipPrimitive.Root; - -const TooltipTrigger = TooltipPrimitive.Trigger; - -const TooltipContent = React.forwardRef, React.ComponentPropsWithoutRef>( - ({ className, sideOffset = 4, ...props }, ref) => ( - - ) -); -TooltipContent.displayName = TooltipPrimitive.Content.displayName; - -type TooltipFastProps = TooltipPrimitive.TooltipContentProps & - TooltipPrimitive.TooltipProps & - React.RefAttributes & { - contentView?: JSX.Element; - }; - -const TooltipLink = React.forwardRef((props: React.PropsWithChildren, forwardedRef: React.ForwardedRef) => ( - - {props.children} - -)); - -function TooltipFast({ children, contentView, open, defaultOpen, onOpenChange, ...props }: TooltipFastProps) { - return ( - - - - {children} - - - {contentView} - - - - ); -} - -export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, TooltipFast }; diff --git a/ui/src/components/ui/use-toast.ts b/ui/src/components/ui/use-toast.ts deleted file mode 100644 index 99abb413..00000000 --- a/ui/src/components/ui/use-toast.ts +++ /dev/null @@ -1,187 +0,0 @@ -// Inspired by react-hot-toast library -import * as React from "react"; - -import type { ToastActionElement, ToastProps } from "@/components/ui/toast"; - -const TOAST_LIMIT = 1; -const TOAST_REMOVE_DELAY = 1000000; - -type ToasterToast = ToastProps & { - id: string; - title?: React.ReactNode; - description?: React.ReactNode; - action?: ToastActionElement; -}; - -const actionTypes = { - ADD_TOAST: "ADD_TOAST", - UPDATE_TOAST: "UPDATE_TOAST", - DISMISS_TOAST: "DISMISS_TOAST", - REMOVE_TOAST: "REMOVE_TOAST", -} as const; - -let count = 0; - -function genId() { - count = (count + 1) % Number.MAX_SAFE_INTEGER; - return count.toString(); -} - -type ActionType = typeof actionTypes; - -type Action = - | { - type: ActionType["ADD_TOAST"]; - toast: ToasterToast; - } - | { - type: ActionType["UPDATE_TOAST"]; - toast: Partial; - } - | { - type: ActionType["DISMISS_TOAST"]; - toastId?: ToasterToast["id"]; - } - | { - type: ActionType["REMOVE_TOAST"]; - toastId?: ToasterToast["id"]; - }; - -interface State { - toasts: ToasterToast[]; -} - -const toastTimeouts = new Map>(); - -const addToRemoveQueue = (toastId: string) => { - if (toastTimeouts.has(toastId)) { - return; - } - - const timeout = setTimeout(() => { - toastTimeouts.delete(toastId); - dispatch({ - type: "REMOVE_TOAST", - toastId: toastId, - }); - }, TOAST_REMOVE_DELAY); - - toastTimeouts.set(toastId, timeout); -}; - -export const reducer = (state: State, action: Action): State => { - switch (action.type) { - case "ADD_TOAST": - return { - ...state, - toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT), - }; - - case "UPDATE_TOAST": - return { - ...state, - toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)), - }; - - case "DISMISS_TOAST": { - const { toastId } = action; - - // ! Side effects ! - This could be extracted into a dismissToast() action, - // but I'll keep it here for simplicity - if (toastId) { - addToRemoveQueue(toastId); - } else { - state.toasts.forEach((toast) => { - addToRemoveQueue(toast.id); - }); - } - - return { - ...state, - toasts: state.toasts.map((t) => - t.id === toastId || toastId === undefined - ? { - ...t, - open: false, - } - : t - ), - }; - } - case "REMOVE_TOAST": - if (action.toastId === undefined) { - return { - ...state, - toasts: [], - }; - } - return { - ...state, - toasts: state.toasts.filter((t) => t.id !== action.toastId), - }; - } -}; - -const listeners: Array<(state: State) => void> = []; - -let memoryState: State = { toasts: [] }; - -function dispatch(action: Action) { - memoryState = reducer(memoryState, action); - listeners.forEach((listener) => { - listener(memoryState); - }); -} - -type Toast = Omit; - -function toast({ ...props }: Toast) { - const id = genId(); - - const update = (props: ToasterToast) => - dispatch({ - type: "UPDATE_TOAST", - toast: { ...props, id }, - }); - const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id }); - - dispatch({ - type: "ADD_TOAST", - toast: { - ...props, - id, - open: true, - onOpenChange: (open) => { - if (!open) dismiss(); - }, - }, - }); - - return { - id: id, - dismiss, - update, - }; -} - -function useToast() { - const [state, setState] = React.useState(memoryState); - - React.useEffect(() => { - listeners.push(setState); - return () => { - const index = listeners.indexOf(setState); - if (index > -1) { - listeners.splice(index, 1); - } - }; - }, [state]); - - return { - ...state, - toast, - dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }), - }; -} - -export { useToast, toast }; diff --git a/ui/src/components/workflow/ApplyForm.tsx b/ui/src/components/workflow/ApplyForm.tsx index 5ba157aa..04a934ec 100644 --- a/ui/src/components/workflow/ApplyForm.tsx +++ b/ui/src/components/workflow/ApplyForm.tsx @@ -1,6 +1,7 @@ import { memo, useEffect } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; +import { Switch, Tooltip } from "antd"; import z from "zod"; import { zodResolver } from "@hookform/resolvers/zod"; import { ChevronsUpDown, Plus, CircleHelp } from "lucide-react"; @@ -17,8 +18,6 @@ import StringList from "@/components/certimate/StringList"; import { accessProvidersMap } from "@/domain/access"; import { useAccessStore } from "@/stores/access"; import { useContactStore } from "@/stores/contact"; -import { Switch } from "@/components/ui/switch"; -import { TooltipFast } from "@/components/ui/tooltip"; import { WorkflowNode, WorkflowNodeConfig } from "@/domain/workflow"; import { useWorkflowStore, WorkflowState } from "@/stores/workflow"; import { useShallow } from "zustand/shallow"; @@ -304,9 +303,8 @@ const ApplyForm = ({ data }: ApplyFormProps) => {
{t("domain.application.form.disable_follow_cname.label")} - {t("domain.application.form.disable_follow_cname.tips")} { } > - +
{ + onChange={(value) => { form.setValue(field.name, value); }} /> diff --git a/ui/src/pages/ConsoleLayout.tsx b/ui/src/pages/ConsoleLayout.tsx index 1451894e..9f249d40 100644 --- a/ui/src/pages/ConsoleLayout.tsx +++ b/ui/src/pages/ConsoleLayout.tsx @@ -52,7 +52,7 @@ const ConsoleLayout = () => { return ( - +
@@ -64,7 +64,7 @@ const ConsoleLayout = () => { - +
- } - > - - - - - +
{ + setTab("history"); + }} + > +
{t("workflow.detail.history")}
- -
{elements}
-
- -
+
+ + + {running ? t("workflow.detail.action.running") : t("workflow.detail.action.run")} + + } + > + + + + + +
+
+ + +
+
{elements}
+
+
+ + +
+
- - - - - +
+
- +
); }; diff --git a/ui/src/pages/workflows/WorkflowList.tsx b/ui/src/pages/workflows/WorkflowList.tsx index 1cccc904..ca011409 100644 --- a/ui/src/pages/workflows/WorkflowList.tsx +++ b/ui/src/pages/workflows/WorkflowList.tsx @@ -280,7 +280,7 @@ const WorkflowList = () => { }; return ( - <> +
{ModelContextHolder} {NotificationContextHolder} @@ -324,7 +324,7 @@ const WorkflowList = () => { rowKey={(record: WorkflowModel) => record.id} scroll={{ x: "max(100%, 960px)" }} /> - +
); };