Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VILLASweb
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACS
Public
VILLASframework
VILLASweb
Commits
3312caea
Commit
3312caea
authored
5 years ago
by
Richard Marston
Browse files
Options
Downloads
Patches
Plain Diff
Link Villas to Pintura for demo. NOT FOR DEVELOP BRANCH.
parent
b1638cd1
No related branches found
Tags
edit-simulation-models-within-pintura
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/containers/select-file.js
+28
-12
28 additions, 12 deletions
src/containers/select-file.js
src/containers/simulation-model.js
+1
-1
1 addition, 1 deletion
src/containers/simulation-model.js
with
29 additions
and
13 deletions
src/containers/select-file.js
+
28
−
12
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
}
>
...
...
This diff is collapsed.
Click to expand it.
src/containers/simulation-model.js
+
1
−
1
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
}
/
>
...
...
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