@@ -1054,10 +1054,20 @@ export default {
10541054 // process connected vtu/vtk & csv files
10551055 let connectedVtks = {};
10561056 let { artifacts } = this .returnedOutputJson ;
1057- // let created = false;
1057+ // isNew flag to ensure that connected files are only added once
1058+ artifacts .forEach ( (artifact ) => {
1059+ if (artifact .basename ) {
1060+ connectedVtks[artifact .basename ] = artifact;
1061+ connectedVtks[artifact .basename ].isNew = false ;
1062+ }
1063+ });
10581064
10591065 // sort result artifacts alphabetically to make sure that connected files are in correct order
1060- artifacts .sort ((a , b ) => a .path .localeCompare (b .path ));
1066+ artifacts .sort ((a , b ) => {
1067+ let a_path = a .path ?? a .basename ;
1068+ let b_path = b .path ?? b .basename ;
1069+ return a_path .localeCompare (b_path);
1070+ });
10611071
10621072 // get basenames for collections of files
10631073 let outputConfig = [];
@@ -1088,12 +1098,14 @@ export default {
10881098 connectedVtks[currentBasename].urlsOrContents = [];
10891099 connectedVtks[currentBasename].plots = currentConfig .plots ;
10901100 connectedVtks[currentBasename].xlabel = currentConfig .xlabel ;
1101+ connectedVtks[currentBasename].isConnected = true ;
1102+ connectedVtks[currentBasename].isNew = true ;
10911103 }
10921104 }
10931105
10941106 // group results according to the available basenames
10951107 for (let a = 0 ; a < artifacts .length ; a += 1 ) {
1096- if ((artifacts[a].MIMEtype === ' application/vnd.kitware' || artifacts[a].MIMEtype === ' text/csv' ) && ! artifacts[a].artifacts ) {
1108+ if ((artifacts[a].MIMEtype === ' application/vnd.kitware' || artifacts[a].MIMEtype === ' text/csv' ) && ! artifacts[a].isConnected ) {
10971109 const { path } = artifacts[a];
10981110 const lastIndex = path .lastIndexOf (' /' );
10991111 const filenamePart = path .substr (lastIndex + 1 , path .length );
@@ -1102,7 +1114,6 @@ export default {
11021114 const currentBasename = basenames[base];
11031115 // filename has to start with basename
11041116 if (filenamePart .startsWith (currentBasename)) {
1105- // console.log(currentBasename + " - " + filenamePart);
11061117 connectedVtks[currentBasename].type = artifacts[a].type ;
11071118 connectedVtks[currentBasename].MIMEtype = artifacts[a].MIMEtype ;
11081119 connectedVtks[currentBasename].basename = currentBasename;
@@ -1130,7 +1141,7 @@ export default {
11301141 // delete all vtk and csv artifacts that are part of a collection
11311142 artifacts = this .returnedOutputJson .artifacts ;
11321143 let b = artifacts .length - 1 ;
1133- while (b > 0 ) {
1144+ while (b >= 0 ) {
11341145 if (artifacts[b].inCollection ) {
11351146 artifacts .splice (b, 1 );
11361147 }
@@ -1140,7 +1151,9 @@ export default {
11401151 // add vtk/csv collections
11411152 const connectedFilesKeys = Object .keys (connectedVtks);
11421153 for (let c = 0 ; c < connectedFilesKeys .length ; c += 1 ) {
1143- this .returnedOutputJson .artifacts .push (connectedVtks[connectedFilesKeys[c]]);
1154+ if (connectedVtks[connectedFilesKeys[c]].isNew && connectedVtks[connectedFilesKeys[c]].urlsOrContents .length > 0 ) {
1155+ this .returnedOutputJson .artifacts .push (connectedVtks[connectedFilesKeys[c]]);
1156+ }
11441157 }
11451158 }
11461159
@@ -1160,9 +1173,9 @@ export default {
11601173 }
11611174 });
11621175
1163- // TODO: Vars nicht überschreiben, sondern ergänzen für intermediate
11641176 this .outputFiles = this .outputFiles .concat (base64url .decode (result .result .output .stdout ));
11651177 this .errorFiles = this .errorFiles .concat (base64url .decode (result .result .output .stderr ));
1178+ this .$forceUpdate ();
11661179 },
11671180 /** get content from s3 */
11681181 async getContentFromS3 (url , isViPLabGraphics = false ) {
0 commit comments