Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
6c53cf39
Commit
6c53cf39
authored
Oct 20, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: fix lint
parent
464533fe
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
57 additions
and
125 deletions
+57
-125
babel.config.js
babel.config.js
+1
-1
webpack.base.babel.js
internals/webpack/webpack.base.babel.js
+9
-8
webpack.dev.babel.js
internals/webpack/webpack.dev.babel.js
+1
-1
app.js
src/app.js
+1
-1
index.js
src/components/HeaderDropdown/index.js
+1
-4
index.js
src/components/HeaderSearch/index.js
+5
-14
index.js
src/components/NoticeIcon/index.js
+3
-12
configureStore.js
src/configureStore.js
+1
-5
index.js
src/containers/App/index.js
+2
-8
actions.js
src/containers/App/store/actions.js
+1
-6
reducer.js
src/containers/App/store/reducer.js
+10
-14
UserLayout.js
src/layouts/UserLayout.js
+7
-10
Welcome.js
src/pages/Welcome.js
+5
-5
403.js
src/pages/exception/403.js
+3
-9
404.js
src/pages/exception/404.js
+3
-9
LoginItem.js
src/pages/user/login/components/Login/LoginItem.js
+1
-4
LoginSubmit.js
src/pages/user/login/components/Login/LoginSubmit.js
+2
-8
index.js
src/pages/user/login/components/Login/index.js
+1
-6
No files found.
babel.config.js
View file @
6c53cf39
...
@@ -12,7 +12,7 @@ module.exports = {
...
@@ -12,7 +12,7 @@ module.exports = {
'styled-components'
,
'styled-components'
,
'@babel/plugin-proposal-class-properties'
,
'@babel/plugin-proposal-class-properties'
,
'@babel/plugin-syntax-dynamic-import'
,
'@babel/plugin-syntax-dynamic-import'
,
[
'import'
,
{
libraryName
:
'antd'
,
style
:
true
}]
[
'import'
,
{
libraryName
:
'antd'
,
style
:
true
}]
,
],
],
env
:
{
env
:
{
production
:
{
production
:
{
...
...
internals/webpack/webpack.base.babel.js
View file @
6c53cf39
...
@@ -15,7 +15,7 @@ module.exports = options => ({
...
@@ -15,7 +15,7 @@ module.exports = options => ({
module
:
{
module
:
{
rules
:
[
rules
:
[
{
{
test
:
/
\.
jsx
?
$/
,
test
:
/
\.
jsx
?
$/
,
exclude
:
/node_modules/
,
exclude
:
/node_modules/
,
use
:
{
use
:
{
loader
:
'babel-loader'
,
loader
:
'babel-loader'
,
...
@@ -42,7 +42,6 @@ module.exports = options => ({
...
@@ -42,7 +42,6 @@ module.exports = options => ({
loader
:
'css-loader'
,
loader
:
'css-loader'
,
options
:
{
options
:
{
modules
:
{
modules
:
{
// localIdentName: '[name]__[local]___[hash:base64:5]'
// localIdentName: '[name]__[local]___[hash:base64:5]'
// modules: true,
// modules: true,
getLocalIdent
:
(
context
,
_
,
localName
)
=>
{
getLocalIdent
:
(
context
,
_
,
localName
)
=>
{
...
@@ -53,22 +52,24 @@ module.exports = options => ({
...
@@ -53,22 +52,24 @@ module.exports = options => ({
)
{
)
{
return
localName
;
return
localName
;
}
}
const
match
=
context
.
resourcePath
.
match
(
/src
(
.*
)
/
);
const
match
=
context
.
resourcePath
.
match
(
/src
(
.*
)
/
);
if
(
match
&&
match
[
1
])
{
if
(
match
&&
match
[
1
])
{
const
antdProPath
=
match
[
1
].
replace
(
'.less'
,
''
);
const
antdProPath
=
match
[
1
].
replace
(
'.less'
,
''
);
const
arr
=
slash
(
antdProPath
)
const
arr
=
slash
(
antdProPath
)
.
split
(
'/'
)
.
split
(
'/'
)
.
map
(
a
=>
a
.
replace
(
/
([
A-Z
])
/g
,
'-$1'
))
.
map
(
a
=>
a
.
replace
(
/
([
A-Z
])
/g
,
'-$1'
))
.
map
(
a
=>
a
.
toLowerCase
());
.
map
(
a
=>
a
.
toLowerCase
());
return
`panda-pro
${
arr
.
join
(
'-'
)}
-
${
localName
}
`
.
replace
(
/--/g
,
'-'
);
return
`panda-pro
${
arr
.
join
(
'-'
)}
-
${
localName
}
`
.
replace
(
/--/g
,
'-'
,
);
}
}
return
localName
;
return
localName
;
},
},
}
},
},
},
},
},
{
{
...
...
internals/webpack/webpack.dev.babel.js
View file @
6c53cf39
...
@@ -49,7 +49,7 @@ module.exports = require('./webpack.base.babel')({
...
@@ -49,7 +49,7 @@ module.exports = require('./webpack.base.babel')({
fs
:
'empty'
,
fs
:
'empty'
,
net
:
'empty'
,
net
:
'empty'
,
tls
:
'empty'
,
tls
:
'empty'
,
child_process
:
'empty'
child_process
:
'empty'
,
},
},
performance
:
{
performance
:
{
hints
:
false
,
hints
:
false
,
...
...
src/app.js
View file @
6c53cf39
...
@@ -37,7 +37,7 @@ if (module.hot) {
...
@@ -37,7 +37,7 @@ if (module.hot) {
render
();
render
();
});
});
}
}
if
(
MOUNT_NODE
)
{
if
(
MOUNT_NODE
)
{
render
();
render
();
}
}
...
...
src/components/HeaderDropdown/index.js
View file @
6c53cf39
...
@@ -7,10 +7,7 @@ import styles from './index.less';
...
@@ -7,10 +7,7 @@ import styles from './index.less';
const
HeaderDropdown
=
({
overlayClassName
:
cls
,
...
restProps
})
=>
(
const
HeaderDropdown
=
({
overlayClassName
:
cls
,
...
restProps
})
=>
(
<
Dropdown
<
Dropdown
overlayClassName
=
{
classNames
(
overlayClassName
=
{
classNames
(
styles
.
container
,
cls
)}
styles
.
container
,
cls
,
)}
{...
restProps
}
{...
restProps
}
/
>
/
>
);
);
...
...
src/components/HeaderSearch/index.js
View file @
6c53cf39
import
React
,
{
useRef
}
from
'react'
;
import
React
,
{
useRef
}
from
'react'
;
import
{
import
{
AutoComplete
,
Input
}
from
'antd'
;
AutoComplete
,
Input
,
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
PropType
from
'prop-types'
;
import
PropType
from
'prop-types'
;
import
useMergeValue
from
'use-merge-value'
;
import
useMergeValue
from
'use-merge-value'
;
...
@@ -35,19 +32,13 @@ const HeaderSearch = props => {
...
@@ -35,19 +32,13 @@ const HeaderSearch = props => {
onChange
:
onVisibleChange
,
onChange
:
onVisibleChange
,
});
});
const
inputClass
=
classNames
(
const
inputClass
=
classNames
(
styles
.
input
,
{
styles
.
input
,
[
styles
.
show
]:
searchMode
,
{
});
[
styles
.
show
]:
searchMode
,
},
);
return
(
return
(
<
div
<
div
className
=
{
classNames
(
className
=
{
classNames
(
className
,
styles
.
headerSearch
)}
className
,
styles
.
headerSearch
,
)}
onClick
=
{()
=>
{
onClick
=
{()
=>
{
setSearchMode
(
true
);
setSearchMode
(
true
);
if
(
searchMode
&&
inputRef
.
current
)
{
if
(
searchMode
&&
inputRef
.
current
)
{
...
...
src/components/NoticeIcon/index.js
View file @
6c53cf39
import
React
from
'react'
;
import
React
from
'react'
;
import
{
import
{
Badge
,
Spin
,
Tabs
}
from
'antd'
;
Badge
,
Spin
,
Tabs
,
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
useMergeValue
from
'use-merge-value'
;
import
useMergeValue
from
'use-merge-value'
;
...
@@ -78,14 +74,9 @@ const NoticeIcon = props => {
...
@@ -78,14 +74,9 @@ const NoticeIcon = props => {
value
:
props
.
popupVisible
,
value
:
props
.
popupVisible
,
onChange
:
props
.
onPopupVisibleChange
,
onChange
:
props
.
onPopupVisibleChange
,
});
});
const
noticeButtonClass
=
classNames
(
const
noticeButtonClass
=
classNames
(
className
,
styles
.
noticeButton
);
className
,
styles
.
noticeButton
,
);
const
notificationBox
=
getNotificationBox
();
const
notificationBox
=
getNotificationBox
();
const
NoticeBellIcon
=
bell
||
(
const
NoticeBellIcon
=
bell
||
<
BellOutlined
className
=
{
styles
.
icon
}
/>
;
<
BellOutlined
className
=
{
styles
.
icon
}
/
>
);
const
trigger
=
(
const
trigger
=
(
<
span
className
=
{
classNames
(
noticeButtonClass
,
{
opened
:
visible
})}
>
<
span
className
=
{
classNames
(
noticeButtonClass
,
{
opened
:
visible
})}
>
<
Badge
<
Badge
...
...
src/configureStore.js
View file @
6c53cf39
import
{
routerMiddleware
}
from
'connected-react-router/immutable'
;
import
{
routerMiddleware
}
from
'connected-react-router/immutable'
;
import
{
Iterable
}
from
'immutable'
;
import
{
Iterable
}
from
'immutable'
;
import
{
import
{
applyMiddleware
,
compose
,
createStore
}
from
'redux'
;
applyMiddleware
,
compose
,
createStore
,
}
from
'redux'
;
import
{
createLogger
}
from
'redux-logger'
;
import
{
createLogger
}
from
'redux-logger'
;
import
createSagaMiddleware
from
'redux-saga'
;
import
createSagaMiddleware
from
'redux-saga'
;
import
thunk
from
'redux-thunk'
;
import
thunk
from
'redux-thunk'
;
...
...
src/containers/App/index.js
View file @
6c53cf39
...
@@ -2,20 +2,14 @@ import React from 'react';
...
@@ -2,20 +2,14 @@ import React from 'react';
import
{
Helmet
}
from
'react-helmet'
;
import
{
Helmet
}
from
'react-helmet'
;
import
{
renderRoutes
}
from
'react-router-config'
;
import
{
renderRoutes
}
from
'react-router-config'
;
import
{
import
{
BrowserRouter
as
Router
,
Switch
}
from
'react-router-dom'
;
BrowserRouter
as
Router
,
Switch
,
}
from
'react-router-dom'
;
import
config
from
'../../routes/config'
;
import
config
from
'../../routes/config'
;
export
default
function
App
()
{
export
default
function
App
()
{
return
(
return
(
<>
<>
<
Helmet
<
Helmet
titleTemplate
=
"%s - 运维平台"
defaultTitle
=
"运维平台"
>
titleTemplate
=
"%s - 运维平台"
defaultTitle
=
"运维平台"
>
<
meta
name
=
"description"
content
=
"运维平台"
/>
<
meta
name
=
"description"
content
=
"运维平台"
/>
<
/Helmet
>
<
/Helmet
>
<
Router
>
<
Router
>
...
...
src/containers/App/store/actions.js
View file @
6c53cf39
import
{
import
{
LOAD_REPOS
,
LOAD_REPOS_ERROR
,
LOAD_REPOS_SUCCESS
}
from
'./constants'
;
LOAD_REPOS
,
LOAD_REPOS_ERROR
,
LOAD_REPOS_SUCCESS
,
}
from
'./constants'
;
export
function
loadRepos
()
{
export
function
loadRepos
()
{
return
{
return
{
...
@@ -10,7 +6,6 @@ export function loadRepos() {
...
@@ -10,7 +6,6 @@ export function loadRepos() {
};
};
}
}
export
function
reposLoaded
(
repos
,
username
)
{
export
function
reposLoaded
(
repos
,
username
)
{
return
{
return
{
type
:
LOAD_REPOS_SUCCESS
,
type
:
LOAD_REPOS_SUCCESS
,
...
...
src/containers/App/store/reducer.js
View file @
6c53cf39
import
{
fromJS
}
from
'immutable'
;
import
{
fromJS
}
from
'immutable'
;
import
{
import
{
LOAD_REPOS
,
LOAD_REPOS_ERROR
,
LOAD_REPOS_SUCCESS
}
from
'./constants'
;
LOAD_REPOS
,
LOAD_REPOS_ERROR
,
LOAD_REPOS_SUCCESS
,
}
from
'./constants'
;
export
const
initialState
=
fromJS
({
export
const
initialState
=
fromJS
({
loading
:
false
,
loading
:
false
,
...
@@ -23,25 +19,25 @@ const appReducer = (state = initialState, action) => {
...
@@ -23,25 +19,25 @@ const appReducer = (state = initialState, action) => {
loading
:
true
,
loading
:
true
,
error
:
false
,
error
:
false
,
userData
:
{
userData
:
{
repositories
:
false
repositories
:
false
,
}
}
,
})
})
;
case
LOAD_REPOS_SUCCESS
:
case
LOAD_REPOS_SUCCESS
:
return
state
.
merge
({
return
state
.
merge
({
loading
:
false
,
loading
:
false
,
currentUser
:
action
.
username
,
currentUser
:
action
.
username
,
userData
:
{
userData
:
{
repositories
:
action
.
repos
repositories
:
action
.
repos
,
}
}
,
})
})
;
case
LOAD_REPOS_ERROR
:
case
LOAD_REPOS_ERROR
:
return
state
.
merge
({
return
state
.
merge
({
error
:
action
.
error
,
error
:
action
.
error
,
loading
:
false
loading
:
false
,
})
})
;
default
:
default
:
return
state
;
return
state
;
}
}
}
}
;
export
default
appReducer
;
export
default
appReducer
;
src/layouts/UserLayout.js
View file @
6c53cf39
import
React
from
'react'
;
import
React
from
'react'
;
import
{
import
{
Helmet
,
HelmetProvider
}
from
'react-helmet-async'
;
Helmet
,
HelmetProvider
,
}
from
'react-helmet-async'
;
import
{
renderRoutes
}
from
'react-router-config'
;
import
{
renderRoutes
}
from
'react-router-config'
;
import
{
import
{
...
@@ -38,16 +35,16 @@ const UserLayout = props => {
...
@@ -38,16 +35,16 @@ const UserLayout = props => {
<
/Helmet
>
<
/Helmet
>
<
div
className
=
{
styles
.
container
}
>
<
div
className
=
{
styles
.
container
}
>
<
div
className
=
{
styles
.
lang
}
>
<
div
className
=
{
styles
.
lang
}
>
{
/* <SelectLang /> */
}
<
/div
>
{
/* <SelectLang /> */
}
<
/div
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
top
}
>
<
div
className
=
{
styles
.
top
}
>
<
div
className
=
{
styles
.
header
}
>
<
div
className
=
{
styles
.
header
}
>
<
img
alt
=
"logo"
className
=
{
styles
.
logo
}
src
=
{
logo
}
/
>
<
img
alt
=
"logo"
className
=
{
styles
.
logo
}
src
=
{
logo
}
/
>
<
span
className
=
{
styles
.
title
}
>
Ant
Design
<
/span
>
<
span
className
=
{
styles
.
title
}
>
Ant
Design
<
/span
>
<
/div
>
<
div
className
=
{
styles
.
desc
}
>
Ant
Design
是西湖区最具影响力的
Web
设计规范
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
desc
}
>
Ant
Design
是西湖区最具影响力的
Web
设计规范
<
/div
>
<
/div
>
<
/div
>
{
renderRoutes
(
route
.
routes
)}
{
renderRoutes
(
route
.
routes
)}
<
/div
>
<
/div
>
...
...
src/pages/Welcome.js
View file @
6c53cf39
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Alert
,
Card
,
Typography
}
from
'antd'
;
import
{
Alert
,
Card
,
Typography
}
from
'antd'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
{
connect
}
from
'react-redux'
;
import
styles
from
'./Welcome.less'
;
import
styles
from
'./Welcome.less'
;
const
CodePreview
=
({
children
})
=>
(
const
CodePreview
=
({
children
})
=>
(
...
@@ -14,7 +12,9 @@ const CodePreview = ({ children }) => (
...
@@ -14,7 +12,9 @@ const CodePreview = ({ children }) => (
<
/pre
>
<
/pre
>
);
);
export
default
()
=>
(
const
mapState
=
store
=>
store
;
export
default
connect
(
mapState
)(()
=>
(
<
PageContainer
>
<
PageContainer
>
<
Card
>
<
Card
>
<
Alert
<
Alert
...
@@ -29,4 +29,4 @@ export default () => (
...
@@ -29,4 +29,4 @@ export default () => (
/
>
/
>
<
/Card
>
<
/Card
>
<
/PageContainer
>
<
/PageContainer
>
);
)
)
;
src/pages/exception/403.js
View file @
6c53cf39
import
React
from
'react'
;
import
React
from
'react'
;
import
{
import
{
Button
,
Result
}
from
'antd'
;
Button
,
Result
,
}
from
'antd'
;
export
default
()
=>
(
export
default
()
=>
(
<
Result
<
Result
...
@@ -13,8 +10,6 @@ export default () => (
...
@@ -13,8 +10,6 @@ export default () => (
background
:
'none'
,
background
:
'none'
,
}}
}}
subTitle
=
"Sorry, you don't have access to this page."
subTitle
=
"Sorry, you don't have access to this page."
extra
=
{
extra
=
{
<
Button
type
=
"primary"
>
Back
to
home
<
/Button>
}
<
Button
type
=
"primary"
>
Back
to
home
<
/Button
>
}
/>
/>
);
);
\ No newline at end of file
src/pages/exception/404.js
View file @
6c53cf39
import
React
from
'react'
;
import
React
from
'react'
;
import
{
import
{
Button
,
Result
}
from
'antd'
;
Button
,
Result
,
}
from
'antd'
;
export
default
()
=>
(
export
default
()
=>
(
<
Result
<
Result
...
@@ -13,8 +10,6 @@ export default () => (
...
@@ -13,8 +10,6 @@ export default () => (
background
:
'none'
,
background
:
'none'
,
}}
}}
subTitle
=
"Sorry, the page you visited does not exist."
subTitle
=
"Sorry, the page you visited does not exist."
extra
=
{
extra
=
{
<
Button
type
=
"primary"
>
Back
Home
<
/Button>
}
<
Button
type
=
"primary"
>
Back
Home
<
/Button
>
}
/>
/>
);
);
\ No newline at end of file
src/pages/user/login/components/Login/LoginItem.js
View file @
6c53cf39
import
React
from
'react'
;
import
React
from
'react'
;
import
{
import
{
Form
,
Input
}
from
'antd'
;
Form
,
Input
,
}
from
'antd'
;
import
LoginContext
from
'./LoginContext'
;
import
LoginContext
from
'./LoginContext'
;
import
ItemMap
from
'./map'
;
import
ItemMap
from
'./map'
;
...
...
src/pages/user/login/components/Login/LoginSubmit.js
View file @
6c53cf39
import
React
from
'react'
;
import
React
from
'react'
;
import
{
import
{
Button
,
Form
}
from
'antd'
;
Button
,
Form
,
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
...
@@ -11,10 +8,7 @@ import styles from './index.less';
...
@@ -11,10 +8,7 @@ import styles from './index.less';
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
const
LoginSubmit
=
({
className
,
...
rest
})
=>
{
const
LoginSubmit
=
({
className
,
...
rest
})
=>
{
const
clsString
=
classNames
(
const
clsString
=
classNames
(
styles
.
submit
,
className
);
styles
.
submit
,
className
,
);
return
(
return
(
<
FormItem
>
<
FormItem
>
<
Button
<
Button
...
...
src/pages/user/login/components/Login/index.js
View file @
6c53cf39
...
@@ -19,12 +19,7 @@ const Login = props => {
...
@@ -19,12 +19,7 @@ const Login = props => {
});
});
return
(
return
(
<
LoginContext
.
Provider
>
<
LoginContext
.
Provider
>
<
div
<
div
className
=
{
classNames
(
className
,
styles
.
login
)}
>
className
=
{
classNames
(
className
,
styles
.
login
,
)}
>
<
Form
<
Form
form
=
{
props
.
from
}
form
=
{
props
.
from
}
onFinish
=
{
values
=>
{
onFinish
=
{
values
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment