Skip to content

Commit 9701e79

Browse files
Fix errors in output-file-processing and modify/add example
1 parent daba330 commit 9701e79

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed

viplab-standalone-frontend-vue/.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
VUE_APP_FILENAME = viplab-computation-template
1+
VUE_APP_FILENAME = case_1.computation-template
2+
#leap-year.computation-template
23
#case_1.computation-template
34
#viplab-computation-template
45
#teacher-frontend-test

viplab-standalone-frontend-vue/src/input/case_1.computation-template.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@
3838
"vtk": [
3939
{
4040
"basename": "case1_single_tracer_matrix"
41+
},
42+
{
43+
"basename": "case1_single_tracer_fracture"
44+
},
45+
{
46+
"basename": "case1_single_onep_matrix"
47+
},
48+
{
49+
"basename": "case1_single_onep_fracture"
4150
}
4251
]
4352
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"identifier": "06fe1cab-0a1a-430a-91c5-badf539189a5",
3+
"version": "3.0.0",
4+
"metadata": {
5+
"displayName": "Leap Year Tester",
6+
"description": "Check whether a year is a leap year."
7+
},
8+
"environment": "Container",
9+
"files": [
10+
{
11+
"identifier": "22701b37-0a8f-405c-a89b-c31be7cd4b89",
12+
"path": "run.py",
13+
"metadata" : {
14+
"syntaxHighlighting": "python"
15+
},
16+
"parts": [
17+
{
18+
"identifier": "ceb051d8-b50c-4814-983a-b9d703cae0c6",
19+
"access": "modifiable",
20+
"metadata": {
21+
"name": "Code for checking year"
22+
},
23+
"content": "IyB5ZWFyIHRvIGNoZWNrDQp5ZWFyID0gMjAyMA0KDQojIGlmIHllYXIgY2FuIGJlIGRpdmlkZWQgYnkgNDAwIGFuZCAxMDAsIA0KIyBpdCBpcyBsZWFwIHllYXINCmlmICh5ZWFyICUgNDAwID09IDApIGFuZCAoeWVhciAlIDEwMCA9PSAwKToNCiAgICBwcmludCh5ZWFyLCAiaXMgYSBsZWFwIHllYXIiKQ0KDQojIGlmIHllYXIgY2FuIGJlIGRpdmlkZWQgYnkgNCwgYnV0IG5vdCBieSAxMDAsIA0KIyBpdCBpcyBhIGxlYXAgeWVhcg0KZWxpZiAoeWVhciAlIDQgPT0wKSBhbmQgKHllYXIgJSAxMDAgIT0gMCk6DQogICAgcHJpbnQoeWVhciwgImlzIGEgbGVhcCB5ZWFyIikNCg0KIyBlbHNlOiB5ZWFyIGlzIG5vdCBsZWFwIHllYXINCmVsc2U6DQogICAgcHJpbnQoeWVhciwgImlzIG5vdCBhIGxlYXAgeWVhciIp"
24+
}
25+
]
26+
}
27+
],
28+
"configuration" : {
29+
"resources.image": "name://leap-year-tester",
30+
"resources.volume": "/data/shared",
31+
"resources.memory": "1g",
32+
"resources.numCPUs": 1
33+
}
34+
}

viplab-standalone-frontend-vue/src/pages/viplab/App.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -942,10 +942,12 @@ export default {
942942
this.returnedUnmodifiedArtifacts = JSON.parse(JSON.stringify(result.result))
943943
} else {
944944
// TODO: Muss eventuell mit this.$set gemacht werden, damit gui auch geupdated wird; nötig erst wenn intermediate results im Backend möglich
945-
this.returnedOutputJson.artifacts.push(JSON.parse(JSON.stringify(result.result.artifacts)));
946-
this.returnedUnmodifiedArtifacts.artifacts.push(JSON.parse(JSON.stringify(result.result.artifacts)))
945+
this.returnedOutputJson.artifacts = this.returnedOutputJson.artifacts.concat(JSON.parse(JSON.stringify(result.result.artifacts)));
946+
this.returnedUnmodifiedArtifacts.artifacts = this.returnedUnmodifiedArtifacts.artifacts.concat(JSON.parse(JSON.stringify(result.result.artifacts)))
947947
}
948948
949+
this.returnedUnmodifiedArtifacts.artifacts.sort((a,b) => (a.path > b.path) ? 1 : ((b.path > a.path) ? -1 : 0))
950+
949951
// filter result such that only specified results are displayed
950952
let viewer = [];
951953
if (typeof this.json.metadata !== 'undefined') {
@@ -1109,7 +1111,7 @@ export default {
11091111
11101112
// filter returnedOutputJson to only include displayable results
11111113
this.returnedOutputJson.artifacts = this.returnedOutputJson.artifacts.filter(function (value) {
1112-
let displayableMIMEtypes = ["text/plain", "text/uri-list", "image/png", "image/jpeg", "application/x-vgf", "application/x-vgf3", "application/x-vgfc", "application/vnd.kitware", "application/json"];
1114+
let displayableMIMEtypes = ["text/plain", "text/csv", "text/uri-list", "image/png", "image/jpeg", "application/x-vgf", "application/x-vgf3", "application/x-vgfc", "application/vnd.kitware", "application/json"];
11131115
if (displayableMIMEtypes.includes(value.MIMEtype)) {
11141116
return value;
11151117
}

0 commit comments

Comments
 (0)