Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
plants-of-cse
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Levi Coffman
plants-of-cse
Merge requests
!1
Icons
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Icons
icons
into
master
Overview
0
Commits
5
Pipelines
0
Changes
10
Merged
Levi Coffman
requested to merge
icons
into
master
5 years ago
Overview
0
Commits
5
Pipelines
0
Changes
5
Expand
👍
0
👎
0
Merge request reports
Viewing commit
656934b1
Prev
Next
Show latest version
5 files
+
194
−
63
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
656934b1
got got the status to be updated... somewhat.
· 656934b1
Levi Coffman
authored
5 years ago
webpage/src/App.js
+
71
−
8
Options
// Copyright (2019) Levi Coffman
import
React
,
{
Component
}
from
'
react
'
;
import
Water
from
'
./Water.js
'
;
import
Grid
from
'
@material-ui/core/Grid
'
;
import
Icon
from
'
./Icon.js
'
;
import
{
Button
}
from
"
@material-ui/core
"
;
export
const
ServerURL
=
"
http://localhost:8080
"
.
toString
();
class
App
extends
Component
{
render
()
{
return
(
<
div
>
<
Water
/>
<
/div
>
);
}
constructor
(
props
)
{
super
(
props
);
this
.
sse
=
new
EventSource
(
`
${
ServerURL
}
/api/plant-status`
);
}
click
=
()
=>
{
fetch
(
`
${
ServerURL
}
/test`
)
.
then
(
console
.
log
,
console
.
error
);
};
render
()
{
return
(
<
div
>
<
Button
onClick
=
{
this
.
click
}
>
Update
<
/Button
>
<
Grid
container
alignContent
=
"
center
"
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Kroak the oak
"
}
plantID
=
{
4567
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Woofy!
"
}
plantID
=
{
1234
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Kroak the oak
"
}
plantID
=
{
4567
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Woofy!
"
}
plantID
=
{
1234
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Kroak the oak
"
}
plantID
=
{
4567
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Woofy!
"
}
plantID
=
{
1234
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Kroak the oak
"
}
plantID
=
{
4567
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Woofy!
"
}
plantID
=
{
1234
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Kroak the oak
"
}
plantID
=
{
4567
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Woofy!
"
}
plantID
=
{
1234
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Kroak the oak
"
}
plantID
=
{
4567
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Woofy!
"
}
plantID
=
{
1234
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Kroak the oak
"
}
plantID
=
{
4567
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Woofy!
"
}
plantID
=
{
1234
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Kroak the oak
"
}
plantID
=
{
4567
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
Grid
item
>
<
Icon
plantName
=
{
"
Woofy!
"
}
plantID
=
{
1234
}
sse
=
{
this
.
sse
}
/
>
<
/Grid
>
<
/Grid
>
<
/div
>
);
}
}
export
default
App
;
Loading