Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
motion-grammar-example
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
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
JastAdd
motion-grammar-example
Commits
07b4d219
Commit
07b4d219
authored
2 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
pathetic try to make dashboard work
parent
09a6e225
No related branches found
No related tags found
No related merge requests found
Pipeline
#14019
failed
2 years ago
Stage: build
Stage: test
Stage: ragdoc
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dashboard/package-lock.json
+1
-0
1 addition, 0 deletions
dashboard/package-lock.json
dashboard/package.json
+1
-0
1 addition, 0 deletions
dashboard/package.json
dashboard/src/App.js
+63
-19
63 additions, 19 deletions
dashboard/src/App.js
with
65 additions
and
19 deletions
dashboard/package-lock.json
+
1
−
0
View file @
07b4d219
...
...
@@ -11,6 +11,7 @@
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"chokidar": "^3.5.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
This diff is collapsed.
Click to expand it.
dashboard/package.json
+
1
−
0
View file @
07b4d219
...
...
@@ -6,6 +6,7 @@
"@testing-library/jest-dom"
:
"^5.16.4"
,
"@testing-library/react"
:
"^13.3.0"
,
"@testing-library/user-event"
:
"^13.5.0"
,
"chokidar"
:
"^3.5.3"
,
"react"
:
"^18.2.0"
,
"react-dom"
:
"^18.2.0"
,
"react-scripts"
:
"5.0.1"
,
...
...
This diff is collapsed.
Click to expand it.
dashboard/src/App.js
+
63
−
19
View file @
07b4d219
import
logo
from
'
./logo.svg
'
;
import
'
./App.css
'
;
import
React
from
'
react
'
;
import
'
./index.css
'
;
function
App
()
{
return
(
<
div
className
=
"
App
"
>
<
header
className
=
"
App-header
"
>
<
img
src
=
{
logo
}
className
=
"
App-logo
"
alt
=
"
logo
"
/>
<
p
>
Edit
<
code
>
src
/
App
.
js
<
/code> and save to reload
.
<
/p
>
<
a
className
=
"
App-link
"
href
=
"
https://reactjs.org
"
target
=
"
_blank
"
rel
=
"
noopener noreferrer
"
>
Learn
React
<
/a
>
<
/header
>
<
/div
>
);
class
App
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
asts
:
[
"
t
"
],
contexts
:
{}
};
}
componentDidMount
()
{
const
ws
=
new
WebSocket
(
"
ws://localhost:7070/ast-events
"
);
var
self
=
this
ws
.
onopen
=
(
event
)
=>
{
ws
.
send
(
"
Hi
"
);
};
ws
.
onmessage
=
function
(
event
)
{
const
json
=
JSON
.
parse
(
event
.
data
);
try
{
if
((
json
.
event
=
"
data
"
))
{
var
asts
=
self
.
state
.
asts
.
slice
();
asts
.
push
(
event
.
data
);
const
contexts
=
{};
self
.
setState
({
asts
:
asts
,
contexts
:
contexts
});
}
}
catch
(
err
)
{
console
.
log
(
err
);
}
ws
.
send
(
"
Got Something, thx
"
);
};
}
render
()
{
const
astlist
=
this
.
state
.
asts
.
map
(
v
=>
{
return
(
<
li
key
=
{
v
}
>
entry
<
/li
>
)
})
return
(
<
div
className
=
"
App
"
>
<
header
className
=
"
App-header
"
>
<
img
src
=
{
logo
}
className
=
"
App-logo
"
alt
=
"
logo
"
/>
<
p
>
Edit
<
code
>
src
/
App
.
js
<
/code> and save to reload
.
<
/p
>
<
div
className
=
"
ast-history
"
>
<
ol
>
{
astlist
}
<
/ol
>
<
/div
>
<
/header
>
<
/div
>
);
}
}
export
default
App
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment