fix: reset userSettings first login
This commit is contained in:
@@ -46,6 +46,7 @@ const EditorInner: React.FC<ViewerProps> = forwardRef((props, ref) => {
|
||||
const yamlUri = monaco.Uri.parse(path);
|
||||
|
||||
configureMonacoYaml(monaco, {
|
||||
hover: false,
|
||||
schemas: [
|
||||
{
|
||||
uri: 'http://example.com/schema-name.json',
|
||||
|
||||
@@ -18,6 +18,15 @@ import {
|
||||
} from '../config';
|
||||
import { ListItem } from '../config/types';
|
||||
|
||||
const StyledCard = styled(Card)`
|
||||
&:hover {
|
||||
.operations {
|
||||
background-color: var(--ant-color-fill-tertiary);
|
||||
border-radius: var(--ant-border-radius);
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const TagInner = styled(Tag)`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -33,6 +42,7 @@ const Header = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 24px;
|
||||
width: 100%;
|
||||
.title {
|
||||
display: flex;
|
||||
@@ -187,7 +197,7 @@ const BackendCard: React.FC<BackendCardProps> = ({ data, onSelect }) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Card
|
||||
<StyledCard
|
||||
onClick={handleClick}
|
||||
clickable={true}
|
||||
hoverable={true}
|
||||
@@ -197,7 +207,7 @@ const BackendCard: React.FC<BackendCardProps> = ({ data, onSelect }) => {
|
||||
header={
|
||||
<Header>
|
||||
<div className="title">{renderIcon()}</div>
|
||||
<span onClick={onClick}>
|
||||
<span onClick={onClick} className="operations">
|
||||
<DropDownActions
|
||||
menu={{
|
||||
items: actions,
|
||||
@@ -230,7 +240,7 @@ const BackendCard: React.FC<BackendCardProps> = ({ data, onSelect }) => {
|
||||
</CardName>
|
||||
{renderFrameworks()}
|
||||
</Content>
|
||||
</Card>
|
||||
</StyledCard>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ const ClusterOption = styled.span`
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
border-bottom: 1px solid var(--ant-color-split);
|
||||
gap: 8px;
|
||||
gap: 4px;
|
||||
.label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -39,8 +39,8 @@ const ClusterOption = styled.span`
|
||||
}
|
||||
.dot {
|
||||
display: flex;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
background-color: var(--ant-color-warning);
|
||||
border-radius: 50%;
|
||||
&.ready {
|
||||
@@ -54,11 +54,12 @@ const ClusterOption = styled.span`
|
||||
padding: 2px 0px;
|
||||
border-radius: 4px;
|
||||
font-weight: 400;
|
||||
gap: 12px;
|
||||
gap: 8px;
|
||||
}
|
||||
.s-dot {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
margin: 0 4px;
|
||||
background-color: var(--ant-color-text-quaternary);
|
||||
border-radius: 50%;
|
||||
}
|
||||
@@ -128,16 +129,18 @@ const BasicForm: React.FC<BasicFormProps> = (props) => {
|
||||
<span
|
||||
className={`dot ${data.ready_workers > 0 ? 'ready' : ''}`}
|
||||
></span>
|
||||
<span className="flex-center gap-4 text-tertiary">
|
||||
<span>{intl.formatMessage({ id: 'resources.nodes' })}:</span>
|
||||
<span>
|
||||
{data.ready_workers} / {data.workers}
|
||||
<span className="flex-center gap-8">
|
||||
<span className="flex-center gap-4 text-tertiary">
|
||||
<span>{intl.formatMessage({ id: 'resources.nodes' })}:</span>
|
||||
<span>
|
||||
{data.ready_workers}/{data.workers}
|
||||
</span>
|
||||
</span>
|
||||
<span className="s-dot"></span>
|
||||
<span className="flex-center gap-4 text-tertiary">
|
||||
<span>GPUs:</span>
|
||||
<span>{data.gpus}</span>
|
||||
</span>
|
||||
</span>
|
||||
<span className="s-dot"></span>
|
||||
<span className="flex-center gap-4 text-tertiary">
|
||||
<span>GPUs:</span>
|
||||
<span>{data.gpus}</span>
|
||||
</span>
|
||||
</span>
|
||||
</ClusterOption>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { initialPasswordAtom, userAtom } from '@/atoms/user';
|
||||
import { resetStorageUserSettings } from '@/atoms/utils';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { PasswordReg } from '@/config';
|
||||
import {
|
||||
@@ -43,6 +44,7 @@ const PasswordForm: React.FC = () => {
|
||||
});
|
||||
setInitialPassword('');
|
||||
// Reset first login flag
|
||||
resetStorageUserSettings();
|
||||
writeState(IS_FIRST_LOGIN, null);
|
||||
gotoDefaultPage(userInfo);
|
||||
message.success(intl.formatMessage({ id: 'common.message.success' }));
|
||||
|
||||
Reference in New Issue
Block a user