From dc4b93a062010a49a811e842adce86af3e8a4325 Mon Sep 17 00:00:00 2001 From: lulu Date: Mon, 2 Sep 2024 10:00:15 +0800 Subject: [PATCH] fix: 3.1 --- src/assets/img/lock-dark.svg | 4 +-- src/assets/img/lock.svg | 2 +- src/assets/styles/main.scss | 18 +++++++++++++ src/components/Lock/AccountLock.js | 8 +++--- src/components/Login/Endpoint.js | 41 +++++------------------------- src/layouts/Admin.js | 8 +++--- src/utils/checks.js | 2 +- src/views/login/Login.js | 27 ++++++++++---------- 8 files changed, 51 insertions(+), 59 deletions(-) diff --git a/src/assets/img/lock-dark.svg b/src/assets/img/lock-dark.svg index 4eda39e..d559fbb 100644 --- a/src/assets/img/lock-dark.svg +++ b/src/assets/img/lock-dark.svg @@ -2,7 +2,7 @@ suoding - + @@ -11,4 +11,4 @@ - \ No newline at end of file + diff --git a/src/assets/img/lock.svg b/src/assets/img/lock.svg index 4eda39e..9ef469a 100644 --- a/src/assets/img/lock.svg +++ b/src/assets/img/lock.svg @@ -11,4 +11,4 @@ - \ No newline at end of file + diff --git a/src/assets/styles/main.scss b/src/assets/styles/main.scss index b5cc7a9..0b8eed6 100644 --- a/src/assets/styles/main.scss +++ b/src/assets/styles/main.scss @@ -328,3 +328,21 @@ .ant-form-item .ant-input{ background-color: transparent } + + +.account-lock{ + .lock-img-hover{ + display: none + } + .lock-img{ + display: block + } + &:hover{ + .lock-img{ + display: none + } + .lock-img-hover{ + display: block + } + } +} diff --git a/src/components/Lock/AccountLock.js b/src/components/Lock/AccountLock.js index ef09b69..e306f36 100644 --- a/src/components/Lock/AccountLock.js +++ b/src/components/Lock/AccountLock.js @@ -29,9 +29,11 @@ const AccountLock = () => { }, [theme]); return ( - ); }; diff --git a/src/components/Login/Endpoint.js b/src/components/Login/Endpoint.js index b268cfa..a304b95 100644 --- a/src/components/Login/Endpoint.js +++ b/src/components/Login/Endpoint.js @@ -1,28 +1,16 @@ -import React, { useContext,useState ,useRef,useEffect} from 'react'; -import { mainContext } from 'reducer'; -import { Dropdown, Menu } from 'antd'; -import themeStyle from 'utils/themeStyle.js'; +import React, {useState ,useRef,useEffect} from 'react'; import { QuestionCircleOutlined } from '@ant-design/icons'; import Emitter from 'utils/eventBus'; - -import { nodeStatusCheck, getPrivateKey, getRepo, setApiUrl } from 'services/otherService.js'; import { urlCheck } from 'utils/checks.js'; - import { Tooltip } from 'antd'; -import { Truncate } from 'utils/text.js'; import { t } from 'utils/text.js'; -import ClipboardCopy from 'components/Utils/ClipboardCopy'; const Endpoint = ({ color }) => { - // const { dispatch, state } = useContext(mainContext); - // const { account } = state; const inputRef = useRef(null); - const { dispatch, state } = useContext(mainContext); const [endpoint, setEndpoint] = useState(''); - const [loading, setLoading] = useState(false); const getEndpoint = ()=>{ @@ -31,7 +19,6 @@ const Endpoint = ({ color }) => { if(NODE_URL){ inputRef.current.value = NODE_URL; } - // const isMainMode = await getPageMode(); } const getNodeUrl = () => { @@ -46,28 +33,11 @@ const Endpoint = ({ color }) => { }; const save = async (e, wallet) => { - const node_url2 = getNodeUrl(); - Emitter.emit('handleEndpoint', node_url2); - return + e.preventDefault(); + e.stopPropagation(); const node_url = getNodeUrl(); if (!node_url) return; - let result = await nodeStatusCheck(node_url); - if (result) { - window.nodeStatus = true; - dispatch({ - type: 'SET_NODE_STATUS', - nodeStatus: true, - }); - // getPath(); - // Emitter.emit('showMessageAlert', { message: 'setting_success', status: 'success', type: 'frontEnd' }); - // Emitter.emit('getHostId') - Emitter.emit('handleEndpoint', node_url); - } else { - // setPath(''); - // Emitter.emit('showMessageAlert', { message: 'setting_error', status: 'error', type: 'frontEnd' }); - } - // Emitter.emit('handleEndpoint', {}); - // Emitter.emit('handleEndpoint', { checked, parentIndex, childIndex }); + Emitter.emit('handleEndpoint', node_url); }; const handleChange = (e) => { @@ -96,10 +66,11 @@ const Endpoint = ({ color }) => {