chore: update agreements, fix some issue dashbaord

This commit is contained in:
haitao(lj) 2022-11-19 13:39:37 +08:00
parent 77b53e583d
commit d7de1f2468
9 changed files with 85 additions and 34 deletions

View File

@ -571,7 +571,7 @@ ui:
character: '用户名只能由 "a-z", "0-9", " - . _" 组成' character: '用户名只能由 "a-z", "0-9", " - . _" 组成'
avatar: avatar:
label: 头像 label: 头像
text: 您可以上传图片作为头像,也可以 <1>重置</1> 为 text: 您可以上传图片作为头像
bio: bio:
label: 关于我 (可选) label: 关于我 (可选)
website: website:

View File

@ -33,6 +33,7 @@
"react-helmet-async": "^1.3.0", "react-helmet-async": "^1.3.0",
"react-i18next": "^11.18.3", "react-i18next": "^11.18.3",
"react-router-dom": "^6.4.0", "react-router-dom": "^6.4.0",
"semver": "^7.3.8",
"swr": "^1.3.0", "swr": "^1.3.0",
"zustand": "^4.1.1" "zustand": "^4.1.1"
}, },

View File

@ -59,6 +59,7 @@ specifiers:
react-router-dom: ^6.4.0 react-router-dom: ^6.4.0
react-scripts: 5.0.1 react-scripts: 5.0.1
sass: ^1.54.4 sass: ^1.54.4
semver: ^7.3.8
swr: ^1.3.0 swr: ^1.3.0
typescript: ^4.8.3 typescript: ^4.8.3
yaml-loader: ^0.8.0 yaml-loader: ^0.8.0
@ -86,6 +87,7 @@ dependencies:
react-helmet-async: 1.3.0_biqbaboplfbrettd7655fr4n2y react-helmet-async: 1.3.0_biqbaboplfbrettd7655fr4n2y
react-i18next: 11.18.6_ulhmqqxshznzmtuvahdi5nasbq react-i18next: 11.18.6_ulhmqqxshznzmtuvahdi5nasbq
react-router-dom: 6.4.0_biqbaboplfbrettd7655fr4n2y react-router-dom: 6.4.0_biqbaboplfbrettd7655fr4n2y
semver: 7.3.8
swr: 1.3.0_react@18.2.0 swr: 1.3.0_react@18.2.0
zustand: 4.1.1_react@18.2.0 zustand: 4.1.1_react@18.2.0
@ -1480,7 +1482,7 @@ packages:
cosmiconfig-typescript-loader: 4.1.0_3owiowz3ujipd4k6pbqn3n7oui cosmiconfig-typescript-loader: 4.1.0_3owiowz3ujipd4k6pbqn3n7oui
lodash: 4.17.21 lodash: 4.17.21
resolve-from: 5.0.0 resolve-from: 5.0.0
ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra ts-node: 10.9.1_ck2axrxkiif44rdbzjywaqjysa
typescript: 4.8.3 typescript: 4.8.3
transitivePeerDependencies: transitivePeerDependencies:
- '@swc/core' - '@swc/core'
@ -2667,7 +2669,7 @@ packages:
eslint: 8.23.1 eslint: 8.23.1
ignore: 5.2.0 ignore: 5.2.0
regexpp: 3.2.0 regexpp: 3.2.0
semver: 7.3.7 semver: 7.3.8
tsutils: 3.21.0_typescript@4.8.3 tsutils: 3.21.0_typescript@4.8.3
typescript: 4.8.3 typescript: 4.8.3
transitivePeerDependencies: transitivePeerDependencies:
@ -2748,7 +2750,7 @@ packages:
debug: 4.3.4 debug: 4.3.4
globby: 11.1.0 globby: 11.1.0
is-glob: 4.0.3 is-glob: 4.0.3
semver: 7.3.7 semver: 7.3.8
tsutils: 3.21.0_typescript@4.8.3 tsutils: 3.21.0_typescript@4.8.3
typescript: 4.8.3 typescript: 4.8.3
transitivePeerDependencies: transitivePeerDependencies:
@ -3472,7 +3474,7 @@ packages:
/builtins/5.0.1: /builtins/5.0.1:
resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==}
dependencies: dependencies:
semver: 7.3.7 semver: 7.3.8
dev: true dev: true
/bytes/3.0.0: /bytes/3.0.0:
@ -3821,7 +3823,7 @@ packages:
dependencies: dependencies:
'@types/node': 14.18.29 '@types/node': 14.18.29
cosmiconfig: 7.0.1 cosmiconfig: 7.0.1
ts-node: 10.9.1_ao52im6kiihokc7tdj7weudhra ts-node: 10.9.1_ck2axrxkiif44rdbzjywaqjysa
typescript: 4.8.3 typescript: 4.8.3
dev: true dev: true
@ -3905,7 +3907,7 @@ packages:
postcss-modules-scope: 3.0.0_postcss@8.4.16 postcss-modules-scope: 3.0.0_postcss@8.4.16
postcss-modules-values: 4.0.0_postcss@8.4.16 postcss-modules-values: 4.0.0_postcss@8.4.16
postcss-value-parser: 4.2.0 postcss-value-parser: 4.2.0
semver: 7.3.7 semver: 7.3.8
webpack: 5.74.0 webpack: 5.74.0
/css-minimizer-webpack-plugin/3.4.1_webpack@5.74.0: /css-minimizer-webpack-plugin/3.4.1_webpack@5.74.0:
@ -5272,7 +5274,7 @@ packages:
is-core-module: 2.10.0 is-core-module: 2.10.0
minimatch: 3.1.2 minimatch: 3.1.2
resolve: 1.22.1 resolve: 1.22.1
semver: 7.3.7 semver: 7.3.8
dev: true dev: true
/eslint-plugin-prettier/4.2.1_cabrci5exjdaojcvd6xoxgeowu: /eslint-plugin-prettier/4.2.1_cabrci5exjdaojcvd6xoxgeowu:
@ -5736,7 +5738,7 @@ packages:
memfs: 3.4.7 memfs: 3.4.7
minimatch: 3.1.2 minimatch: 3.1.2
schema-utils: 2.7.0 schema-utils: 2.7.0
semver: 7.3.7 semver: 7.3.8
tapable: 1.1.3 tapable: 1.1.3
typescript: 4.8.3 typescript: 4.8.3
webpack: 5.74.0 webpack: 5.74.0
@ -6908,7 +6910,7 @@ packages:
jest-util: 27.5.1 jest-util: 27.5.1
natural-compare: 1.4.0 natural-compare: 1.4.0
pretty-format: 27.5.1 pretty-format: 27.5.1
semver: 7.3.7 semver: 7.3.8
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -7615,7 +7617,7 @@ packages:
dependencies: dependencies:
hosted-git-info: 4.1.0 hosted-git-info: 4.1.0
is-core-module: 2.10.0 is-core-module: 2.10.0
semver: 7.3.7 semver: 7.3.8
validate-npm-package-license: 3.0.4 validate-npm-package-license: 3.0.4
dev: true dev: true
@ -8219,7 +8221,7 @@ packages:
cosmiconfig: 7.0.1 cosmiconfig: 7.0.1
klona: 2.0.5 klona: 2.0.5
postcss: 8.4.16 postcss: 8.4.16
semver: 7.3.7 semver: 7.3.8
webpack: 5.74.0 webpack: 5.74.0
/postcss-logical/5.0.4_postcss@8.4.16: /postcss-logical/5.0.4_postcss@8.4.16:
@ -9044,7 +9046,7 @@ packages:
resolve: 1.22.1 resolve: 1.22.1
resolve-url-loader: 4.0.0 resolve-url-loader: 4.0.0
sass-loader: 12.6.0_sass@1.54.9+webpack@5.74.0 sass-loader: 12.6.0_sass@1.54.9+webpack@5.74.0
semver: 7.3.7 semver: 7.3.8
source-map-loader: 3.0.1_webpack@5.74.0 source-map-loader: 3.0.1_webpack@5.74.0
style-loader: 3.3.1_webpack@5.74.0 style-loader: 3.3.1_webpack@5.74.0
tailwindcss: 3.1.8_57znarxsqwmnneadci5z5fd5gu tailwindcss: 3.1.8_57znarxsqwmnneadci5z5fd5gu
@ -9491,6 +9493,14 @@ packages:
hasBin: true hasBin: true
dependencies: dependencies:
lru-cache: 6.0.0 lru-cache: 6.0.0
dev: true
/semver/7.3.8:
resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==}
engines: {node: '>=10'}
hasBin: true
dependencies:
lru-cache: 6.0.0
/send/0.18.0: /send/0.18.0:
resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==}
@ -10186,6 +10196,37 @@ packages:
v8-compile-cache-lib: 3.0.1 v8-compile-cache-lib: 3.0.1
yn: 3.1.1 yn: 3.1.1
/ts-node/10.9.1_ck2axrxkiif44rdbzjywaqjysa:
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
hasBin: true
peerDependencies:
'@swc/core': '>=1.2.50'
'@swc/wasm': '>=1.2.50'
'@types/node': '*'
typescript: '>=2.7'
peerDependenciesMeta:
'@swc/core':
optional: true
'@swc/wasm':
optional: true
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.9
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.3
'@types/node': 14.18.29
acorn: 8.8.0
acorn-walk: 8.2.0
arg: 4.1.3
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 4.8.3
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
dev: true
/tsconfig-paths/3.14.1: /tsconfig-paths/3.14.1:
resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==} resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==}
dependencies: dependencies:

View File

@ -3,6 +3,8 @@ import { Card, Row, Col, Badge } from 'react-bootstrap';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { gt, gte } from 'semver';
import type * as Type from '@/common/interface'; import type * as Type from '@/common/interface';
interface IProps { interface IProps {
@ -12,7 +14,12 @@ interface IProps {
const HealthStatus: FC<IProps> = ({ data }) => { const HealthStatus: FC<IProps> = ({ data }) => {
const { t } = useTranslation('translation', { keyPrefix: 'admin.dashboard' }); const { t } = useTranslation('translation', { keyPrefix: 'admin.dashboard' });
const { version, remote_version } = data.version_info || {}; const { version, remote_version } = data.version_info || {};
const isLatest = version === remote_version; let isLatest = false;
let hasNewerVersion = false;
if (version && remote_version) {
isLatest = gte(version, remote_version);
hasNewerVersion = gt(remote_version, version);
}
return ( return (
<Card className="mb-4"> <Card className="mb-4">
<Card.Body> <Card.Body>
@ -32,7 +39,7 @@ const HealthStatus: FC<IProps> = ({ data }) => {
{t('latest')} {t('latest')}
</Badge> </Badge>
)} )}
{!isLatest && remote_version && ( {!isLatest && hasNewerVersion && (
<Badge <Badge
pill pill
bg="warning" bg="warning"

View File

@ -23,7 +23,7 @@ const Index: FC = () => {
return ( return (
<> <>
<PageTitle title={t('privacy')} /> <PageTitle title={t('privacy')} />
<h3>{t('privacy')}</h3> <h3 className="mb-4">{t('privacy')}</h3>
<div <div
className="fmt" className="fmt"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{

View File

@ -22,7 +22,7 @@ const Index: FC = () => {
return ( return (
<> <>
<PageTitle title={t('tos')} /> <PageTitle title={t('tos')} />
<h3>{t('tos')}</h3> <h3 className="mb-4">{t('tos')}</h3>
<div <div
className="fmt" className="fmt"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{

View File

@ -1,4 +0,0 @@
.sub-container {
padding-top: 2rem;
padding-bottom: 2rem;
}

View File

@ -1,20 +1,27 @@
import { FC } from 'react'; import { FC } from 'react';
import { Container, Row, Col } from 'react-bootstrap'; import { Container, Row, Col, Nav } from 'react-bootstrap';
import { Outlet } from 'react-router-dom'; import { Outlet, NavLink } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { AccordionNav } from '@/components';
import { ADMIN_LEGAL_MENUS } from '@/common/constants';
import './index.scss';
const Index: FC = () => { const Index: FC = () => {
const { t } = useTranslation('translation', { keyPrefix: 'nav_menus' });
return ( return (
<Container className="sub-container"> <Container className="pt-4 mt-2 mb-5">
<Row> <Row className="justify-content-center">
<Col lg={2}> <Col xxl={12} sm={10} xs={10}>
<AccordionNav menus={ADMIN_LEGAL_MENUS} /> <Nav
className="mb-4 flex-nowrap"
variant="pills"
style={{ overflow: 'auto' }}>
<NavLink to="/tos" key="tos" className="nav-link">
{t('tos')}
</NavLink>
<NavLink to="/privacy" key="privacy" className="nav-link">
{t('privacy')}
</NavLink>
</Nav>
</Col> </Col>
<Col lg={6}> <Col xxl={12} sm={10} xs={10}>
<Outlet /> <Outlet />
</Col> </Col>
</Row> </Row>

View File

@ -196,7 +196,6 @@ const Index: React.FC = () => {
if (res.e_mail) { if (res.e_mail) {
const str = res.e_mail.toLowerCase().trim(); const str = res.e_mail.toLowerCase().trim();
const hash = MD5(str); const hash = MD5(str);
console.log(str, hash, mailHash);
setMailHash(hash); setMailHash(hash);
} }
}); });