Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
frontend-pilot
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9ec117c0
authored
May 13, 2019
by
Belákovics Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add template view
parent
68796a64
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
22 deletions
+33
-22
src/img_temp/ubuntu.jpg
+0
-0
src/views/App.js
+18
-5
src/views/InstanceView.js
+2
-2
src/views/LoadingWrapper.js
+3
-1
src/views/TemplateView.js
+10
-14
No files found.
src/img_temp/ubuntu.jpg
View file @
9ec117c0
3.31 KB
|
W:
|
H:
9.93 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/views/App.js
View file @
9ec117c0
import
React
,
{
useState
}
from
"react"
;
import
React
,
{
useState
}
from
"react"
;
import
{
Grommet
,
Box
,
ResponsiveContext
}
from
"grommet"
;
import
{
Grommet
,
Box
,
ResponsiveContext
,
Grid
}
from
"grommet"
;
import
theme
from
"../style/Theme"
;
import
theme
from
"../style/Theme"
;
import
PageHeader
from
"./PageHeader"
;
import
PageHeader
from
"./PageHeader"
;
import
SideMenu
from
"./SideMenu"
;
import
SideMenu
from
"./SideMenu"
;
...
@@ -23,10 +23,23 @@ function App() {
...
@@ -23,10 +23,23 @@ function App() {
showSideBar
=
{
showSideBar
}
showSideBar
=
{
showSideBar
}
setShowSideBar
=
{
setShowSideBar
}
setShowSideBar
=
{
setShowSideBar
}
/
>
/
>
<
Box
flex
justify
=
"center"
direction
=
"row"
margin
=
"small"
>
<
Grid
<
InstanceView
/>
areas
=
{[
<
TemplateView
/>
{
name
:
"instances"
,
start
:
[
0
,
0
],
end
:
[
0
,
0
]
},
<
/Box
>
{
name
:
"templates"
,
start
:
[
1
,
0
],
end
:
[
1
,
0
]
}
]}
columns
=
{[
"flex"
,
"flex"
]}
rows
=
{[
"flex"
]}
gap
=
"small"
margin
=
"small"
>
<
Box
gridArea
=
"instances"
>
<
InstanceView
size
=
{
size
}
/
>
<
/Box
>
<
Box
gridArea
=
"templates"
>
<
TemplateView
size
=
{
size
}
/
>
<
/Box
>
<
/Grid
>
<
/Box
>
<
/Box
>
<
/Box
>
<
/Box
>
)}
)}
...
...
src/views/InstanceView.js
View file @
9ec117c0
...
@@ -18,7 +18,7 @@ const InstanceView = () => {
...
@@ -18,7 +18,7 @@ const InstanceView = () => {
return
(
return
(
<
LoadingWrapper
loading
=
{
isLoading
}
>
<
LoadingWrapper
loading
=
{
isLoading
}
>
<
Box
direction
=
"column"
margin
=
"small"
justify
=
"evenly"
align
=
"center"
>
<
Box
margin
=
"small"
justify
=
"evenly"
align
=
"center"
>
<
Heading
margin
=
"small"
>
Virtual
Machines
<
/Heading
>
<
Heading
margin
=
"small"
>
Virtual
Machines
<
/Heading
>
<
Button
<
Button
icon
=
{
<
ChapterAdd
/>
}
icon
=
{
<
ChapterAdd
/>
}
...
@@ -28,7 +28,7 @@ const InstanceView = () => {
...
@@ -28,7 +28,7 @@ const InstanceView = () => {
color
=
"darkbrand"
color
=
"darkbrand"
/>
/>
<
/Box
>
<
/Box
>
<
Box
flex
direction
=
"row"
wrap
=
"true"
justify
=
"evenly"
>
<
Box
flex
direction
=
"row"
wrap
justify
=
"evenly"
>
{
data
.
map
(
e
=>
(
{
data
.
map
(
e
=>
(
<
Card
<
Card
background
=
"brand"
background
=
"brand"
...
...
src/views/LoadingWrapper.js
View file @
9ec117c0
...
@@ -4,7 +4,9 @@ import { Spinning } from "grommet-controls";
...
@@ -4,7 +4,9 @@ import { Spinning } from "grommet-controls";
const
LoadingWrapper
=
({
loading
,
...
props
})
=>
{
const
LoadingWrapper
=
({
loading
,
...
props
})
=>
{
return
loading
?
(
return
loading
?
(
<
Spinning
kind
=
"three-bounce"
color
=
"brand"
size
=
"large"
/>
<
Box
margin
=
"small"
justify
=
"center"
align
=
"center"
flex
>
<
Spinning
kind
=
"three-bounce"
color
=
"brand"
size
=
"large"
/>
<
/Box
>
)
:
(
)
:
(
<
Box
{...
props
}
/
>
<
Box
{...
props
}
/
>
);
);
...
...
src/views/TemplateView.js
View file @
9ec117c0
...
@@ -37,7 +37,7 @@ const TemplateView = () => {
...
@@ -37,7 +37,7 @@ const TemplateView = () => {
return
(
return
(
<
LoadingWrapper
loading
=
{
isLoading
}
>
<
LoadingWrapper
loading
=
{
isLoading
}
>
<
Box
direction
=
"column"
margin
=
"small"
justify
=
"evenly"
align
=
"center"
>
<
Box
margin
=
"small"
justify
=
"evenly"
align
=
"center"
>
<
Heading
margin
=
"small"
>
Templates
<
/Heading
>
<
Heading
margin
=
"small"
>
Templates
<
/Heading
>
<
Button
<
Button
icon
=
{
<
ChapterAdd
/>
}
icon
=
{
<
ChapterAdd
/>
}
...
@@ -47,24 +47,20 @@ const TemplateView = () => {
...
@@ -47,24 +47,20 @@ const TemplateView = () => {
color
=
"darkbrand"
color
=
"darkbrand"
/>
/>
<
/Box
>
<
/Box
>
<
Box
direction
=
"row"
wrap
justify
=
"evenly"
>
<
Box
flex
direction
=
"row"
wrap
justify
=
"evenly"
>
{
mockData
.
map
(
e
=>
(
{
mockData
.
map
(
e
=>
(
<
Box
margin
=
"small"
>
<
Box
margin
=
"small"
>
<
Stack
>
<
Stack
anchor
=
"bottom-left"
>
{
e
.
os
===
"windows"
?
(
{
e
.
os
===
"windows"
?
(
<
Image
<
Box
>
src
=
{
WindowsImage
}
<
Image
src
=
{
WindowsImage
}
style
=
{{
height
:
"250px"
}}
/
>
fit
=
"contain"
<
/Box
>
style
=
{{
height
:
"250px"
}}
/
>
)
:
(
)
:
(
<
Image
<
Box
>
src
=
{
UbuntuImage
}
<
Image
src
=
{
UbuntuImage
}
style
=
{{
height
:
"250px"
}}
/
>
fit
=
"contain"
<
/Box
>
style
=
{{
height
:
"250px"
}}
/
>
)}
)}
<
Box
background
=
"#666666CC"
>
<
Box
background
=
"#666666CC"
style
=
{{
width
:
"250px"
}}
>
<
Text
margin
=
"small"
>
{
e
.
name
}
<
/Text
>
<
Text
margin
=
"small"
>
{
e
.
name
}
<
/Text
>
<
/Box
>
<
/Box
>
<
/Stack
>
<
/Stack
>
...
...
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