diff --git a/web/public/locales/en/translation.json b/web/public/locales/en/translation.json index 959ce3d7c8..a5d9d0c620 100644 --- a/web/public/locales/en/translation.json +++ b/web/public/locales/en/translation.json @@ -136,6 +136,7 @@ "NoDesc": "No Description", "CurrentVersion": "Current Version", "HistoryVersion": "History version", + "DeployChangelog": "Input the description of this function modification (optional)", "MoveFunctionTip": "Are you sure to move {{srcFunc}} to {{targetDir}} directory?", "MoveFunctionToRootTip": "Are you sure to move {{srcFunc}} to the root directory?", "MovingFunction": "Moving functions..." diff --git a/web/public/locales/zh-CN/translation.json b/web/public/locales/zh-CN/translation.json index 2a3054bc15..46cad40036 100644 --- a/web/public/locales/zh-CN/translation.json +++ b/web/public/locales/zh-CN/translation.json @@ -136,6 +136,7 @@ "NoDesc": "暂无描述", "CurrentVersion": "当前版本", "HistoryVersion": "历史版本", + "DeployChangelog": "输入此次函数修改的描述 (可选)", "MoveFunctionTip": "是否要将 {{srcFunc}} 移动到 {{targetDir}} 目录?", "MoveFunctionToRootTip": "是否要将 {{srcFunc}} 移动到根目录?", "MovingFunction": "移动函数中..." @@ -752,4 +753,4 @@ "Title": "Laf 新版本已经准备好了!", "Description": "点击立即更新" } -} \ No newline at end of file +} diff --git a/web/public/locales/zh/translation.json b/web/public/locales/zh/translation.json index b048e1de39..7c0a992cc1 100644 --- a/web/public/locales/zh/translation.json +++ b/web/public/locales/zh/translation.json @@ -136,6 +136,7 @@ "NoDesc": "暂无描述", "CurrentVersion": "当前版本", "HistoryVersion": "历史版本", + "DeployChangelog": "输入此次函数修改的描述 (可选)", "MoveFunctionTip": "是否要将 {{srcFunc}} 移动到 {{targetDir}} 目录?", "MoveFunctionToRootTip": "是否要将 {{srcFunc}} 移动到根目录?", "MovingFunction": "移动函数中..." diff --git a/web/src/pages/app/functions/mods/DeployButton/index.tsx b/web/src/pages/app/functions/mods/DeployButton/index.tsx index b0a0a7c55e..ca7dc45cd0 100644 --- a/web/src/pages/app/functions/mods/DeployButton/index.tsx +++ b/web/src/pages/app/functions/mods/DeployButton/index.tsx @@ -1,6 +1,7 @@ import React from "react"; import { Button, + Input, Modal, ModalBody, ModalCloseButton, @@ -32,6 +33,7 @@ export default function DeployButton() { const functionCache = useFunctionCache(); const headerRef = React.useRef(null); + const [changelog, setChangelog] = React.useState(""); const { showSuccess, currentPageId } = useGlobalStore((state) => state); @@ -63,6 +65,7 @@ export default function DeployButton() { name: store.currentFunction?.name, tags: store.currentFunction?.tags, params: store.currentFunction?.params, + changelog, }); if (!res.error) { store.setCurrentFunction(res.data); @@ -113,6 +116,14 @@ export default function DeployButton() { +
+ setChangelog(v.target.value)} + variant="filled" + placeholder={String("输入此次函数修改的描述 (可选)")} + /> +
diff --git a/web/src/pages/app/functions/mods/VersionHistoryPanel/index.tsx b/web/src/pages/app/functions/mods/VersionHistoryPanel/index.tsx index 58946095ce..5e5c086e78 100644 --- a/web/src/pages/app/functions/mods/VersionHistoryPanel/index.tsx +++ b/web/src/pages/app/functions/mods/VersionHistoryPanel/index.tsx @@ -1,5 +1,5 @@ import { useTranslation } from "react-i18next"; -import { Center, Spinner, useColorMode } from "@chakra-ui/react"; +import { Center, Divider, Spinner, Tooltip, useColorMode } from "@chakra-ui/react"; import clsx from "clsx"; import EmptyBox from "@/components/EmptyBox"; @@ -21,7 +21,7 @@ export default function VersionHistoryPanel() { }); return ( -
+
{history.isFetching ? (
@@ -30,41 +30,51 @@ export default function VersionHistoryPanel() { history.data?.data.map((item: any, index: number) => { return ( -
-
- + +
-
+
+ +
+
+
+
+

+ {item.changelog || "changed"} +

+

{formatDate(item.createdAt)}

+
+
+ + #{history.data?.data.length - index} +
- {formatDate(item.createdAt)} + {index !== history.data?.data.length - 1 && }
- - #{history.data?.data.length - index} - -
+ ); })