{
+ onChange={(per) => {
if (isInheritPermission && hasParent) {
openConfirm(
() => onRequestChange(per),
diff --git a/projects/app/src/pageComponents/account/TeamSelector.tsx b/projects/app/src/pageComponents/account/TeamSelector.tsx
index eb0dc3c2a..731100f87 100644
--- a/projects/app/src/pageComponents/account/TeamSelector.tsx
+++ b/projects/app/src/pageComponents/account/TeamSelector.tsx
@@ -46,48 +46,21 @@ const TeamSelector = ({
const teamList = useMemo(() => {
return myTeams.map((team) => ({
- label: (
- onSwitchTeam(team.teamId)}
- _hover={{
- cursor: 'pointer'
- }}
- >
-
-
- {team.teamName}
-
-
- ),
+ icon: team.avatar,
+ iconSize: '1.25rem',
+ label: team.teamName,
value: team.teamId
}));
- }, [myTeams, onSwitchTeam]);
+ }, [myTeams]);
const formatTeamList = useMemo(() => {
return [
...(showManage
? [
{
- label: (
- router.push('/account/team')}
- >
-
-
- {t('user:manage_team')}
-
-
- ),
+ icon: 'common/setting',
+ iconSize: '1.25rem',
+ label: t('user:manage_team'),
value: 'manage',
showBorder: true
}
@@ -95,11 +68,24 @@ const TeamSelector = ({
: []),
...teamList
];
- }, [showManage, t, teamList, router]);
+ }, [showManage, t, teamList]);
+
+ const handleChange = (value: string) => {
+ if (value === 'manage') {
+ router.push('/account/team');
+ } else {
+ onSwitchTeam(value);
+ }
+ };
return (
-
+
);
};
diff --git a/projects/app/src/pageComponents/account/bill/BillTable.tsx b/projects/app/src/pageComponents/account/bill/BillTable.tsx
index 5e993c1a3..4df3404bb 100644
--- a/projects/app/src/pageComponents/account/bill/BillTable.tsx
+++ b/projects/app/src/pageComponents/account/bill/BillTable.tsx
@@ -111,7 +111,7 @@ const BillTable = () => {
list={billTypeList}
value={billType}
size={'sm'}
- onchange={(e) => {
+ onChange={(e) => {
setBillType(e);
}}
w={'130px'}
diff --git a/projects/app/src/pageComponents/account/model/AddModelBox.tsx b/projects/app/src/pageComponents/account/model/AddModelBox.tsx
index 3ed5f0825..a94d8b881 100644
--- a/projects/app/src/pageComponents/account/model/AddModelBox.tsx
+++ b/projects/app/src/pageComponents/account/model/AddModelBox.tsx
@@ -213,7 +213,7 @@ export const ModelEditModal = ({
setValue('provider', value)}
+ onChange={(value) => setValue('provider', value)}
list={providerList.current}
{...InputStyles}
/>
diff --git a/projects/app/src/pageComponents/account/model/Channel/EditChannelModal.tsx b/projects/app/src/pageComponents/account/model/Channel/EditChannelModal.tsx
index 6d1256f2f..3771ca093 100644
--- a/projects/app/src/pageComponents/account/model/Channel/EditChannelModal.tsx
+++ b/projects/app/src/pageComponents/account/model/Channel/EditChannelModal.tsx
@@ -194,7 +194,7 @@ const EditChannelModal = ({
placeholder={t('account_model:select_provider_placeholder')}
value={providerType}
isSearch
- onchange={(val) => {
+ onChange={(val) => {
setValue('type', val);
}}
/>
@@ -333,6 +333,8 @@ const MultipleSelect = ({ value = [], list = [], onSelect }: SelectProps) => {
const { isOpen, onOpen, onClose } = useDisclosure();
const { copyData } = useCopyData();
+ const [search, setSearch] = useState('');
+
const onclickItem = useCallback(
(val: string) => {
if (value.includes(val)) {
@@ -343,12 +345,11 @@ const MultipleSelect = ({ value = [], list = [], onSelect }: SelectProps) => {
top: BoxRef.current.scrollHeight
});
}
+ setSearch('');
},
[value, onSelect]
);
- const [search, setSearch] = useState('');
-
const filterUnSelected = useMemo(() => {
return list
.filter((item) => !value.includes(item.value))
diff --git a/projects/app/src/pageComponents/account/model/Channel/ModelTest.tsx b/projects/app/src/pageComponents/account/model/Channel/ModelTest.tsx
index 74e3cf7ed..15e5cb30a 100644
--- a/projects/app/src/pageComponents/account/model/Channel/ModelTest.tsx
+++ b/projects/app/src/pageComponents/account/model/Channel/ModelTest.tsx
@@ -25,6 +25,7 @@ import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
import { getErrText } from '@fastgpt/global/common/error/utils';
import { batchRun } from '@fastgpt/global/common/system/utils';
import { useToast } from '@fastgpt/web/hooks/useToast';
+import MyIconButton from '@fastgpt/web/components/common/Icon/button';
type ModelTestItem = {
label: React.ReactNode;
@@ -143,13 +144,47 @@ const ModelTest = ({
refreshDeps: [testModelList]
}
);
+ const { runAsync: onTestOneModel, loading: testingOneModel } = useRequest2(
+ async (model: string) => {
+ const start = Date.now();
+
+ setTestModelList((prev) =>
+ prev.map((item) =>
+ item.model === model ? { ...item, status: 'running', message: '' } : item
+ )
+ );
+
+ try {
+ await getTestModel({ model, channelId });
+ const duration = Date.now() - start;
+
+ setTestModelList((prev) =>
+ prev.map((item) =>
+ item.model === model ? { ...item, status: 'success', duration: duration / 1000 } : item
+ )
+ );
+ } catch (error) {
+ setTestModelList((prev) =>
+ prev.map((item) =>
+ item.model === model ? { ...item, status: 'error', message: getErrText(error) } : item
+ )
+ );
+ }
+ },
+ {
+ manual: true
+ }
+ );
+
+ const isTestLoading = testingOneModel || isTesting;
return (
@@ -157,8 +192,10 @@ const ModelTest = ({
- | {t('account_model:model')} |
+ {t('account_model:model_name')} |
+ {t('account:model.model_id')} |
{t('account_model:channel_status')} |
+ |
@@ -167,6 +204,7 @@ const ModelTest = ({
return (
| {item.label} |
+ {item.model} |
@@ -182,6 +220,16 @@ const ModelTest = ({
)}
|
+
+ {
+ onTestOneModel(item.model);
+ }}
+ />
+ |
);
})}
@@ -193,7 +241,7 @@ const ModelTest = ({
- |