This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch delta-topology-workshop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/delta-topology-workshop by
this push:
new 0ccf4af Replace VNC info with the contents of the job HTML file
0ccf4af is described below
commit 0ccf4af2ee9f68e012d1fd02ee35b68e97fc591d
Author: Marcus Christie <[email protected]>
AuthorDate: Tue Oct 12 17:31:40 2021 -0400
Replace VNC info with the contents of the job HTML file
---
.../js/components/experiment/ExperimentSummary.vue | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git
a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentSummary.vue
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentSummary.vue
index 8c24d02..8387e10 100644
---
a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentSummary.vue
+++
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentSummary.vue
@@ -93,8 +93,9 @@
<tr v-if="experiment.isProgressing">
<th scope="row">VNC URL</th>
<td>
- <a v-if="vncURL" :href="vncURL">View VNC</a>
- <em v-else>Please wait for the VNC URL to be available
when the job is active.</em>
+ <div ref="vncInfo">
+ Please wait for the VNC URL to be available when the job
is active.
+ </div>
</td>
</tr>
<tr>
@@ -311,7 +312,6 @@ export default {
data() {
return {
localFullExperiment: this.fullExperiment.clone(),
- vncURL: null,
};
},
components: {
@@ -473,18 +473,19 @@ export default {
}
},
async localFullExperiment() {
+ let vncInfo = "Please wait for the VNC URL to be available when the job
is active.";
if (this.localFullExperiment.jobDetails &&
this.localFullExperiment.jobDetails.length > 0 &&
this.localFullExperiment.jobDetails[0].jobStatusStateName === 'ACTIVE') {
const url =
`/static/vnc/${encodeURIComponent(this.localFullExperiment.jobDetails[0].jobName)}.html`;
// Check that the html file exists
const response = await fetch(url);
if (response.ok) {
- this.vncURL = url;
- } else {
- this.vncURL = null;
+ // Grab the text from the HTML file's body tag and replace vncInfo
+ const parser = new DOMParser();
+ const doc = parser.parseFromString(await response.text(),
'text/html');
+ vncInfo = doc.querySelector('body').textContent;
}
- } else {
- this.vncURL = null;
}
+ this.$refs.vncInfo.textContent = vncInfo;
}
},
mounted: function () {