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 = {
'styled-components'
,
'@babel/plugin-proposal-class-properties'
,
'@babel/plugin-syntax-dynamic-import'
,
[
'import'
,
{
libraryName
:
'antd'
,
style
:
true
}]
[
'import'
,
{
libraryName
:
'antd'
,
style
:
true
}]
,
],
env
:
{
production
:
{
...
...
internals/webpack/webpack.base.babel.js
View file @
6c53cf39
...
...
@@ -15,7 +15,7 @@ module.exports = options => ({
module
:
{
rules
:
[
{
test
:
/
\.
jsx
?
$/
,
test
:
/
\.
jsx
?
$/
,
exclude
:
/node_modules/
,
use
:
{
loader
:
'babel-loader'
,
...
...
@@ -42,7 +42,6 @@ module.exports = options => ({
loader
:
'css-loader'
,
options
:
{
modules
:
{
// localIdentName: '[name]__[local]___[hash:base64:5]'
// modules: true,
getLocalIdent
:
(
context
,
_
,
localName
)
=>
{
...
...
@@ -53,22 +52,24 @@ module.exports = options => ({
)
{
return
localName
;
}
const
match
=
context
.
resourcePath
.
match
(
/src
(
.*
)
/
);
if
(
match
&&
match
[
1
])
{
const
antdProPath
=
match
[
1
].
replace
(
'.less'
,
''
);
const
arr
=
slash
(
antdProPath
)
.
split
(
'/'
)
.
map
(
a
=>
a
.
replace
(
/
([
A-Z
])
/g
,
'-$1'
))
.
map
(
a
=>
a
.
toLowerCase
());
return
`panda-pro
${
arr
.
join
(
'-'
)}
-
${
localName
}
`
.
replace
(
/--/g
,
'-'
);
return
`panda-pro
${
arr
.
join
(
'-'
)}
-
${
localName
}
`
.
replace
(
/--/g
,
'-'
,
);
}
return
localName
;
},
}
},
},
},
{
...
...
internals/webpack/webpack.dev.babel.js
View file @
6c53cf39
...
...
@@ -49,7 +49,7 @@ module.exports = require('./webpack.base.babel')({
fs
:
'empty'
,
net
:
'empty'
,
tls
:
'empty'
,
child_process
:
'empty'
child_process
:
'empty'
,
},
performance
:
{
hints
:
false
,
...
...
src/app.js
View file @
6c53cf39
...
...
@@ -37,7 +37,7 @@ if (module.hot) {
render
();
});
}
if
(
MOUNT_NODE
)
{
if
(
MOUNT_NODE
)
{
render
();
}
...
...
src/components/HeaderDropdown/index.js
View file @
6c53cf39
...
...
@@ -7,10 +7,7 @@ import styles from './index.less';
const
HeaderDropdown
=
({
overlayClassName
:
cls
,
...
restProps
})
=>
(
<
Dropdown
overlayClassName
=
{
classNames
(
styles
.
container
,
cls
,
)}
overlayClassName
=
{
classNames
(
styles
.
container
,
cls
)}
{...
restProps
}
/
>
);
...
...
src/components/HeaderSearch/index.js
View file @
6c53cf39
import
React
,
{
useRef
}
from
'react'
;
import
{
AutoComplete
,
Input
,
}
from
'antd'
;
import
{
AutoComplete
,
Input
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
PropType
from
'prop-types'
;
import
useMergeValue
from
'use-merge-value'
;
...
...
@@ -35,19 +32,13 @@ const HeaderSearch = props => {
onChange
:
onVisibleChange
,
});
const
inputClass
=
classNames
(
styles
.
input
,
{
[
styles
.
show
]:
searchMode
,
},
);
const
inputClass
=
classNames
(
styles
.
input
,
{
[
styles
.
show
]:
searchMode
,
});
return
(
<
div
className
=
{
classNames
(
className
,
styles
.
headerSearch
,
)}
className
=
{
classNames
(
className
,
styles
.
headerSearch
)}
onClick
=
{()
=>
{
setSearchMode
(
true
);
if
(
searchMode
&&
inputRef
.
current
)
{
...
...
src/components/NoticeIcon/index.js
View file @
6c53cf39
import
React
from
'react'
;
import
{
Badge
,
Spin
,
Tabs
,
}
from
'antd'
;
import
{
Badge
,
Spin
,
Tabs
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
useMergeValue
from
'use-merge-value'
;
...
...
@@ -78,14 +74,9 @@ const NoticeIcon = props => {
value
:
props
.
popupVisible
,
onChange
:
props
.
onPopupVisibleChange
,
});
const
noticeButtonClass
=
classNames
(
className
,
styles
.
noticeButton
,
);
const
noticeButtonClass
=
classNames
(
className
,
styles
.
noticeButton
);
const
notificationBox
=
getNotificationBox
();
const
NoticeBellIcon
=
bell
||
(
<
BellOutlined
className
=
{
styles
.
icon
}
/
>
);
const
NoticeBellIcon
=
bell
||
<
BellOutlined
className
=
{
styles
.
icon
}
/>
;
const
trigger
=
(
<
span
className
=
{
classNames
(
noticeButtonClass
,
{
opened
:
visible
})}
>
<
Badge
...
...
src/configureStore.js
View file @
6c53cf39
import
{
routerMiddleware
}
from
'connected-react-router/immutable'
;
import
{
Iterable
}
from
'immutable'
;
import
{
applyMiddleware
,
compose
,
createStore
,
}
from
'redux'
;
import
{
applyMiddleware
,
compose
,
createStore
}
from
'redux'
;
import
{
createLogger
}
from
'redux-logger'
;
import
createSagaMiddleware
from
'redux-saga'
;
import
thunk
from
'redux-thunk'
;
...
...
src/containers/App/index.js
View file @
6c53cf39
...
...
@@ -2,20 +2,14 @@ import React from 'react';
import
{
Helmet
}
from
'react-helmet'
;
import
{
renderRoutes
}
from
'react-router-config'
;
import
{
BrowserRouter
as
Router
,
Switch
,
}
from
'react-router-dom'
;
import
{
BrowserRouter
as
Router
,
Switch
}
from
'react-router-dom'
;
import
config
from
'../../routes/config'
;
export
default
function
App
()
{
return
(
<>
<
Helmet
titleTemplate
=
"%s - 运维平台"
defaultTitle
=
"运维平台"
>
<
Helmet
titleTemplate
=
"%s - 运维平台"
defaultTitle
=
"运维平台"
>
<
meta
name
=
"description"
content
=
"运维平台"
/>
<
/Helmet
>
<
Router
>
...
...
src/containers/App/store/actions.js
View file @
6c53cf39
import
{
LOAD_REPOS
,
LOAD_REPOS_ERROR
,
LOAD_REPOS_SUCCESS
,
}
from
'./constants'
;
import
{
LOAD_REPOS
,
LOAD_REPOS_ERROR
,
LOAD_REPOS_SUCCESS
}
from
'./constants'
;
export
function
loadRepos
()
{
return
{
...
...
@@ -10,7 +6,6 @@ export function loadRepos() {
};
}
export
function
reposLoaded
(
repos
,
username
)
{
return
{
type
:
LOAD_REPOS_SUCCESS
,
...
...
src/containers/App/store/reducer.js
View file @
6c53cf39
import
{
fromJS
}
from
'immutable'
;
import
{
LOAD_REPOS
,
LOAD_REPOS_ERROR
,
LOAD_REPOS_SUCCESS
,
}
from
'./constants'
;
import
{
LOAD_REPOS
,
LOAD_REPOS_ERROR
,
LOAD_REPOS_SUCCESS
}
from
'./constants'
;
export
const
initialState
=
fromJS
({
loading
:
false
,
...
...
@@ -23,25 +19,25 @@ const appReducer = (state = initialState, action) => {
loading
:
true
,
error
:
false
,
userData
:
{
repositories
:
false
}
})
repositories
:
false
,
}
,
})
;
case
LOAD_REPOS_SUCCESS
:
return
state
.
merge
({
loading
:
false
,
currentUser
:
action
.
username
,
userData
:
{
repositories
:
action
.
repos
}
})
repositories
:
action
.
repos
,
}
,
})
;
case
LOAD_REPOS_ERROR
:
return
state
.
merge
({
error
:
action
.
error
,
loading
:
false
})
loading
:
false
,
})
;
default
:
return
state
;
}
}
}
;
export
default
appReducer
;
src/layouts/UserLayout.js
View file @
6c53cf39
import
React
from
'react'
;
import
{
Helmet
,
HelmetProvider
,
}
from
'react-helmet-async'
;
import
{
Helmet
,
HelmetProvider
}
from
'react-helmet-async'
;
import
{
renderRoutes
}
from
'react-router-config'
;
import
{
...
...
@@ -38,16 +35,16 @@ const UserLayout = props => {
<
/Helmet
>
<
div
className
=
{
styles
.
container
}
>
<
div
className
=
{
styles
.
lang
}
>
{
/* <SelectLang /> */
}
<
/div
>
<
div
className
=
{
styles
.
lang
}
>
{
/* <SelectLang /> */
}
<
/div
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
top
}
>
<
div
className
=
{
styles
.
header
}
>
<
img
alt
=
"logo"
className
=
{
styles
.
logo
}
src
=
{
logo
}
/
>
<
span
className
=
{
styles
.
title
}
>
Ant
Design
<
/span
>
<
img
alt
=
"logo"
className
=
{
styles
.
logo
}
src
=
{
logo
}
/
>
<
span
className
=
{
styles
.
title
}
>
Ant
Design
<
/span
>
<
/div
>
<
div
className
=
{
styles
.
desc
}
>
Ant
Design
是西湖区最具影响力的
Web
设计规范
<
/div
>
<
div
className
=
{
styles
.
desc
}
>
Ant
Design
是西湖区最具影响力的
Web
设计规范
<
/div
>
<
/div
>
{
renderRoutes
(
route
.
routes
)}
<
/div
>
...
...
src/pages/Welcome.js
View file @
6c53cf39
import
React
from
'react'
;
import
{
Alert
,
Card
,
Typography
}
from
'antd'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
{
connect
}
from
'react-redux'
;
import
styles
from
'./Welcome.less'
;
const
CodePreview
=
({
children
})
=>
(
...
...
@@ -14,7 +12,9 @@ const CodePreview = ({ children }) => (
<
/pre
>
);
export
default
()
=>
(
const
mapState
=
store
=>
store
;
export
default
connect
(
mapState
)(()
=>
(
<
PageContainer
>
<
Card
>
<
Alert
...
...
@@ -29,4 +29,4 @@ export default () => (
/
>
<
/Card
>
<
/PageContainer
>
);
)
)
;
src/pages/exception/403.js
View file @
6c53cf39
import
React
from
'react'
;
import
{
Button
,
Result
,
}
from
'antd'
;
import
{
Button
,
Result
}
from
'antd'
;
export
default
()
=>
(
<
Result
...
...
@@ -13,8 +10,6 @@ export default () => (
background
:
'none'
,
}}
subTitle
=
"Sorry, you don't have access to this page."
extra
=
{
<
Button
type
=
"primary"
>
Back
to
home
<
/Button
>
}
extra
=
{
<
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
{
Button
,
Result
,
}
from
'antd'
;
import
{
Button
,
Result
}
from
'antd'
;
export
default
()
=>
(
<
Result
...
...
@@ -13,8 +10,6 @@ export default () => (
background
:
'none'
,
}}
subTitle
=
"Sorry, the page you visited does not exist."
extra
=
{
<
Button
type
=
"primary"
>
Back
Home
<
/Button
>
}
extra
=
{
<
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
{
Form
,
Input
,
}
from
'antd'
;
import
{
Form
,
Input
}
from
'antd'
;
import
LoginContext
from
'./LoginContext'
;
import
ItemMap
from
'./map'
;
...
...
src/pages/user/login/components/Login/LoginSubmit.js
View file @
6c53cf39
import
React
from
'react'
;
import
{
Button
,
Form
,
}
from
'antd'
;
import
{
Button
,
Form
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
styles
from
'./index.less'
;
...
...
@@ -11,10 +8,7 @@ import styles from './index.less';
const
FormItem
=
Form
.
Item
;
const
LoginSubmit
=
({
className
,
...
rest
})
=>
{
const
clsString
=
classNames
(
styles
.
submit
,
className
,
);
const
clsString
=
classNames
(
styles
.
submit
,
className
);
return
(
<
FormItem
>
<
Button
...
...
src/pages/user/login/components/Login/index.js
View file @
6c53cf39
...
...
@@ -19,12 +19,7 @@ const Login = props => {
});
return
(
<
LoginContext
.
Provider
>
<
div
className
=
{
classNames
(
className
,
styles
.
login
,
)}
>
<
div
className
=
{
classNames
(
className
,
styles
.
login
)}
>
<
Form
form
=
{
props
.
from
}
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