fix: filter non-normal gguf files

This commit is contained in:
jialin
2025-08-14 11:03:55 +08:00
parent ccfdb99348
commit d6dce4021d
12 changed files with 107 additions and 51 deletions
+11 -28
View File
@@ -1,7 +1,5 @@
import LogoIcon from '@/assets/images/gpustack-logo.png';
import { userAtom } from '@/atoms/user';
import LangSelect from '@/components/lang-select';
import ThemeDropActions from '@/components/theme-toggle/theme-drop-actions';
import { useIntl, useModel } from '@umijs/max';
import { Button, Divider, Form, Spin, message } from 'antd';
import { createStyles } from 'antd-style';
@@ -52,22 +50,6 @@ const DividerWrapper = styled(Divider)`
`;
const useStyles = createStyles(({ token, css }) => ({
header: css`
display: flex;
align-items: center;
gap: 8px;
position: fixed;
right: 0;
top: 0;
height: 60px;
padding: 20px;
.anticon-global {
color: ${token.colorText};
}
.anticon:hover {
color: ${token.colorTextTertiary};
}
`,
errorMessage: css`
display: flex;
flex-direction: column;
@@ -99,6 +81,7 @@ const LoginForm = () => {
const intl = useIntl();
const [form] = Form.useForm();
const [isPassword, setIsPassword] = useState(false);
const [loading, setLoading] = useState(false);
const renderWelCome = () => {
return (
@@ -161,6 +144,7 @@ const LoginForm = () => {
gotoDefaultPage(userInfo);
}
},
onError: (error) => {
// gpustack handle in the interceptor
}
@@ -173,6 +157,9 @@ const LoginForm = () => {
setUserInfo(userInfo);
gotoDefaultPage({});
},
onLoading: (loading) => {
setLoading(loading);
},
onError: handleOnError
});
@@ -186,6 +173,8 @@ const LoginForm = () => {
} else if (SSOAuth.options.saml) {
SSOAuth.loginWithSAML();
}
setLoading(true);
setAuthError(null);
};
const hasThirdPartyLogin = useMemo(() => {
@@ -228,22 +217,16 @@ const LoginForm = () => {
};
const isThirdPartyAuthHandling = useMemo(() => {
return SSOAuth.isSSOLogin && !authError;
}, [SSOAuth.isSSOLogin, authError]);
return loading && !authError;
}, [loading, authError]);
return (
<div>
{contextHolder}
<div className={styles.header}>
<ThemeDropActions></ThemeDropActions>
<LangSelect />
</div>
<div>
{isThirdPartyAuthHandling ? (
<Spin>
<span style={{ color: 'var(--ant-color-text)' }}>
{intl.formatMessage({ id: 'common.login.auth' })}
</span>
<Spin tip={intl.formatMessage({ id: 'common.login.auth' })}>
<div style={{ width: 300 }}></div>
</Spin>
) : (
<>
+2 -5
View File
@@ -2,8 +2,8 @@ import { initialPasswordAtom, userAtom } from '@/atoms/user';
import SealInput from '@/components/seal-form/seal-input';
import { PasswordReg } from '@/config';
import { CRYPT_TEXT } from '@/utils/localstore/index';
import { GlobalOutlined, LockOutlined } from '@ant-design/icons';
import { SelectLang, useIntl } from '@umijs/max';
import { LockOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button, Form, message } from 'antd';
import CryptoJS from 'crypto-js';
import { useAtom } from 'jotai';
@@ -47,9 +47,6 @@ const PasswordForm: React.FC = () => {
return (
<div>
<div style={{ position: 'fixed', right: 0, top: 0, padding: '0 20px' }}>
<SelectLang icon={<GlobalOutlined />} reload={false} />
</div>
<Form
form={form}
style={{ width: '360px', margin: '0 auto' }}