Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
graph
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
李伟@五瓣科技
graph
Commits
857718e5
Commit
857718e5
authored
Nov 08, 2022
by
wenli.huang@wuban.net.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upup
parent
25249cdf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
11 deletions
+36
-11
App.js
src/App.js
+30
-7
index.js
src/index.js
+4
-3
setupProxy.js
src/setupProxy.js
+2
-1
No files found.
src/App.js
View file @
857718e5
...
@@ -15,6 +15,18 @@ class App extends Component {
...
@@ -15,6 +15,18 @@ class App extends Component {
requestDuration
:
-
100
,
requestDuration
:
-
100
,
startText
:
''
,
startText
:
''
,
endText
:
''
,
endText
:
''
,
value
:
0
,
getValue
:
0
,
}
inputChange
=
(
e
)
=>
{
this
.
setState
({
value
:
e
.
target
.
value
})
}
getInput
=
()
=>
{
this
.
setState
({
getValue
:
this
.
state
.
value
})
}
}
componentDidMount
(){
componentDidMount
(){
let
that
=
this
let
that
=
this
...
@@ -56,7 +68,8 @@ class App extends Component {
...
@@ -56,7 +68,8 @@ class App extends Component {
that
.
initChart
(
resData
)
that
.
initChart
(
resData
)
if
(
!
that
.
interval
){
if
(
!
that
.
interval
){
that
.
interval
=
setInterval
(()
=>
{
that
.
interval
=
setInterval
(()
=>
{
fetch
(
`/api/graph_by_height_and_duration?height=0&duration=
${
that
.
state
.
requestDuration
}
`
,{
// fetch(`/api/graph_by_height_and_duration?height=0&duration=${that.state.requestDuration}`,{
fetch
(
`/api/graph_by_height_and_duration?height=
${
this
.
state
.
getValue
}
&duration=
${
that
.
state
.
requestDuration
}
`
,{
method
:
'
GET
'
,
method
:
'
GET
'
,
headers
:{
headers
:{
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
'
Content-Type
'
:
'
application/json;charset=UTF-8
'
...
@@ -84,6 +97,7 @@ class App extends Component {
...
@@ -84,6 +97,7 @@ class App extends Component {
}
}
var
chartDom
=
document
.
getElementById
(
'
main
'
);
var
chartDom
=
document
.
getElementById
(
'
main
'
);
var
myChart
=
echarts
.
init
(
chartDom
);
var
myChart
=
echarts
.
init
(
chartDom
);
myChart
.
on
(
'
datazoom
'
,
function
(
params
){
myChart
.
on
(
'
datazoom
'
,
function
(
params
){
clearInterval
(
that
.
interval
)
clearInterval
(
that
.
interval
)
var
options
=
myChart
.
getOption
();
var
options
=
myChart
.
getOption
();
...
@@ -604,13 +618,22 @@ class App extends Component {
...
@@ -604,13 +618,22 @@ class App extends Component {
render
()
{
render
()
{
const
{
startText
,
endText
}
=
this
.
state
const
{
startText
,
endText
}
=
this
.
state
return
(
return
(
<
div
>
//
<div>
<
div
id
=
"
main
"
className
=
"
container
"
style
=
{{
position
:
'
relative
'
,
padding
:
'
50px
'
,
boxSizing
:
'
border-box
'
,
width
:
'
100%
'
,
height
:
900
}}
>
//
<div id="main" className="container" style={{position:'relative', padding: '50px', boxSizing:'border-box', width: '100%', height: 900 }}>
<
/div
>
// </div>
<
div
style
=
{{
position
:
'
absolute
'
,
left
:
'
1%
'
,
top
:
'
70%
'
,
fontSize
:
'
12px
'
,
color
:
'
#80828a
'
}}
>
{
startText
}
<
/div
>
// <div style={{position:'absolute',left:'1%',top:'70%',fontSize:'12px',color:'#80828a'}}>{startText}</div>
<
div
style
=
{{
position
:
'
absolute
'
,
right
:
'
5%
'
,
top
:
'
70%
'
,
fontSize
:
'
12px
'
,
color
:
'
#80828a
'
}}
>
{
endText
}
<
/div
>
// <div style={{position:'absolute',right:'5%',top:'70%',fontSize:'12px',color:'#80828a'}}>{endText}</div>
<
/div
>
// </div>
<
div
>
<
div
>
<
div
id
=
"
main
"
className
=
"
container
"
style
=
{{
position
:
'
relative
'
,
padding
:
'
50px
'
,
boxSizing
:
'
border-box
'
,
width
:
'
100%
'
,
height
:
900
}}
>
<
/div
>
<
div
style
=
{{
position
:
'
absolute
'
,
left
:
'
1%
'
,
top
:
'
70%
'
,
fontSize
:
'
12px
'
,
color
:
'
#80828a
'
}}
>
{
startText
}
<
/div
>
<
div
style
=
{{
position
:
'
absolute
'
,
right
:
'
5%
'
,
top
:
'
70%
'
,
fontSize
:
'
12px
'
,
color
:
'
#80828a
'
}}
>
{
endText
}
<
/div
>
<
/div
>
<
input
value
=
{
this
.
state
.
value
}
onChange
=
{
this
.
inputChange
}
style
=
{{
width
:
'
10%
'
,
marginLeft
:
'
5%
'
}}
/
>
<
button
onClick
=
{
this
.
getInput
}
>
Click
<
/button
>
<
/div
>
);
);
}
}
}
}
...
...
src/index.js
View file @
857718e5
...
@@ -6,9 +6,10 @@ import reportWebVitals from './reportWebVitals';
...
@@ -6,9 +6,10 @@ import reportWebVitals from './reportWebVitals';
const
root
=
ReactDOM
.
createRoot
(
document
.
getElementById
(
'
root
'
));
const
root
=
ReactDOM
.
createRoot
(
document
.
getElementById
(
'
root
'
));
root
.
render
(
root
.
render
(
<
React
.
StrictMode
>
// <React.StrictMode>
<
App
/>
// <App />
<
/React.StrictMode
>
// </React.StrictMode>
<
App
/>
);
);
// If you want to start measuring performance in your app, pass a function
// If you want to start measuring performance in your app, pass a function
...
...
src/setupProxy.js
View file @
857718e5
...
@@ -2,7 +2,8 @@ const { createProxyMiddleware } = require('http-proxy-middleware');
...
@@ -2,7 +2,8 @@ const { createProxyMiddleware } = require('http-proxy-middleware');
module
.
exports
=
function
(
app
)
{
module
.
exports
=
function
(
app
)
{
app
.
use
(
createProxyMiddleware
(
'
/api
'
,
app
.
use
(
createProxyMiddleware
(
'
/api
'
,
{
{
"
target
"
:
"
http://54.168.125.67:26657
"
,
// "target": "http://54.168.125.67:26657",
"
target
"
:
'
http://15.161.127.241:30001
'
,
// "target": "http://3.9.177.160:50080",
// "target": "http://3.9.177.160:50080",
"
changeOrigin
"
:
true
,
"
changeOrigin
"
:
true
,
"
pathRewrite
"
:
{
"
pathRewrite
"
:
{
...
...
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