mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
START command: Use a list of urls for all associated files instead of just one file
This commit is contained in:
parent
d4b9acd08d
commit
9037e6494b
2 changed files with 14 additions and 5 deletions
|
@ -182,8 +182,12 @@ class ICAction extends React.Component {
|
|||
newAction["model"] = {}
|
||||
newAction.model["type"] = "url"
|
||||
newAction.model["token"] = this.props.token
|
||||
// TODO do not default to the first file of the config
|
||||
newAction.model["url"] = "/files/" + config.fileIDs[0].toString()
|
||||
|
||||
let fileURLs = []
|
||||
for (let fileID of config.fileIDs){
|
||||
fileURLs.push("/files/" + fileID.toString())
|
||||
}
|
||||
newAction.model["url"] = fileURLs
|
||||
}
|
||||
|
||||
newAction["results"] = {}
|
||||
|
|
|
@ -91,9 +91,14 @@ class InfrastructureComponentStore extends ArrayStore {
|
|||
a.results.url = window.location.host + a.results.url;
|
||||
}
|
||||
if (a.model !== undefined && a.model != null && JSON.stringify(a.model) !== JSON.stringify({})) {
|
||||
// adapt URL for model file
|
||||
a.model.url = ICsDataManager.makeURL(a.model.url);
|
||||
a.model.url = window.location.host + a.model.url;
|
||||
// adapt URL(s) for model file
|
||||
let modelURLs = []
|
||||
for (let url of a.model.url){
|
||||
let modifiedURL = ICsDataManager.makeURL(url);
|
||||
modifiedURL = window.location.host + modifiedURL;
|
||||
modelURLs.push(modifiedURL)
|
||||
}
|
||||
a.model.url = modelURLs
|
||||
}
|
||||
ICsDataManager.doActions(a.icid, [a], action.token)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue