Skip to content

Commit daba330

Browse files
Stop displaying Files- and Downloads-Tab, if there is nothing to display
1 parent fe542bb commit daba330

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

viplab-standalone-frontend-vue/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VUE_APP_FILENAME = hello-world.docker-container-example
1+
VUE_APP_FILENAME = viplab-computation-template
22
#case_1.computation-template
33
#viplab-computation-template
44
#teacher-frontend-test

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,10 @@
66
"description": "Case 1: Single Fracture",
77
"output": {
88
"viewer": [
9-
"CSV",
10-
"ParaView"
11-
],
12-
"csv": [
13-
{
14-
"basename": "dataovertime",
15-
"xlabel": {
16-
"key": "time",
17-
"label": "Time in years",
18-
"factor": 3.1709792e-8,
19-
"format": ".2f"
20-
}
21-
}
229
],
2310
"vtk": [
2411
{
25-
"basename": "case1_single_tracer_matrix"
12+
"basename": "1ptestfv"
2613
}
2714
]
2815
}

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,12 @@
257257
<ansi-output :divId="'stderr-div'" :content="errorFiles"></ansi-output>
258258
</div>
259259
</b-tab>
260-
260+
<!-- TODO: Only show tabs if necessary-->
261261
<b-tab
262262
title="Files"
263263
ref="artifact"
264264
class="artifact"
265+
v-if="returnedOutputJson.artifacts.length > 0"
265266
>
266267
<div id="fileList" class="mt-2" v-if="outputFiles !== ''">
267268
<h3>Files</h3>
@@ -505,6 +506,7 @@
505506
title="Downloads"
506507
ref="artifact"
507508
class="artifact"
509+
v-if="returnedUnmodifiedArtifacts.artifacts.length > 0"
508510
>
509511
<div id="downloadFiles">
510512
<h3>Files to Download</h3>
@@ -1104,6 +1106,14 @@ export default {
11041106
this.returnedOutputJson.artifacts.push(connectedVtks[connectedFilesKeys[c]]);
11051107
}
11061108
}
1109+
1110+
// filter returnedOutputJson to only include displayable results
1111+
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"];
1113+
if (displayableMIMEtypes.includes(value.MIMEtype)) {
1114+
return value;
1115+
}
1116+
});
11071117
11081118
//TODO: Vars nicht überschreiben, sondern ergänzen für intermediate
11091119
this.outputFiles = base64url.decode(result.result.output.stdout);

0 commit comments

Comments
 (0)