Skip to content

Commit

Permalink
feat: v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Mar 1, 2022
1 parent 9b8ba44 commit b435e39
Show file tree
Hide file tree
Showing 79 changed files with 1,553 additions and 1,019 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"printWidth": 88,
"printWidth": 100,
"endOfLine": "auto"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file.

### v1.4.0 (2022-03-01)

- Add feedback module
- New components `Placeholder` `UniversalText` `IPLocation` `SortSelect`
- Improve antd icons
- Rename `Extend` to `KeyValue`

### v1.3.5 (2022-02-16)

- Add articles calendar in Dashboard
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "veact-admin",
"version": "1.3.7",
"version": "1.4.0",
"author": "Surmon",
"license": "MIT",
"repository": {
Expand Down
54 changes: 48 additions & 6 deletions public/__demo__/mock/comment.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
"site": "https://surmon.me"
},
"ip": "120.344.60.166",
"ip_location": { "city": "广州市", "country": "中国" },
"ip_location": {
"country": "China",
"country_code": "CN",
"region": "Shanghai",
"region_code": "SH",
"city": "Pudong",
"zip": ""
},
"create_at": "2021-08-31T09:21:35.723Z",
"update_at": "2021-08-31T09:21:35.723Z",
"extends": [],
Expand All @@ -41,7 +48,14 @@
"email": "[email protected]"
},
"ip": "120.196.60.166",
"ip_location": { "city": "广州市", "country": "中国" },
"ip_location": {
"country": "China",
"country_code": "CN",
"region": "Zhejiang",
"region_code": "ZJ",
"city": "Hangzhou",
"zip": ""
},
"create_at": "2021-08-31T09:13:16.700Z",
"update_at": "2021-08-31T09:13:16.700Z",
"extends": [],
Expand All @@ -64,7 +78,14 @@
"site": "https://surmon.me"
},
"ip": "113.100.143.202",
"ip_location": { "city": "深圳市", "country": "中国" },
"ip_location": {
"country": "Hong Kong",
"country_code": "HK",
"region": "Central and Western District",
"region_code": "HCW",
"city": "Central",
"zip": "96521"
},
"create_at": "2021-08-26T01:52:35.612Z",
"update_at": "2021-08-26T01:52:35.612Z",
"extends": [],
Expand All @@ -87,7 +108,14 @@
"site": "http://vuejs.org"
},
"ip": "113.100.143.202",
"ip_location": { "city": "深圳市", "country": "中国" },
"ip_location": {
"country": "China",
"country_code": "CN",
"region": "Jiangsu",
"region_code": "JS",
"city": "Changzhou",
"zip": ""
},
"create_at": "2021-08-26T01:31:52.560Z",
"update_at": "2021-08-26T01:31:52.560Z",
"extends": [],
Expand All @@ -110,7 +138,14 @@
"site": "https://www.apple.com"
},
"ip": "42.120.73.191",
"ip_location": { "city": "杭州市", "country": "中国" },
"ip_location": {
"country": "China",
"country_code": "CN",
"region": "Shaanxi",
"region_code": "SN",
"city": "Xi'an",
"zip": ""
},
"create_at": "2021-08-24T09:29:28.392Z",
"update_at": "2021-08-24T09:29:28.392Z",
"extends": [],
Expand All @@ -133,7 +168,14 @@
"site": "https://www.baidu.com/"
},
"ip": "101.40.101.190",
"ip_location": { "city": "北京市", "country": "中国" },
"ip_location": {
"country": "United States",
"country_code": "US",
"region": "Nevada",
"region_code": "NV",
"city": "Minden",
"zip": "89423"
},
"create_at": "2021-08-14T18:45:43.617Z",
"update_at": "2021-08-14T18:45:43.617Z",
"extends": [],
Expand Down
3 changes: 2 additions & 1 deletion public/__demo__/mock/expansion/statistic.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"comments": 2060,
"totalViews": 574127,
"totalLikes": 4896,
"todayViews": 17
"todayViews": 17,
"averageEmotion": 4.89
}
}
50 changes: 11 additions & 39 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
*/

import React from 'react'
import {
BrowserRouter,
HashRouter,
Route,
Routes,
Navigate,
Outlet,
} from 'react-router-dom'
import { BrowserRouter, HashRouter, Route, Routes, Navigate, Outlet } from 'react-router-dom'
import { onMounted, useReactivity } from 'veact'
import LoadingBar from 'react-top-loading-bar'
import 'moment/locale/zh-cn'
Expand All @@ -29,6 +22,7 @@ import { AnnouncementPage } from '@/pages/Announcement'
import { CategoryPage } from '@/pages/Category'
import { TagPage } from '@/pages/Tag'
import { CommentPage } from '@/pages/Comment'
import { FeedbackPage } from '@/pages/Feedback'
import { DisqusThreadsPage } from '@/pages/Dsiqus/Thread'
import { DisqusPostsPage } from '@/pages/Dsiqus/Post'
import { DisqusSynchronizePage } from '@/pages/Dsiqus/Synchronize'
Expand Down Expand Up @@ -77,18 +71,13 @@ export const App: React.FC = () => {
</AppAuth>
}
>
<Route
index={true}
element={<Navigate to={rc(RouteKey.Dashboard).path} replace />}
/>
<Route index={true} element={<Navigate to={rc(RouteKey.Dashboard).path} replace />} />
<Route path={rc(RouteKey.Dashboard).path} element={<DashboardPage />} />
<Route
path={rc(RouteKey.Announcement).path}
element={<AnnouncementPage />}
/>
<Route path={rc(RouteKey.Announcement).path} element={<AnnouncementPage />} />
<Route path={rc(RouteKey.Category).path} element={<CategoryPage />} />
<Route path={rc(RouteKey.Tag).path} element={<TagPage />} />
<Route path={rc(RouteKey.Comment).path} element={<CommentPage />} />
<Route path={rc(RouteKey.Feedback).path} element={<FeedbackPage />} />
<Route path={rc(RouteKey.Profile).path} element={<ProfilePage />} />
<Route
path={`${rc(RouteKey.Disqus).path}/*`}
Expand All @@ -98,14 +87,8 @@ export const App: React.FC = () => {
index={true}
element={<Navigate to={rc(RouteKey.DisqusPost).subPath!} replace />}
/>
<Route
path={rc(RouteKey.DisqusPost).subPath}
element={<DisqusPostsPage />}
/>
<Route
path={rc(RouteKey.DisqusThread).subPath}
element={<DisqusThreadsPage />}
/>
<Route path={rc(RouteKey.DisqusPost).subPath} element={<DisqusPostsPage />} />
<Route path={rc(RouteKey.DisqusThread).subPath} element={<DisqusThreadsPage />} />
<Route
path={rc(RouteKey.DisqusSync).subPath}
element={<DisqusSynchronizePage />}
Expand All @@ -123,22 +106,11 @@ export const App: React.FC = () => {
<Routes>
<Route
index={true}
element={
<Navigate to={rc(RouteKey.ArticleList).subPath!} replace />
}
/>
<Route
path={rc(RouteKey.ArticleList).subPath}
element={<ArticleList />}
/>
<Route
path={rc(RouteKey.ArticlePost).subPath}
element={<ArticleCreate />}
/>
<Route
path={rc(RouteKey.ArticleEdit).subPath}
element={<ArticleEdit />}
element={<Navigate to={rc(RouteKey.ArticleList).subPath!} replace />}
/>
<Route path={rc(RouteKey.ArticleList).subPath} element={<ArticleList />} />
<Route path={rc(RouteKey.ArticlePost).subPath} element={<ArticleCreate />} />
<Route path={rc(RouteKey.ArticleEdit).subPath} element={<ArticleEdit />} />
<Route
path="*"
element={<Navigate to={rc(RouteKey.ArticleList).path} replace />}
Expand Down
11 changes: 3 additions & 8 deletions src/components/AppLayout/Content.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { useLocation, matchPath } from 'react-router-dom'
import { Breadcrumb, BackTop, Typography } from 'antd'
import { CaretUpOutlined } from '@ant-design/icons'
import * as Icon from '@ant-design/icons'
import { scrollTo } from '@/services/scroller'
import { routeMap } from '@/routes'
import { PageHeaderAD } from './PageAD'
Expand Down Expand Up @@ -30,14 +30,9 @@ export const AppContent: React.FC = (props) => {
</div>
<PageHeaderAD />
<div className={styles.pageContent}>{props?.children}</div>
<BackTop
className={styles.backTop}
onClick={() => {
scrollTo(document.body)
}}
>
<BackTop className={styles.backTop} onClick={() => scrollTo(document.body)}>
<div className={styles.tigger}>
<CaretUpOutlined />
<Icon.CaretUpOutlined />
</div>
</BackTop>
</div>
Expand Down
21 changes: 5 additions & 16 deletions src/components/AppLayout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import React from 'react'
import { useNavigate } from 'react-router-dom'
import { Menu, Dropdown, Avatar, Button, Modal, Spin } from 'antd'
import {
LogoutOutlined,
SettingOutlined,
UserOutlined,
MenuUnfoldOutlined,
MenuFoldOutlined,
} from '@ant-design/icons'
import * as Icon from '@ant-design/icons'

import { RouteKey, rc } from '@/routes'
import { removeToken } from '@/services/token'
Expand Down Expand Up @@ -46,7 +40,7 @@ export const AppHeader: React.FC<AppHeaderProps> = (props) => {
type="link"
onClick={props.onToggleSider}
icon={React.createElement(
props.isSiderCollapsed ? MenuUnfoldOutlined : MenuFoldOutlined,
props.isSiderCollapsed ? Icon.MenuUnfoldOutlined : Icon.MenuFoldOutlined,
{
className: 'trigger',
}
Expand All @@ -60,19 +54,14 @@ export const AppHeader: React.FC<AppHeaderProps> = (props) => {
overlay={
<Menu>
<Menu.Item
icon={<SettingOutlined />}
icon={<Icon.SettingOutlined />}
key="profile"
onClick={redriectToProfileRoute}
>
系统设置
</Menu.Item>
<Menu.Divider />
<Menu.Item
icon={<LogoutOutlined />}
onClick={logout}
key="logout"
danger
>
<Menu.Item icon={<Icon.LogoutOutlined />} onClick={logout} key="logout" danger>
退出登录
</Menu.Item>
</Menu>
Expand All @@ -83,7 +72,7 @@ export const AppHeader: React.FC<AppHeaderProps> = (props) => {
<Avatar
shape="square"
size="small"
icon={<UserOutlined />}
icon={<Icon.UserOutlined />}
className={styles.avatar}
src={admin.data.avatar}
/>
Expand Down
11 changes: 3 additions & 8 deletions src/components/AppLayout/PageAD.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { onMounted, useRef } from 'veact'
import { Button } from 'antd'
import { CloseOutlined } from '@ant-design/icons'
import * as Icon from '@ant-design/icons'
import { ENABLED_AD } from '@/config'

import styles from './style.module.less'
Expand All @@ -27,13 +27,8 @@ export const PageHeaderAD: React.FC = () => {
data-ad-client="ca-pub-4710915636313788"
data-ad-slot="5883149084"
></ins>
<Button
className={styles.closeButton}
size="middle"
type="text"
onClick={closeAD}
>
<CloseOutlined />
<Button className={styles.closeButton} size="middle" type="text" onClick={closeAD}>
<Icon.CloseOutlined />
</Button>
</div>
</div>
Expand Down
Loading

0 comments on commit b435e39

Please sign in to comment.