Skip to content

Commit

Permalink
Merge pull request #489 from AudiovisualMetadataPlatform/AMP-3006_aut…
Browse files Browse the repository at this point in the history
…hMedia

AMP-2990/AMP-3006:
  • Loading branch information
yingfeng-iu authored Oct 15, 2023
2 parents 104c308 + 7fe49d1 commit 13bb1b5
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
15 changes: 8 additions & 7 deletions src/components/dashboard/DashboardTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@
<td v-if="checkAvailability('itemName')">{{ rec.itemName }}</td>
<td v-if="checkAvailability('primaryfileName') && canAccessLink(rec, true)">
<a
v-bind:href="
workflowResultService.getSourceUrl(rec.primaryfileId)
"
href="#"
@click="workflowResultService.getSourceUrl(rec.primaryfileId)"
target="_blank"
class="complete-output"
>{{ rec.primaryfileName }}</a
Expand All @@ -155,7 +154,8 @@
outputReady(rec)"
>
<a
v-bind:href="workflowResultService.getOutputUrl(rec.id)"
href="#"
@click="workflowResultService.getOutputUrl(rec.id)"
target="_blank"
class="complete-output"
>{{ rec.outputName }}</a
Expand All @@ -173,7 +173,8 @@
outputReady(rec)"
>
<a
v-bind:href="workflowResultService.getOutputUrl(rec.id)"
href="#"
@click="workflowResultService.getOutputUrl(rec.id)"
target="_blank"
class="complete-output"
>{{ rec.outputLabel }}</a
Expand Down Expand Up @@ -517,8 +518,8 @@ export default {
canAccessLink(result, forMedia) {
// get units for media or output
let units = forMedia ? this.acUnitsMedia : this.acUnitsOutput;
console.log("forMedia: " + forMedia);
console.log("units: " + units);
// console.log("forMedia: " + forMedia);
// console.log("units: " + units);
return this.acIsAdmin || units && units.includes(result.unitId);
},
handleDeleteRow() {
Expand Down
3 changes: 2 additions & 1 deletion src/components/entity/EntityList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1354,9 +1354,10 @@ export default {
self.showEdit = false;
}
} else if (self.baseUrl === "file") {
let mediaSourceUrl = self.workflowResultService.getSourceUrl(
let mediaSourceUrl = await self.workflowResultService.getSourceLink(
self.selectedFile.id
);
console.log("mediaSourceUrl = " + mediaSourceUrl);
let mediaSourceType = await self.primaryFileService.getPrimaryFile(
self.selectedFile.id
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/entity/OutputFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
disabled
/> -->
<a
:href="workflowResultService.getOutputUrl(output.id)"
href="#"
@click="workflowResultService.getOutputUrl(output.id)"
class="complete-output"
target="_blank"
v-if="
Expand Down
7 changes: 2 additions & 5 deletions src/components/evaluation/TestResultsVisualiz.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@
>
(<a
class="scores-files"
v-bind:href="
workflowResultService.getOutputUrl(
testResult.workflowResult.id
)
"
href="#"
@click="workflowResultService.getOutputUrl(testResult.workflowResult.id)"
target="_blank"
>{{
testResult.workflowResult.workflowStep
Expand Down
27 changes: 21 additions & 6 deletions src/service/workflow-result-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,28 @@ export default class WorkflowResultService extends BaseService {
return data;
}

getSourceUrl(primaryfileId) {
const url = `${this.API_URL}/primaryfiles/${primaryfileId}/media`;
return url;
async getSourceLink(primaryfileId) {
const url = `/primaryfiles/${primaryfileId}/media`;
var symlink = await super.get_auth(url).then((result) => {
return result.headers['location'];
});
return symlink;
}

async getSourceUrl(primaryfileId) {
const url = `/primaryfiles/${primaryfileId}/media`;
var content = await super.get_auth(url).then((result) => {
return result.data;
});
return content;
}
getOutputUrl(id) {
const url = `${this.API_URL}/workflow-results/${id}/output`;
return url;

async getOutputUrl(id) {
const url = `/workflow-results/${id}/output`;
var content = await super.get_auth(url).then((result) => {
return result.data;
});
return content;
}

async deleteWorkflowResult(id) {
Expand Down

0 comments on commit 13bb1b5

Please sign in to comment.