Skip to content

Commit

Permalink
fix: css
Browse files Browse the repository at this point in the history
  • Loading branch information
lulu-tro committed Sep 5, 2024
1 parent efe5758 commit c8988e0
Show file tree
Hide file tree
Showing 12 changed files with 248 additions and 156 deletions.
2 changes: 1 addition & 1 deletion src/APIClient/APIClient10.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ class APIClient10 {
return this.request(`/api/v1/dashboard/change?arg=${arg}&arg=${newpassword}&token=${token}`);
}
resetLoginPassword(privateKey, password){
return this.request(`/api/v1/dashboard/reset??arg=${privateKey}&arg=${password}`);
return this.request(`/api/v1/dashboard/reset?arg=${privateKey}&arg=${password}`);
}
logout(){
return this.request(`/api/v1/dashboard/logout`);
Expand Down
Binary file added src/assets/img/success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 31 additions & 2 deletions src/assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@

}

.dark .login-bg {
// background:;
// background: #161921 url(../img/background.png) no-repeat right;
// background-size: contain;

}

.login-form{
padding-left: 5.5rem;
}
Expand Down Expand Up @@ -317,16 +324,21 @@
min-width: 334px;

}
.login-form-w-334px{
width: 334px;

}
.login-btn{
min-width: 155px;
font-size: 14px;
font-weight: bold;
}


.ant-form-item .ant-input{
background-color: transparent
.dark .ant-form-item .ant-input, .dark .ant-input-affix-wrapper{
background-color: transparent !important;
color: #fff;
border-color: #21242c;
}


Expand Down Expand Up @@ -356,3 +368,20 @@
opacity: 0.99;

}


@media (max-width: 768px) {
.login-bg {
display: none;
}
.login-form {
width: 100vw;
padding-left: 0;
justify-content: center;
}
.login-form-w{
max-width: 100%;
padding: 0 20px;
}

}
18 changes: 17 additions & 1 deletion src/assets/styles/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -1892,14 +1892,20 @@ video {
padding-bottom: 0px;
}

.pr-1 {
padding-right: 0.25rem;
}

.pl-0 {
padding-left: 0px;
}

.pt-2 {
padding-top: 0.5rem;
}

.pb-1 {
padding-bottom: 0.25rem;
}
.pb-2 {
padding-bottom: 0.5rem;
}
Expand Down Expand Up @@ -1931,11 +1937,18 @@ video {
.pr-8 {
padding-right: 2rem;
}
.pl-8 {
padding-left: 2rem;
}

.pr-12 {
padding-right: 3rem;
}

.pl-12 {
padding-left: 3rem;
}

.pb-12 {
padding-bottom: 3rem;
}
Expand Down Expand Up @@ -2288,6 +2301,9 @@ video {
.md\:justify-start {
justify-content: flex-start;
}
.md\:justify-center {
justify-content: center;
}

.md\:justify-end {
justify-content: flex-end;
Expand Down
10 changes: 5 additions & 5 deletions src/components/Login/Endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,24 @@ const Endpoint = ({ color }) => {
}, []);

return (
<div className="flex flex-col justify-center max-w-515px">
<div className="flex flex-col max-w-515px justify-center ">
<div className=" min-h-400">
<div className="login-title">{t('login')}</div>
<div className="text-gray-900 text-sm font-bold mb-12">
<div className="login-title theme-text-main">{t('login')}</div>
<div className="text-gray-900 text-sm font-bold mb-12 theme-text-sub-main">
{t('login_endpoint_desc')}
</div>
<div className="mb-2 setting-header">
<h5 className="font-bold theme-text-main" htmlFor="grid-password">
API {t('endpoint')}
</h5>
<Tooltip overlayInnerStyle={{ width: '180px' }} placement="top" title={<p>{t('copy_url_tips')}</p>}>
<Tooltip overlayInnerStyle={{ width: '340px' }} placement="top" title={<p>{t('copy_url_tips')}</p>}>
{/* <i className="far fa-question-circle ml-1 text-xs"></i> */}
<QuestionCircleOutlined className="inline-flex items-center ml-1 text-xs" />
</Tooltip>
</div>
<input
type="text"
className="mr-2 common-input theme-border-color"
className="mr-2 common-input theme-bg theme-border-color theme-text-main"
defaultValue="http://localhost:5001"
ref={inputRef}
// onChange={handleChange}
Expand Down
11 changes: 5 additions & 6 deletions src/components/Login/PasswordLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,22 @@ const PasswordLogin = ({ color, endpoint }) => {
}, [isLock]);

return (
<div className="flex flex-col justify-center max-w-515px min-w-334px">
<div className="flex flex-col justify-center max-w-515px min-w-334px login-form-w ">
<div className="min-h-400">
<div className="login-title mb-12"><span onClick={backPrevious} className='cursor-pointer pr-2'><ArrowLeftOutlined style={{ fontSize: 20 }} className='align-middle' /></span>{t('login_title')}</div>

<div className="login-title mb-12 theme-text-main"><span onClick={backPrevious} className='cursor-pointer pr-2'><ArrowLeftOutlined style={{ fontSize: 20 }} className='align-middle' /></span>{t('login_title')}</div>
<Form
name="basic"
layout="vertical"
form={form}
requiredMark={false}
labelCol={{ span: 24 }}
// labelCol={{ span: 24 }}
initialValues={{ endpoint }}
onFinish={onFinish}
autoComplete="off">
<Form.Item
label={<div className="font-bold theme-text-main">API {t('endpoint')}</div>}
name="endpoint">
<Input className="mr-2 common-input theme-bg theme-border-color" disabled />
<Input className="mr-2 common-input theme-text-desc theme-base-bg border-none" disabled />
</Form.Item>

<Form.Item
Expand All @@ -105,7 +104,7 @@ const PasswordLogin = ({ color, endpoint }) => {
<Input.Password

placeholder={intl.formatMessage({ id: 'enter_password_placeholder' })}
className="mr-2 common-input theme-bg theme-border-color" />
className="mr-2 common-input theme-bg theme-border-color theme-text-main" />
</Form.Item>
<div className="flex justify-between w-full mt-2 ml-1 ">
<span className="theme-text-error text-xs pt-1">{validateMsg}</span>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Login/SetPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ const Endpoint = ({ endpoint, isReset }) => {
}

return (
<div className="flex flex-col justify-center max-w-515px">
<div className="flex flex-col justify-center max-w-515px login-form-w">
<div className=" min-h-400">
<div className="login-title"><span onClick={backPrevious} className='cursor-pointer pr-2'><ArrowLeftOutlined style={{ fontSize: 20 }} className='align-middle' /></span>{t('set_login_password')}</div>
<div className="login-title theme-text-main"><span onClick={backPrevious} className='cursor-pointer pr-2'><ArrowLeftOutlined style={{ fontSize: 20 }} className='align-middle' /></span>{t('set_login_password')}</div>
<div className="text-gray-900 text-sm font-bold mb-12">{t('set_login_password_desc')}</div>

<Form
Expand All @@ -100,7 +100,7 @@ const Endpoint = ({ endpoint, isReset }) => {
<Form.Item
label={<div className="font-bold theme-text-main">API {t('endpoint')}</div>}
name="endpoint">
<Input className="mr-2 common-input theme-bg theme-border-color" disabled />
<Input className="mr-2 common-input theme-text-desc theme-base-bg border-none " disabled />
</Form.Item>
{isReset && (
<Form.Item
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modals/ChangePasswordModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function ChangePasswordModal({ color }) {
};
const validateNewPassword = (rules, value, callback) => {
let oldpassword = form.getFieldValue('oldpassword');
if (oldpassword === value) {
if (oldpassword && oldpassword === value) {
callback(new Error(intl.formatMessage({ id: 'same_as_old_password' })));
} else {
callback();
Expand Down Expand Up @@ -135,7 +135,7 @@ export default function ChangePasswordModal({ color }) {
}
name="password"
rules={[
{ required: true, message: t('private_key_validate_required') },
{ required: true, message: t('password_validate_required') },
{
pattern: /^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z\d]{8,}$/,
message: t('password_validate_pattern'),
Expand Down
21 changes: 14 additions & 7 deletions src/components/Modals/EncryptFileCidModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useIntl } from 'react-intl';
import { mainContext } from 'reducer';

export default function EncryptFileModal({ color }) {
const [showModal, setShowModal] = useState(true);
const [showModal, setShowModal] = useState(false);
const [cid, setCid] = useState('');

const intl = useIntl();
Expand Down Expand Up @@ -49,12 +49,19 @@ export default function EncryptFileModal({ color }) {
<CommonModal visible={showModal} maskClosable={false} onCancel={closeModal}>
<div className="common-modal-wrapper theme-bg">
<main className="flex flex-col justify-center items-center theme-bg theme-text-main">
<img
alt=""
src={require(`../../assets/img/encrypt.png`).default}
className="mb-4"
width={43}
/>
<div className="mb-4 relative pr-1 pb-1">
<img
alt=""
src={require(`../../assets/img/encrypt.png`).default}
width={43}
/>
<img
alt=""
className="absolute bottom-0 right-0"
src={require(`../../assets/img/success.png`).default}
width={22}
/>
</div>
<div className="font-semibold text-xl mb-2"> {t('encrypt_file_cid_title')} </div>
<div className="text-xs font-medium mb-4 theme-text-sub-info">
{t('encrypt_file_cid_desc')}
Expand Down
116 changes: 55 additions & 61 deletions src/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,68 +423,62 @@ const en_US = {


//v3.1
dncrypt_file_time_out:'文件获取超时时间',
dncrypt_file_time_out_desc:'设置超时时间以避免长时间等待,更长的超时时间可以增加文件获取的成功率',
seconds_30:'30秒',
minutes_1:'1分钟',
minutes_3:'3分钟',
minutes_5:'5分钟',
minutes_10:'10分钟',
dncrypt_file_time_out: "File acquisition timeout",
dncrypt_file_time_out_desc: "Set a timeout period to avoid long waits. A longer timeout may increase the success rate of file acquisition",
seconds_30: "30 seconds",
minutes_1: "1 minute",
minutes_3: "3 minutes",
minutes_5: "5 minutes",
minutes_10: "10 minutes",

file_cid: "CID",
file_create: "Created",
file_isencrypted: "Is Encrypted",
file_encrypted: "Encrypted",

login: "Login",
login_endpoint_desc: "Enter a local or remote API Endpoint to continue",
set_login_password: "Set login password",
set_login_password_desc: "When logging in to the node for the first time, please set a login password to protect the node’s data and private key",
reset_login_password: "Reset login password",
reset_login_password_desc: "BTFS does not save the password. If you forget your login password, you can use the node’s private key to reset it",
enter_private_key: "Please enter the node private key",
login_password: "login password",
lost_password: "Forgot password?",
enter_password: "Set login password",
enter_password_desc: "A combination of letters and numbers with more than 8 characters",
re_enter_password: "Re-enter password",
login_title: "Welcome back",
login_lock_message: "Too many failed attempts. The operation has been locked. Please try again in 10 minutes",

reset_password_private_key_placeholder: "Please enter in hexadecimal private key format",
re_enter_password_placeholder: "Re-enter password",
enter_password_placeholder: "Please enter password",

check_private_key: "View private key",
check_private_key_desc: "The private key provides full access to your node and assets. Please ensure that the private key is not leaked to others.",
check_private_key_input: "Enter login password to continue.",
check_private_key_input_placeholder: "Please enter password.",

setting_login_password: "Login password",
setting_login_password_btn: "Change password",
change_password_modal: "Change login password",
enter_old_password: "Enter old password",
enter_old_password_placeholder: "Please enter old password",
change_password_success: "Password changed successfully",
change_password_fail: "Password change failed",
password_error: "Password error",
same_as_old_password: "The new password cannot be the same as the old password.",
// Validate

password_validate_required: "Please enter password",
password_validate_pattern: "At least 8 characters, including at least 1 lowercase letter and 1 number",
password_re_enter_validate_pattern: "Passwords do not match",
private_key_validate_required: "Please enter private key",
private_key_validate_pattern: "Please enter hexadecimal private key",

logout: "Logout",

file_cid:'CID',
file_create:'Created',
file_isencrypted:'Is Encrypted',

file_encrypted:'Encrypted',



login:'Login',
login_endpoint_desc:'Please set a login password when loghe node data and private key security',
set_login_password:'设置登录密码',
set_login_password_desc:'设置登录密码描述',
reset_login_password:'重置登录密码',
reset_login_password_desc:'重置登录密码描述',
enter_private_key:'请输入节点私钥',
login_password:'login password',
lost_password:'Lost password?',
enter_password:'Set a login password ',
enter_password_desc:'(a combination of letters and numbers larger than 8 characters)',
re_enter_password:'Re-enter password',
login_title:'欢迎回来',
login_lock_message:'操作已被锁定,请十分钟后再试',

reset_password_private_key_placeholder:'请输入以16进制的私钥格式',
re_enter_password_placeholder:'Re-enter your password',
enter_password_placeholder:'Enter your password',



check_private_key:'查看私钥',
check_private_key_desc:'私钥提供了对您节点和资产的完整访问权限 请确保私钥不会泄露给其他人',
check_private_key_input:'输入登录密码以继续',
check_private_key_input_placeholder:'Enter your password',


setting_login_password:'Login Password',
setting_login_password_btn:'Change Password ',
change_password_modal:'修改登录密码',
enter_old_password:'输入旧密码',
enter_old_password_placeholder:'请输入旧密码',
change_password_success:'密码修改成功',
change_password_fail:'密码修改失败',
password_error:'密码错误',
same_as_old_password:'新密码不能与旧密码相同',



password_validate_required:'请输入密码',
password_validate_pattern:'至少8个字符,至少1个小写字母和1个数字',
password_re_enter_validate_pattern:'输入密码不一致',
private_key_validate_required:'请输入私钥',
private_key_validate_pattern:'请输入16进制私钥',

logout:'退出登录',


};
Expand Down
Loading

0 comments on commit c8988e0

Please sign in to comment.