Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
max_android_panel
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xin
max_android_panel
Commits
18ad3ebd
Commit
18ad3ebd
authored
May 16, 2019
by
wujiabao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of git.mjitech.com:zhangxin/max_android_panel into dev
parents
1f23c97d
10b4be4c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
13 deletions
+52
-13
client/config/config.js
+4
-4
client/containers/DevPage/DevPage.jsx
+27
-3
client/env/preprod.js
+5
-0
client/index.html
+4
-1
package.json
+3
-2
webpack.config.js
+9
-3
No files found.
client/config/config.js
View file @
18ad3ebd
import
{
getQuery
}
from
'../util/common'
;
import
{
getQuery
}
from
'../util/common'
;
const
requestInfo
=
{
const
requestInfo
=
{
domainPort
:
'7788'
,
domainPort
:
getQuery
(
'monitorPort'
)
||
'7788'
,
domainIp
:
process
.
env
.
NODE
_ENV
!==
'production'
?
'192.168.10.'
:
'192.168.8.'
,
domainIp
:
process
.
env
.
PAD
_ENV
!==
'production'
?
'192.168.10.'
:
'192.168.8.'
,
exactDomainIp
:
getQuery
(
'
isDev'
)
?
'127.0.0.1'
:
''
exactDomainIp
:
getQuery
(
'
localMonitorIP'
)
?
'127.0.0.1'
:
(
localStorage
.
getItem
(
'monitorIP'
)
||
''
)
}
}
;
module
.
exports
=
requestInfo
;
module
.
exports
=
requestInfo
;
client/containers/DevPage/DevPage.jsx
View file @
18ad3ebd
import
React
from
'react'
;
import
React
from
'react'
;
import
HeaderComponent
from
'../../components/CommonComponent/HeaderComponent/HeaderComponent'
import
HeaderComponent
from
'../../components/CommonComponent/HeaderComponent/HeaderComponent'
import
Button
from
'../../components/CommonComponent/ButtonComponent/ButtonComponent'
;
import
Button
from
'../../components/CommonComponent/ButtonComponent/ButtonComponent'
;
import
{
Input
}
from
'antd'
;
const
Search
=
Input
.
Search
;
export
default
class
DevPage
extends
React
.
Component
{
export
default
class
DevPage
extends
React
.
Component
{
constructor
(
props
){
constructor
(
props
){
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
monitorIP
:
localStorage
.
getItem
(
'monitorIP'
)
||
''
}
}
onSaveIp
(
value
)
{
value
=
value
||
''
;
let
ipArr
=
value
.
split
(
'.'
);
if
(
ipArr
&&
ipArr
.
length
===
4
)
{
localStorage
.
setItem
(
'monitorIP'
,
value
);
}
}
}
}
render
(){
render
(){
let
props
=
this
.
props
;
let
props
=
this
.
props
;
let
{
headerInfo
,
changePages
}
=
props
;
let
{
headerInfo
,
changePages
}
=
props
;
let
monitorIP
=
this
.
state
.
monitorIP
;
return
(
return
(
<
div
>
<
div
>
<
HeaderComponent
<
HeaderComponent
...
@@ -18,9 +32,19 @@ export default class DevPage extends React.Component {
...
@@ -18,9 +32,19 @@ export default class DevPage extends React.Component {
headerInfo=
{
headerInfo
}
headerInfo=
{
headerInfo
}
/>
/>
<
div
className=
"machineInfo"
style=
{
{
textAlign
:
'center'
,
marginTop
:
'3rem'
}
}
>
<
div
className=
"machineInfo"
style=
{
{
textAlign
:
'center'
,
marginTop
:
'3rem'
}
}
>
<
p
>
当前版本号
{
CURVERSION
}
</
p
>
<
p
style=
{
{
padding
:
'10px'
}
}
>
当前环境
{
process
.
env
.
PAD_ENV
}
</
p
>
<
p
>
当前端口号
{
CONFIG
.
config
.
domainPort
}
</
p
>
<
p
style=
{
{
padding
:
'10px'
}
}
>
当前版本号
{
CURVERSION
}
</
p
>
<
Button
text=
{
'首页'
}
btnContainer=
{
'colfff font30'
}
style=
{
{
background
:
'#ff7860'
,
marginLeft
:
'50%'
,
transform
:
' translate(-50%)'
,
marginTop
:
'.5rem'
}
}
option=
{
()
=>
changePages
(
CONFIG
.
showPage
[
13
])
}
/>
<
p
style=
{
{
padding
:
'10px'
}
}
>
monitor端口
{
CONFIG
.
config
.
domainPort
}
</
p
>
<
div
style=
{
{
padding
:
'10px'
}
}
>
monitor ip:
<
Search
defaultValue=
{
monitorIP
}
style=
{
{
width
:
'200px'
}
}
placeholder=
"请输入ip"
enterButton=
"确定"
onSearch=
{
value
=>
this
.
onSaveIp
(
value
)
}
/>
</
div
>
<
Button
text=
{
'回首页'
}
btnContainer=
{
'colfff font30'
}
style=
{
{
background
:
'#ff7860'
,
marginLeft
:
'50%'
,
transform
:
' translate(-50%)'
,
marginTop
:
'.5rem'
}
}
option=
{
()
=>
changePages
(
CONFIG
.
showPage
[
13
])
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
client/env/preprod.js
0 → 100644
View file @
18ad3ebd
module
.
exports
=
{
domain
:
'https://preprod.mjitech.com/web/'
,
uploadImg
:
"https://preprod.mjitech.com/static/uploadTrouble"
}
\ No newline at end of file
client/index.html
View file @
18ad3ebd
...
@@ -5,7 +5,10 @@
...
@@ -5,7 +5,10 @@
<title>
华沁工作平台
</title>
<title>
华沁工作平台
</title>
<meta
name=
'viewport'
content=
'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=false,target-densitydpi=device-dpi'
/>
<meta
name=
'viewport'
content=
'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=false,target-densitydpi=device-dpi'
/>
<meta
name=
"format-detection"
content=
"telephone=no"
/>
<meta
name=
"format-detection"
content=
"telephone=no"
/>
<script
src=
"http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"
></script>
<script>
// flexible.js
!
function
(){
var
a
=
"@charset
\"
utf-8
\"
;html{color:#000;background:#fff;overflow-y:scroll;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}html *{outline:0;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}html,body{font-family:sans-serif}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{margin:0;padding:0}input,select,textarea{font-size:100%}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}abbr,acronym{border:0;font-variant:normal}del{text-decoration:line-through}address,caption,cite,code,dfn,em,th,var{font-style:normal;font-weight:500}ol,ul{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:500}q:before,q:after{content:''}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}a:hover{text-decoration:underline}ins,a{text-decoration:none}"
,
b
=
document
.
createElement
(
"style"
);
if
(
document
.
getElementsByTagName
(
"head"
)[
0
].
appendChild
(
b
),
b
.
styleSheet
)
b
.
styleSheet
.
disabled
||
(
b
.
styleSheet
.
cssText
=
a
);
else
try
{
b
.
innerHTML
=
a
}
catch
(
c
){
b
.
innerText
=
a
}}();
!
function
(
a
,
b
){
function
c
(){
var
b
=
f
.
getBoundingClientRect
().
width
;
b
/
i
>
540
&&
(
b
=
540
*
i
);
var
c
=
b
/
10
;
f
.
style
.
fontSize
=
c
+
"px"
,
k
.
rem
=
a
.
rem
=
c
}
var
d
,
e
=
a
.
document
,
f
=
e
.
documentElement
,
g
=
e
.
querySelector
(
'meta[name="viewport"]'
),
h
=
e
.
querySelector
(
'meta[name="flexible"]'
),
i
=
0
,
j
=
0
,
k
=
b
.
flexible
||
(
b
.
flexible
=
{});
if
(
g
){
console
.
warn
(
"将根据已有的meta标签来设置缩放比例"
);
var
l
=
g
.
getAttribute
(
"content"
).
match
(
/initial
\-
scale=
([\d\.]
+
)
/
);
l
&&
(
j
=
parseFloat
(
l
[
1
]),
i
=
parseInt
(
1
/
j
))}
else
if
(
h
){
var
m
=
h
.
getAttribute
(
"content"
);
if
(
m
){
var
n
=
m
.
match
(
/initial
\-
dpr=
([\d\.]
+
)
/
),
o
=
m
.
match
(
/maximum
\-
dpr=
([\d\.]
+
)
/
);
n
&&
(
i
=
parseFloat
(
n
[
1
]),
j
=
parseFloat
((
1
/
i
).
toFixed
(
2
))),
o
&&
(
i
=
parseFloat
(
o
[
1
]),
j
=
parseFloat
((
1
/
i
).
toFixed
(
2
)))}}
if
(
!
i
&&!
j
){
var
p
=
(
a
.
navigator
.
appVersion
.
match
(
/android/gi
),
a
.
navigator
.
appVersion
.
match
(
/iphone/gi
)),
q
=
a
.
devicePixelRatio
;
i
=
p
?
q
>=
3
&&
(
!
i
||
i
>=
3
)?
3
:
q
>=
2
&&
(
!
i
||
i
>=
2
)?
2
:
1
:
1
,
j
=
1
/
i
}
if
(
f
.
setAttribute
(
"data-dpr"
,
i
),
!
g
)
if
(
g
=
e
.
createElement
(
"meta"
),
g
.
setAttribute
(
"name"
,
"viewport"
),
g
.
setAttribute
(
"content"
,
"initial-scale="
+
j
+
", maximum-scale="
+
j
+
", minimum-scale="
+
j
+
", user-scalable=no"
),
f
.
firstElementChild
)
f
.
firstElementChild
.
appendChild
(
g
);
else
{
var
r
=
e
.
createElement
(
"div"
);
r
.
appendChild
(
g
),
e
.
write
(
r
.
innerHTML
)}
a
.
addEventListener
(
"resize"
,
function
(){
clearTimeout
(
d
),
d
=
setTimeout
(
c
,
300
)},
!
1
),
a
.
addEventListener
(
"pageshow"
,
function
(
a
){
a
.
persisted
&&
(
clearTimeout
(
d
),
d
=
setTimeout
(
c
,
300
))},
!
1
),
"complete"
===
e
.
readyState
?
e
.
body
.
style
.
fontSize
=
12
*
i
+
"px"
:
e
.
addEventListener
(
"DOMContentLoaded"
,
function
(){
e
.
body
.
style
.
fontSize
=
12
*
i
+
"px"
},
!
1
),
c
(),
k
.
dpr
=
a
.
dpr
=
i
,
k
.
refreshRem
=
c
,
k
.
rem2px
=
function
(
a
){
var
b
=
parseFloat
(
a
)
*
this
.
rem
;
return
"string"
==
typeof
a
&&
a
.
match
(
/rem$/
)
&&
(
b
+=
"px"
),
b
},
k
.
px2rem
=
function
(
a
){
var
b
=
parseFloat
(
a
)
/
this
.
rem
;
return
"string"
==
typeof
a
&&
a
.
match
(
/px$/
)
&&
(
b
+=
"rem"
),
b
}}(
window
,
window
.
lib
||
(
window
.
lib
=
{}));
</script>
</head>
</head>
<body>
<body>
...
...
package.json
View file @
18ad3ebd
...
@@ -7,8 +7,9 @@
...
@@ -7,8 +7,9 @@
"scripts"
:
{
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"clean"
:
"rm -rf static/*"
,
"clean"
:
"rm -rf static/*"
,
"start"
:
"cross-env NODE_ENV=development webpack-dev-server --version=2.0.3 --env=dev -d --history-api-fallback --hot --inline --progress --colors --port 6999 --host 0.0.0.0"
,
"start"
:
"cross-env NODE_ENV=development PAD_ENV=development webpack-dev-server --version=2.0.4 --env=dev -d --history-api-fallback --hot --inline --progress --colors --port 6999 --host 0.0.0.0"
,
"build"
:
"cross-env NODE_ENV=production webpack --env=build --version=2.0.3 --progress --color"
,
"build"
:
"cross-env NODE_ENV=production PAD_ENV=production webpack --env=build --version=2.0.4 --progress --color"
,
"preprod"
:
"cross-env NODE_ENV=production PAD_ENV=preprod webpack --env=build --version=2.0.4 --progress --color"
,
"build:prod"
:
"cross-env NODE_ENV=development webpack --env=build --progress --color"
"build:prod"
:
"cross-env NODE_ENV=development webpack --env=build --progress --color"
},
},
"author"
:
""
,
"author"
:
""
,
...
...
webpack.config.js
View file @
18ad3ebd
...
@@ -102,12 +102,15 @@ let envConfig = {
...
@@ -102,12 +102,15 @@ let envConfig = {
}),
//分割共有模块和代码模块
}),
//分割共有模块和代码模块
new
webpack
.
optimize
.
AggressiveMergingPlugin
(),
new
webpack
.
optimize
.
AggressiveMergingPlugin
(),
new
webpack
.
DefinePlugin
({
new
webpack
.
DefinePlugin
({
'process.env'
:
{
NODE_ENV
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
||
'production'
)
},
'process.env'
:
{
NODE_ENV
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
||
'production'
),
PAD_ENV
:
JSON
.
stringify
(
process
.
env
.
PAD_ENV
||
'production'
)
},
'BASEREM'
:
120
,
'BASEREM'
:
120
,
'CURVERSION'
:
JSON
.
stringify
(
curversion
)
'CURVERSION'
:
JSON
.
stringify
(
curversion
)
}),
}),
new
webpack
.
ProvidePlugin
({
new
webpack
.
ProvidePlugin
({
ENV
:
__dirname
+
'/client/env/production'
,
ENV
:
__dirname
+
(
process
.
env
.
PAD_ENV
===
'preprod'
?
'/client/env/preprod'
:
'/client/env/production'
)
,
UTILPATH
:
__dirname
+
'/client/util/util'
,
UTILPATH
:
__dirname
+
'/client/util/util'
,
CONFIG
:
__dirname
+
'/client/config/index'
,
CONFIG
:
__dirname
+
'/client/config/index'
,
}),
}),
...
@@ -127,7 +130,10 @@ let envConfig = {
...
@@ -127,7 +130,10 @@ let envConfig = {
filename
:
"vendor.bundle.js"
filename
:
"vendor.bundle.js"
}),
//分割共有模块和代码模块
}),
//分割共有模块和代码模块
new
webpack
.
DefinePlugin
({
new
webpack
.
DefinePlugin
({
'process.env'
:
{
NODE_ENV
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
||
'development'
)
},
'process.env'
:
{
NODE_ENV
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
||
'development'
),
PAD_ENV
:
JSON
.
stringify
(
process
.
env
.
PAD_ENV
||
'production'
)
},
'BASEREM'
:
120
,
'BASEREM'
:
120
,
'CURVERSION'
:
JSON
.
stringify
(
curversion
)
'CURVERSION'
:
JSON
.
stringify
(
curversion
)
}),
}),
...
...
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