Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
VILLASweb
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
50
Issues
50
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
ACS
P
Public
VILLASframework
VILLASweb
Commits
3312caea
Commit
3312caea
authored
Sep 24, 2019
by
Richard Marston
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link Villas to Pintura for demo. NOT FOR DEVELOP BRANCH.
parent
b1638cd1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
13 deletions
+29
-13
src/containers/select-file.js
src/containers/select-file.js
+28
-12
src/containers/simulation-model.js
src/containers/simulation-model.js
+1
-1
No files found.
src/containers/select-file.js
View file @
3312caea
...
...
@@ -29,13 +29,24 @@ import UserStore from '../stores/user-store';
import
AppDispatcher
from
'
../app-dispatcher
'
;
class
SelectFile
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
type
:
props
.
type
}
}
static
getStores
()
{
return
[
FileStore
,
UserStore
];
}
static
calculateState
()
{
let
static_files
=
[
{
_id
:
"
1
"
,
name
:
"
Small Energy Consumer Example
"
,
url
:
"
http://137.226.248.190:8082?uri=http://137.226.248.190:4040/files/file1.xml
"
},
{
_id
:
"
2
"
,
name
:
"
WSCC-09_Neplan
"
,
url
:
"
http://137.226.248.190:8082?uri=http://137.226.248.190:4040/files/file2.zip
"
}
];
return
{
files
:
FileStore
.
getState
(),
files
:
static_files
,
pinturaUrl
:
static_files
[
0
].
url
,
sessionToken
:
UserStore
.
getState
().
token
,
selectedFile
:
''
,
uploadFile
:
null
,
...
...
@@ -75,6 +86,7 @@ class SelectFile extends React.Component {
const
file
=
this
.
state
.
files
.
find
(
f
=>
f
.
_id
===
event
.
target
.
value
);
this
.
props
.
onChange
(
file
);
this
.
setState
({
pinturaUrl
:
file
.
url
});
}
}
...
...
@@ -107,33 +119,37 @@ class SelectFile extends React.Component {
}
render
()
{
const
fileOptions
=
this
.
state
.
files
.
map
(
f
=>
<
option
key
=
{
f
.
_id
}
value
=
{
f
.
_id
}
>
{
f
.
name
}
<
/option
>
);
let
fileOptions
=
null
;
if
(
this
.
state
.
type
===
"
model
"
)
{
fileOptions
=
this
.
state
.
files
.
map
(
f
=>
<
option
key
=
{
f
.
_id
}
value
=
{
f
.
_id
}
>
{
f
.
name
}
<
/option
>
);
}
const
progressBarStyle
=
{
marginLeft
:
'
100px
'
,
marginTop
:
'
-25px
'
};
let
modelOption
=
<
Col
sm
=
{
9
}
md
=
{
5
}
>
<
Button
href
=
{
this
.
state
.
pinturaUrl
}
bsSize
=
'
small
'
target
=
"
_blank
"
rel
=
"
noopener noreferrer
"
>
Edit
Model
<
/Button
>
<
/Col>
;
let
option
=
this
.
state
.
type
===
"
model
"
?
modelOption
:
null
;
return
<
div
>
<
FormGroup
>
<
Col
componentClass
=
{
ControlLabel
}
sm
=
{
3
}
md
=
{
2
}
>
{
this
.
props
.
name
}
<
/Col
>
<
Col
sm
=
{
9
}
md
=
{
10
}
>
<
Col
sm
=
{
9
}
md
=
{
5
}
>
<
FormControl
disabled
=
{
this
.
props
.
disabled
}
componentClass
=
'
select
'
placeholder
=
'
Select file
'
onChange
=
{
this
.
handleChange
}
>
{
fileOptions
}
<
/FormControl
>
<
/Col
>
<
/FormGroup
>
<
FormGroup
>
<
Col
sm
=
{
9
}
md
=
{
10
}
smOffset
=
{
3
}
mdOffset
=
{
2
}
>
<
FormControl
disabled
=
{
this
.
props
.
disabled
}
type
=
'
file
'
onChange
=
{
this
.
selectUploadFile
}
/
>
<
/Col
>
<
/FormGroup
>
{
option
}
<
/FormGroup>
;
<
FormGroup
>
<
Col
sm
=
{
9
}
md
=
{
10
}
smOffset
=
{
3
}
mdOffset
=
{
2
}
>
...
...
src/containers/simulation-model.js
View file @
3312caea
...
...
@@ -135,7 +135,7 @@ class SimulationModel extends React.Component {
<
Col
xs
=
{
12
}
sm
=
{
12
}
>
<
SelectSimulator
onChange
=
{
this
.
handleSimulatorChange
}
value
=
{
this
.
state
.
simulationModel
.
simulator
}
/
>
<
SelectFile
disabled
type
=
'
model
'
name
=
'
Model
'
onChange
=
{
this
.
handleModelChange
}
value
=
{
this
.
state
.
simulationModel
.
model
}
/
>
<
SelectFile
type
=
'
model
'
name
=
'
Model
'
onChange
=
{
this
.
handleModelChange
}
value
=
{
this
.
state
.
simulationModel
.
model
}
/
>
<
SelectFile
disabled
type
=
'
configuration
'
name
=
'
Configuration
'
onChange
=
{
this
.
handleConfigurationChange
}
value
=
{
this
.
state
.
simulationModel
.
configuration
}
/
>
...
...
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