mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
4.8.10 workflow perf (#2596)
* perf: run plugin variables init * perf: init free plan * perf: dataset data ui * perf: workflow theme * perf: plugin input modal ui * perf: workflow dispatch * fix: account ui * feat: 4810 doc
This commit is contained in:
@@ -55,30 +55,32 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4810' \
|
||||
6. 新增 - 工作流版本支持重命名
|
||||
7. 新增 - 应用调用迁移成单独节点,同时可以传递全局变量和用户的文件。
|
||||
8. 新增 - 插件增加使用说明配置。
|
||||
9. 商业版新增 - 飞书机器人接入
|
||||
10. 商业版新增 - 公众号接入接入
|
||||
11. 商业版新增 - 自助开票申请
|
||||
12. 商业版新增 - SSO 定制
|
||||
13. 优化 - SSE 响应优化。
|
||||
14. 优化 - 无 SSL 证书情况下,优化复制。
|
||||
15. 优化 - 单选框打开后自动滚动到选中的位置。
|
||||
16. 优化 - 知识库集合禁用,目录禁用会递归修改其下所有 children 的禁用状态。
|
||||
17. 优化 - 节点选择,避免切换 tab 时候,path 加载报错。
|
||||
18. 优化 - 最新 React Markdown 组件,支持 Base64 图片。
|
||||
19. 优化 - 知识库列表 UI。
|
||||
20. 优化 - 知识库详情页 UI。
|
||||
21. 优化 - 支持无网络配置情况下运行。
|
||||
22. 优化 - 部分全局变量,增加数据类型约束。
|
||||
23. 修复 - 全局变量 key 可能重复。
|
||||
24. 修复 - Prompt 模式调用工具,stream=false 模式下,会携带 0: 开头标记。
|
||||
25. 修复 - 对话日志鉴权问题:仅为 APP 管理员的用户,无法查看对话日志详情。
|
||||
26. 修复 - 选择 Milvus 部署时,无法导出知识库。
|
||||
27. 修复 - 创建 APP 副本,无法复制系统配置。
|
||||
28. 修复 - 图片识别模式下,自动解析图片链接正则不够严谨问题。
|
||||
29. 修复 - 内容提取的数据类型与输出数据类型未一致。
|
||||
30. 修复 - 工作流运行时间统计错误。
|
||||
31. 修复 - stream 模式下,工具调用有可能出现 undefined
|
||||
32. 修复 - 全局变量在 API 中无法持久化。
|
||||
33. 修复 - OpenAPI,detail=false模式下,不应该返回 tool 调用结果,仅返回文字。(可解决 cow 不适配问题)
|
||||
34. 修复 - 知识库标签重复加载。
|
||||
35. 修复 - Debug 模式下,循环调用边问题。
|
||||
9. 新增 - 工作流导出导入,支持直接导出和导入 JSON 文件,便于交流。
|
||||
10. 商业版新增 - 飞书机器人接入
|
||||
11. 商业版新增 - 公众号接入接入
|
||||
12. 商业版新增 - 自助开票申请
|
||||
13. 商业版新增 - SSO 定制
|
||||
14. 优化 - 工作流循环校验,避免 skip 循环空转。同时支持分支完全并发执行。
|
||||
15. 优化 - SSE 响应优化。
|
||||
16. 优化 - 无 SSL 证书情况下,优化复制。
|
||||
17. 优化 - 单选框打开后自动滚动到选中的位置。
|
||||
18. 优化 - 知识库集合禁用,目录禁用会递归修改其下所有 children 的禁用状态。
|
||||
19. 优化 - 节点选择,避免切换 tab 时候,path 加载报错。
|
||||
20. 优化 - 最新 React Markdown 组件,支持 Base64 图片。
|
||||
21. 优化 - 知识库列表 UI。
|
||||
22. 优化 - 知识库详情页 UI。
|
||||
23. 优化 - 支持无网络配置情况下运行。
|
||||
24. 优化 - 部分全局变量,增加数据类型约束。
|
||||
25. 修复 - 全局变量 key 可能重复。
|
||||
26. 修复 - Prompt 模式调用工具,stream=false 模式下,会携带 0: 开头标记。
|
||||
27. 修复 - 对话日志鉴权问题:仅为 APP 管理员的用户,无法查看对话日志详情。
|
||||
28. 修复 - 选择 Milvus 部署时,无法导出知识库。
|
||||
29. 修复 - 创建 APP 副本,无法复制系统配置。
|
||||
30. 修复 - 图片识别模式下,自动解析图片链接正则不够严谨问题。
|
||||
31. 修复 - 内容提取的数据类型与输出数据类型未一致。
|
||||
32. 修复 - 工作流运行时间统计错误。
|
||||
33. 修复 - stream 模式下,工具调用有可能出现 undefined
|
||||
34. 修复 - 全局变量在 API 中无法持久化。
|
||||
35. 修复 - OpenAPI,detail=false模式下,不应该返回 tool 调用结果,仅返回文字。(可解决 cow 不适配问题)
|
||||
36. 修复 - 知识库标签重复加载。
|
||||
37. 修复 - Debug 模式下,循环调用边问题。
|
||||
|
@@ -26,8 +26,8 @@ export type ChatDispatchProps = {
|
||||
res?: NextApiResponse;
|
||||
requestOrigin?: string;
|
||||
mode: 'test' | 'chat' | 'debug';
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
teamId: string; // App teamId
|
||||
tmbId: string; // App tmbId
|
||||
user: UserModelSchema;
|
||||
app: AppDetailType | AppSchema;
|
||||
chatId?: string;
|
||||
|
@@ -63,7 +63,7 @@ import {
|
||||
InteractiveNodeResponseItemType,
|
||||
UserSelectInteractive
|
||||
} from '@fastgpt/global/core/workflow/template/system/userSelect/type';
|
||||
import { dispatchRunAppNode } from './agent/runApp';
|
||||
import { dispatchRunAppNode } from './plugin/runApp';
|
||||
|
||||
const callbackMap: Record<FlowNodeTypeEnum, Function> = {
|
||||
[FlowNodeTypeEnum.workflowStart]: dispatchWorkflowStart,
|
||||
@@ -186,7 +186,10 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
function nodeOutput(
|
||||
node: RuntimeNodeItemType,
|
||||
result: Record<string, any> = {}
|
||||
): RuntimeNodeItemType[] {
|
||||
): {
|
||||
nextStepActiveNodes: RuntimeNodeItemType[];
|
||||
nextStepSkipNodes: RuntimeNodeItemType[];
|
||||
} {
|
||||
pushStore(node, result);
|
||||
|
||||
// Assign the output value to the next node
|
||||
@@ -211,16 +214,32 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
}
|
||||
});
|
||||
|
||||
const nextStepNodes = runtimeNodes.filter((node) => {
|
||||
return targetEdges.some((item) => item.target === node.nodeId);
|
||||
const nextStepActiveNodes: RuntimeNodeItemType[] = [];
|
||||
const nextStepSkipNodes: RuntimeNodeItemType[] = [];
|
||||
runtimeNodes.forEach((node) => {
|
||||
if (targetEdges.some((item) => item.target === node.nodeId && item.status === 'active')) {
|
||||
nextStepActiveNodes.push(node);
|
||||
}
|
||||
if (targetEdges.some((item) => item.target === node.nodeId && item.status === 'skipped')) {
|
||||
nextStepSkipNodes.push(node);
|
||||
}
|
||||
});
|
||||
|
||||
if (props.mode === 'debug') {
|
||||
debugNextStepRunNodes = debugNextStepRunNodes.concat(nextStepNodes);
|
||||
return [];
|
||||
debugNextStepRunNodes = debugNextStepRunNodes.concat([
|
||||
...nextStepActiveNodes,
|
||||
...nextStepSkipNodes
|
||||
]);
|
||||
return {
|
||||
nextStepActiveNodes: [],
|
||||
nextStepSkipNodes: []
|
||||
};
|
||||
}
|
||||
|
||||
return nextStepNodes;
|
||||
return {
|
||||
nextStepActiveNodes,
|
||||
nextStepSkipNodes
|
||||
};
|
||||
}
|
||||
|
||||
/* Have interactive result, computed edges and node outputs */
|
||||
@@ -281,69 +300,82 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
});
|
||||
}
|
||||
/* Check node run/skip or wait */
|
||||
function checkNodeCanRun(nodes: RuntimeNodeItemType[] = []): Promise<any> {
|
||||
return Promise.all(
|
||||
nodes.map(async (node) => {
|
||||
const status = checkNodeRunStatus({
|
||||
node,
|
||||
runtimeEdges
|
||||
});
|
||||
async function checkNodeCanRun(
|
||||
node: RuntimeNodeItemType,
|
||||
skippedNodeIdList = new Set<string>()
|
||||
): Promise<RuntimeNodeItemType[]> {
|
||||
if (res?.closed || props.maxRunTimes <= 0) return [];
|
||||
// Thread avoidance
|
||||
await surrenderProcess();
|
||||
|
||||
if (res?.closed || props.maxRunTimes <= 0) return;
|
||||
addLog.debug(`Run node`, { maxRunTimes: props.maxRunTimes, uid: user._id });
|
||||
|
||||
addLog.debug(`Run node`, { maxRunTimes: props.maxRunTimes, uid: user._id });
|
||||
|
||||
// Thread avoidance
|
||||
await surrenderProcess();
|
||||
|
||||
if (status === 'run') {
|
||||
addLog.debug(`[dispatchWorkFlow] nodeRunWithActive: ${node.name}`);
|
||||
return nodeRunWithActive(node);
|
||||
}
|
||||
if (status === 'skip') {
|
||||
addLog.debug(`[dispatchWorkFlow] nodeRunWithSkip: ${node.name}`);
|
||||
return nodeRunWithSkip(node);
|
||||
}
|
||||
|
||||
return;
|
||||
})
|
||||
).then((result) => {
|
||||
props.maxRunTimes--;
|
||||
|
||||
const flat = result.flat().filter(Boolean) as unknown as {
|
||||
node: RuntimeNodeItemType;
|
||||
runStatus: 'run' | 'skip';
|
||||
result: Record<string, any>;
|
||||
}[];
|
||||
// If there are no running nodes, the workflow is complete
|
||||
if (flat.length === 0) return;
|
||||
|
||||
// Update the node output at the end of the run and get the next nodes
|
||||
const nextNodes = flat.map((item) => nodeOutput(item.node, item.result)).flat();
|
||||
// Remove repeat nodes(Make sure that the node is only executed once)
|
||||
const filterNextNodes = nextNodes.filter(
|
||||
(node, index, self) => self.findIndex((t) => t.nodeId === node.nodeId) === index
|
||||
);
|
||||
|
||||
// In the current version, only one interactive node is allowed at the same time
|
||||
const haveInteractiveResponse = flat
|
||||
.map((response) => {
|
||||
const interactiveResponse = response.result?.[DispatchNodeResponseKeyEnum.interactive];
|
||||
if (interactiveResponse) {
|
||||
chatAssistantResponse.push(
|
||||
handleInteractiveResult({
|
||||
entryNodeIds: [response.node.nodeId],
|
||||
interactiveResponse
|
||||
})
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
})
|
||||
.filter(Boolean);
|
||||
if (haveInteractiveResponse.length > 0) return;
|
||||
|
||||
return checkNodeCanRun(filterNextNodes);
|
||||
// Get node run status by edges
|
||||
const status = checkNodeRunStatus({
|
||||
node,
|
||||
runtimeEdges
|
||||
});
|
||||
const nodeRunResult = await (() => {
|
||||
if (status === 'run') {
|
||||
props.maxRunTimes--;
|
||||
addLog.debug(`[dispatchWorkFlow] nodeRunWithActive: ${node.name}`);
|
||||
return nodeRunWithActive(node);
|
||||
}
|
||||
if (status === 'skip' && !skippedNodeIdList.has(node.nodeId)) {
|
||||
props.maxRunTimes -= 0.1;
|
||||
skippedNodeIdList.add(node.nodeId);
|
||||
addLog.debug(`[dispatchWorkFlow] nodeRunWithSkip: ${node.name}`);
|
||||
return nodeRunWithSkip(node);
|
||||
}
|
||||
})();
|
||||
|
||||
if (!nodeRunResult) return [];
|
||||
|
||||
// Update the node output at the end of the run and get the next nodes
|
||||
let { nextStepActiveNodes, nextStepSkipNodes } = nodeOutput(
|
||||
nodeRunResult.node,
|
||||
nodeRunResult.result
|
||||
);
|
||||
// Remove repeat nodes(Make sure that the node is only executed once)
|
||||
nextStepActiveNodes = nextStepActiveNodes.filter(
|
||||
(node, index, self) => self.findIndex((t) => t.nodeId === node.nodeId) === index
|
||||
);
|
||||
nextStepSkipNodes = nextStepSkipNodes.filter(
|
||||
(node, index, self) => self.findIndex((t) => t.nodeId === node.nodeId) === index
|
||||
);
|
||||
|
||||
// In the current version, only one interactive node is allowed at the same time
|
||||
const interactiveResponse = nodeRunResult.result?.[DispatchNodeResponseKeyEnum.interactive];
|
||||
if (interactiveResponse) {
|
||||
chatAssistantResponse.push(
|
||||
handleInteractiveResult({
|
||||
entryNodeIds: [nodeRunResult.node.nodeId],
|
||||
interactiveResponse
|
||||
})
|
||||
);
|
||||
return [];
|
||||
}
|
||||
|
||||
// Run next nodes(先运行 run 的,再运行 skip 的)
|
||||
const nextStepActiveNodesResults = (
|
||||
await Promise.all(nextStepActiveNodes.map((node) => checkNodeCanRun(node)))
|
||||
).flat();
|
||||
|
||||
// 如果已经 active 运行过,不再执行 skip(active 中有闭环)
|
||||
nextStepSkipNodes = nextStepSkipNodes.filter(
|
||||
(node) => !nextStepActiveNodesResults.some((item) => item.nodeId === node.nodeId)
|
||||
);
|
||||
|
||||
const nextStepSkipNodesResults = (
|
||||
await Promise.all(nextStepSkipNodes.map((node) => checkNodeCanRun(node, skippedNodeIdList)))
|
||||
).flat();
|
||||
|
||||
return [
|
||||
...nextStepActiveNodes,
|
||||
...nextStepSkipNodes,
|
||||
...nextStepActiveNodesResults,
|
||||
...nextStepSkipNodesResults
|
||||
];
|
||||
}
|
||||
/* Inject data into module input */
|
||||
function getNodeRunParams(node: RuntimeNodeItemType) {
|
||||
@@ -396,7 +428,11 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
|
||||
return params;
|
||||
}
|
||||
async function nodeRunWithActive(node: RuntimeNodeItemType) {
|
||||
async function nodeRunWithActive(node: RuntimeNodeItemType): Promise<{
|
||||
node: RuntimeNodeItemType;
|
||||
runStatus: 'run';
|
||||
result: Record<string, any>;
|
||||
}> {
|
||||
// push run status messages
|
||||
if (node.showStatus) {
|
||||
props.workflowStreamResponse?.({
|
||||
@@ -465,8 +501,12 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
}
|
||||
};
|
||||
}
|
||||
async function nodeRunWithSkip(node: RuntimeNodeItemType) {
|
||||
// 其后所有target的节点,都设置为skip
|
||||
async function nodeRunWithSkip(node: RuntimeNodeItemType): Promise<{
|
||||
node: RuntimeNodeItemType;
|
||||
runStatus: 'skip';
|
||||
result: Record<string, any>;
|
||||
}> {
|
||||
// Set target edges status to skipped
|
||||
const targetEdges = runtimeEdges.filter((item) => item.source === node.nodeId);
|
||||
nodeRunAfterHook(node);
|
||||
|
||||
@@ -486,7 +526,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
// runtimeNodes.forEach((item) => {
|
||||
// item.isEntry = false;
|
||||
// });
|
||||
await checkNodeCanRun(entryNodes);
|
||||
await Promise.all(entryNodes.map((node) => checkNodeCanRun(node)));
|
||||
|
||||
// focus try to run pluginOutput
|
||||
const pluginOutputModule = runtimeNodes.find(
|
||||
|
@@ -64,7 +64,11 @@ export const dispatchRunPlugin = async (props: RunPluginProps): Promise<RunPlugi
|
||||
|
||||
const { flowResponses, flowUsages, assistantResponses } = await dispatchWorkFlow({
|
||||
...props,
|
||||
variables: filterSystemVariables(props.variables),
|
||||
|
||||
variables: {
|
||||
...filterSystemVariables(props.variables),
|
||||
appId: String(plugin.id)
|
||||
},
|
||||
runtimeNodes,
|
||||
runtimeEdges: initWorkflowEdgeStatus(plugin.edges)
|
||||
});
|
||||
|
@@ -50,7 +50,7 @@ export const getTeamStandPlan = async ({ teamId }: { teamId: string }) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const initTeamStandardPlan2Free = async ({
|
||||
export const initTeamFreePlan = async ({
|
||||
teamId,
|
||||
session
|
||||
}: {
|
||||
@@ -59,23 +59,28 @@ export const initTeamStandardPlan2Free = async ({
|
||||
}) => {
|
||||
const freePoints = global?.subPlans?.standard?.[StandardSubLevelEnum.free]?.totalPoints || 100;
|
||||
|
||||
const teamStandardSub = await MongoTeamSub.findOne({ teamId, type: SubTypeEnum.standard });
|
||||
const freePlan = await MongoTeamSub.findOne({
|
||||
teamId,
|
||||
type: SubTypeEnum.standard,
|
||||
currentSubLevel: StandardSubLevelEnum.free
|
||||
});
|
||||
|
||||
if (teamStandardSub) {
|
||||
teamStandardSub.currentMode = SubModeEnum.month;
|
||||
teamStandardSub.nextMode = SubModeEnum.month;
|
||||
teamStandardSub.startTime = new Date();
|
||||
teamStandardSub.expiredTime = addMonths(new Date(), 1);
|
||||
// Reset one month free plan
|
||||
if (freePlan) {
|
||||
freePlan.currentMode = SubModeEnum.month;
|
||||
freePlan.nextMode = SubModeEnum.month;
|
||||
freePlan.startTime = new Date();
|
||||
freePlan.expiredTime = addMonths(new Date(), 1);
|
||||
|
||||
teamStandardSub.currentSubLevel = StandardSubLevelEnum.free;
|
||||
teamStandardSub.nextSubLevel = StandardSubLevelEnum.free;
|
||||
freePlan.currentSubLevel = StandardSubLevelEnum.free;
|
||||
freePlan.nextSubLevel = StandardSubLevelEnum.free;
|
||||
|
||||
teamStandardSub.totalPoints = freePoints;
|
||||
teamStandardSub.surplusPoints =
|
||||
teamStandardSub.surplusPoints && teamStandardSub.surplusPoints < 0
|
||||
? teamStandardSub.surplusPoints + freePoints
|
||||
freePlan.totalPoints = freePoints;
|
||||
freePlan.surplusPoints =
|
||||
freePlan.surplusPoints && freePlan.surplusPoints < 0
|
||||
? freePlan.surplusPoints + freePoints
|
||||
: freePoints;
|
||||
return teamStandardSub.save({ session });
|
||||
return freePlan.save({ session });
|
||||
}
|
||||
|
||||
return MongoTeamSub.create(
|
||||
@@ -123,13 +128,14 @@ export const getTeamPlanStatus = async ({
|
||||
|
||||
// Free user, first login after expiration. The free subscription plan will be reset
|
||||
if (
|
||||
standardPlan &&
|
||||
standardPlan.expiredTime &&
|
||||
standardPlan.currentSubLevel === StandardSubLevelEnum.free &&
|
||||
dayjs(standardPlan.expiredTime).isBefore(new Date())
|
||||
(standardPlan &&
|
||||
standardPlan.expiredTime &&
|
||||
standardPlan.currentSubLevel === StandardSubLevelEnum.free &&
|
||||
dayjs(standardPlan.expiredTime).isBefore(new Date())) ||
|
||||
teamStandardPlans.length === 0
|
||||
) {
|
||||
console.log('Init free stand plan', { teamId });
|
||||
await initTeamStandardPlan2Free({ teamId });
|
||||
await initTeamFreePlan({ teamId });
|
||||
return getTeamPlanStatus({ teamId });
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,7 @@ export type Props = {
|
||||
icon?: IconNameType | string;
|
||||
label: string | React.ReactNode;
|
||||
description?: string;
|
||||
onClick: () => any;
|
||||
onClick?: () => any;
|
||||
}[];
|
||||
}[];
|
||||
};
|
||||
@@ -170,8 +170,10 @@ const MyMenu = ({
|
||||
{...menuItemStyles}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setIsOpen(false);
|
||||
child.onClick && child.onClick();
|
||||
if (child.onClick) {
|
||||
setIsOpen(false);
|
||||
child.onClick();
|
||||
}
|
||||
}}
|
||||
color={child.isActive ? 'primary.700' : 'myGray.600'}
|
||||
whiteSpace={'pre-wrap'}
|
||||
|
@@ -105,7 +105,7 @@ const MultipleRowSelect = ({
|
||||
justifyContent={'space-between'}
|
||||
width={'100%'}
|
||||
rightIcon={<ChevronDownIcon />}
|
||||
variant={'whiteFlow'}
|
||||
variant={'whiteBase'}
|
||||
_active={{
|
||||
transform: 'none'
|
||||
}}
|
||||
|
@@ -194,28 +194,6 @@ const Button = defineStyleConfig({
|
||||
color: 'myGray.600 !important'
|
||||
}
|
||||
},
|
||||
whiteFlow: {
|
||||
color: 'myGray.600',
|
||||
border: '1px solid',
|
||||
borderColor: 'myGray.200',
|
||||
height: '40px',
|
||||
bg: 'white',
|
||||
px: '12px',
|
||||
py: '0',
|
||||
borderRadius: '6px',
|
||||
transition: 'background 0.1s',
|
||||
_hover: {
|
||||
color: 'primary.600',
|
||||
background: 'primary.1',
|
||||
borderColor: 'primary.300'
|
||||
},
|
||||
_active: {
|
||||
color: 'primary.600'
|
||||
},
|
||||
_disabled: {
|
||||
color: 'myGray.600 !important'
|
||||
}
|
||||
},
|
||||
whiteDanger: {
|
||||
color: 'myGray.600',
|
||||
border: '1px solid',
|
||||
|
@@ -68,7 +68,7 @@ const SettingLLMModel = ({
|
||||
<Button
|
||||
w={'100%'}
|
||||
justifyContent={'flex-start'}
|
||||
variant={'whiteFlow'}
|
||||
variant={'whiteBase'}
|
||||
bg={bg}
|
||||
_active={{
|
||||
transform: 'none'
|
||||
|
@@ -67,9 +67,9 @@ const Account = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box py={[3, '28px']} maxW={['95vw', '1080px']} px={[5, 10]} mx={'auto'}>
|
||||
<Box py={[3, '28px']} px={[5, 10]} mx={'auto'}>
|
||||
{isPc ? (
|
||||
<Flex justifyContent={'center'}>
|
||||
<Flex justifyContent={'center'} maxW={'1080px'}>
|
||||
<Box flex={'0 0 330px'}>
|
||||
<MyInfo onOpenContact={onOpenContact} />
|
||||
<Box mt={9}>
|
||||
@@ -77,7 +77,7 @@ const Account = () => {
|
||||
</Box>
|
||||
</Box>
|
||||
{!!standardPlan && (
|
||||
<Box ml={'45px'} flex={'1 0 0'} maxW={'600px'}>
|
||||
<Box ml={'45px'} flex={'1'} maxW={'600px'}>
|
||||
<PlanUsage />
|
||||
</Box>
|
||||
)}
|
||||
@@ -437,7 +437,7 @@ const PlanUsage = () => {
|
||||
borderColor={'borderColor.low'}
|
||||
borderRadius={'md'}
|
||||
>
|
||||
<Flex px={[5, 7]} py={[3, 6]} whiteSpace={'nowrap'}>
|
||||
<Flex px={[5, 7]} pt={[3, 6]}>
|
||||
<Box flex={'1 0 0'}>
|
||||
<Box color={'myGray.600'} fontSize="sm">
|
||||
{t('common:support.wallet.subscription.Current plan')}
|
||||
@@ -445,24 +445,26 @@ const PlanUsage = () => {
|
||||
<Box fontWeight={'bold'} fontSize="lg">
|
||||
{t(planName as any)}
|
||||
</Box>
|
||||
|
||||
{isFreeTeam ? (
|
||||
<>
|
||||
<Box mt="2" color={'#485264'} fontSize="sm">
|
||||
{t('common:info.free_plan')}
|
||||
</Box>
|
||||
</>
|
||||
) : (
|
||||
<Flex mt="2" color={'#485264'} fontSize="xs">
|
||||
<Box>{t('common:support.wallet.Plan expired time')}:</Box>
|
||||
<Box ml={2}>{formatTime2YMD(standardPlan?.expiredTime)}</Box>
|
||||
</Flex>
|
||||
)}
|
||||
</Box>
|
||||
<Button onClick={() => router.push('/price')} w={'8rem'} size="sm">
|
||||
{t('common:support.wallet.subscription.Upgrade plan')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<Box px={[5, 7]} pb={[3, 6]}>
|
||||
{isFreeTeam ? (
|
||||
<>
|
||||
<Box mt="2" color={'#485264'} fontSize="sm">
|
||||
{t('common:info.free_plan')}
|
||||
</Box>
|
||||
</>
|
||||
) : (
|
||||
<Flex mt="2" color={'#485264'} fontSize="xs">
|
||||
<Box>{t('common:support.wallet.Plan expired time')}:</Box>
|
||||
<Box ml={2}>{formatTime2YMD(standardPlan?.expiredTime)}</Box>
|
||||
</Flex>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
<Box py={3} borderTopWidth={'1px'} borderTopColor={'borderColor.base'}>
|
||||
<Box py={[0, 3]} px={[5, 7]} overflow={'auto'}>
|
||||
<StandardPlanContentList
|
||||
@@ -479,7 +481,7 @@ const PlanUsage = () => {
|
||||
borderColor={'borderColor.low'}
|
||||
borderRadius={'md'}
|
||||
px={[5, 10]}
|
||||
pt={[2, 4]}
|
||||
pt={4}
|
||||
pb={[4, 7]}
|
||||
>
|
||||
<Flex>
|
||||
|
@@ -180,12 +180,11 @@ const UsageTable = () => {
|
||||
))}
|
||||
</Tbody>
|
||||
</Table>
|
||||
{!isLoading && usages.length === 0 && (
|
||||
<EmptyTip text={t('common:user.no_usage_records')}></EmptyTip>
|
||||
)}
|
||||
</TableContainer>
|
||||
|
||||
{!isLoading && usages.length === 0 && (
|
||||
<EmptyTip text={t('common:user.no_usage_records')}></EmptyTip>
|
||||
)}
|
||||
|
||||
<Loading loading={isLoading} fixed={false} />
|
||||
{!!usageDetail && (
|
||||
<UsageDetail usage={usageDetail} onClose={() => setUsageDetail(undefined)} />
|
||||
|
@@ -125,7 +125,7 @@ const Header = () => {
|
||||
try {
|
||||
localStorage.removeItem(`${appDetail._id}-past`);
|
||||
localStorage.removeItem(`${appDetail._id}-future`);
|
||||
router.push('/app/list');
|
||||
router.back();
|
||||
} catch (error) {}
|
||||
}, [appDetail._id, router]);
|
||||
|
||||
|
@@ -15,7 +15,7 @@ const RouteTab = () => {
|
||||
|
||||
const setCurrentTab = useCallback(
|
||||
(tab: TabEnum) => {
|
||||
router.push({
|
||||
router.replace({
|
||||
query: {
|
||||
...router.query,
|
||||
currentTab: tab
|
||||
@@ -41,7 +41,7 @@ const RouteTab = () => {
|
||||
]
|
||||
: [])
|
||||
],
|
||||
[appDetail.permission.hasManagePer, appT]
|
||||
[appDetail.permission.hasManagePer, appDetail.type, appT]
|
||||
);
|
||||
|
||||
return (
|
||||
|
@@ -125,7 +125,7 @@ const Header = () => {
|
||||
try {
|
||||
localStorage.removeItem(`${appDetail._id}-past`);
|
||||
localStorage.removeItem(`${appDetail._id}-future`);
|
||||
router.push('/app/list');
|
||||
router.back();
|
||||
} catch (error) {}
|
||||
}, [appDetail._id, router]);
|
||||
|
||||
|
@@ -74,8 +74,7 @@ const AppCard = ({
|
||||
label: ExportPopover({
|
||||
chatConfig: appDetail.chatConfig,
|
||||
appName: appDetail.name
|
||||
}),
|
||||
onClick: () => {}
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -192,7 +191,7 @@ function ExportPopover({
|
||||
const { t } = useTranslation();
|
||||
const { copyData } = useCopyData();
|
||||
const { flowData2StoreDataAndCheck } = useContextSelector(WorkflowContext, (v) => v);
|
||||
const data = flowData2StoreDataAndCheck();
|
||||
|
||||
const onExportWorkflow = useCallback(async () => {
|
||||
const data = flowData2StoreDataAndCheck();
|
||||
if (data) {
|
||||
@@ -251,7 +250,10 @@ function ExportPopover({
|
||||
}}
|
||||
borderRadius={'xs'}
|
||||
onClick={() => {
|
||||
const data = flowData2StoreDataAndCheck();
|
||||
|
||||
if (!data) return;
|
||||
|
||||
fileDownload({
|
||||
text: JSON.stringify(
|
||||
{
|
||||
|
@@ -312,6 +312,7 @@ const FieldEditModal = ({
|
||||
title={isEdit ? t('workflow:edit_input') : t('workflow:add_new_input')}
|
||||
maxW={['90vw', '1028px']}
|
||||
w={'100%'}
|
||||
isCentered
|
||||
>
|
||||
<Flex h={'560px'}>
|
||||
<Stack gap={4} p={8}>
|
||||
|
@@ -50,7 +50,7 @@ const SelectAppRender = ({ item, nodeId }: RenderInputProps) => {
|
||||
<>
|
||||
<Box onClick={onOpenSelectApp}>
|
||||
{!value ? (
|
||||
<Button variant={'whiteFlow'} w={'100%'}>
|
||||
<Button variant={'whiteBase'} w={'100%'}>
|
||||
{t('common:core.module.Select app')}
|
||||
</Button>
|
||||
) : (
|
||||
@@ -58,7 +58,7 @@ const SelectAppRender = ({ item, nodeId }: RenderInputProps) => {
|
||||
isLoading={loading}
|
||||
w={'100%'}
|
||||
justifyContent={loading ? 'center' : 'flex-start'}
|
||||
variant={'whiteFlow'}
|
||||
variant={'whiteBase'}
|
||||
leftIcon={<Avatar src={appDetail?.avatar} w={6} />}
|
||||
>
|
||||
{appDetail?.name}
|
||||
|
@@ -179,7 +179,7 @@ const DataCard = () => {
|
||||
<Flex align={'center'} color={'myGray.500'}>
|
||||
<MyIcon name="common/list" mr={2} w={'18px'} />
|
||||
<Box as={'span'} fontSize={['sm', '14px']} fontWeight={'500'}>
|
||||
{t('core.dataset.data.Total Amount', { total })}
|
||||
{t('common:core.dataset.data.Total Amount', { total })}
|
||||
</Box>
|
||||
</Flex>
|
||||
<Box flex={1} mr={1} />
|
||||
@@ -204,7 +204,7 @@ const DataCard = () => {
|
||||
/>
|
||||
</Flex>
|
||||
{/* data */}
|
||||
<Box flex={'1 0 0'} overflow={'auto'} px={5}>
|
||||
<Box flex={'1 0 0'} overflow={'auto'} px={5} pb={5}>
|
||||
<Flex flexDir={'column'} gap={2}>
|
||||
{datasetDataList.map((item, index) => (
|
||||
<Card
|
||||
|
Reference in New Issue
Block a user