-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
240 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
client/src/components/Dataset/DatasetStorage/DatasetStorage.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<template> | ||
<div> | ||
<h3 v-if="includeTitle">Dataset Storage</h3> | ||
<loading-span v-if="storageInfo == null"> </loading-span> | ||
<div v-else> | ||
<p v-if="storageInfo.name"> | ||
This data is stored in a Galaxy ObjectStore named <b>{{ storageInfo.name }}</b | ||
>. | ||
</p> | ||
<p v-if="storageInfo.object_store_id"> | ||
This data is stored in a Galaxy ObjectStore with id <b>{{ storageInfo.object_store_id }}</b | ||
>. | ||
</p> | ||
<div v-html="descriptionRendered"></div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import axios from "axios"; | ||
import { getAppRoot } from "onload/loadConfig"; | ||
import LoadingSpan from "components/LoadingSpan"; | ||
import MarkdownIt from "markdown-it"; | ||
const md = MarkdownIt(); | ||
export default { | ||
components: { | ||
LoadingSpan, | ||
}, | ||
props: { | ||
datasetId: { | ||
type: String, | ||
}, | ||
datasetType: { | ||
type: String, | ||
default: "hda", | ||
}, | ||
includeTitle: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
storageInfo: null, | ||
descriptionRendered: null, | ||
}; | ||
}, | ||
created() { | ||
const datasetId = this.datasetId; | ||
const datasetType = this.datasetType; | ||
axios | ||
.get(`${getAppRoot()}api/datasets/${datasetId}/storage?hda_ldda=${datasetType}`) | ||
.then(this.handleResponse) | ||
.catch(this.handleError); | ||
}, | ||
methods: { | ||
handleResponse(response) { | ||
console.log(response); | ||
this.storageInfo = response.data; | ||
this.descriptionRendered = md.render(this.storageInfo.description); | ||
}, | ||
handleError(err) { | ||
console.log(err); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export { default as DatasetStorage } from "./DatasetStorage"; | ||
|
||
// functions for mounting job metrics in non-Vue environments | ||
export { mountDatasetStorage } from "./mount"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Endpoint for mounting job metrics from non-Vue environment. | ||
*/ | ||
import DatasetStorage from "./DatasetStorage.vue"; | ||
import { mountVueComponent } from "utils/mountVueComponent"; | ||
|
||
export const mountDatasetStorage = (propsData = {}) => { | ||
const elements = document.querySelectorAll(".dataset-storage"); | ||
Array.prototype.forEach.call(elements, function (el, i) { | ||
const datasetId = el.getAttribute("dataset_id"); | ||
const datasetType = el.getAttribute("dataset_type") || "hda"; | ||
propsData.datasetId = datasetId; | ||
propsData.datasetType = datasetType; | ||
mountVueComponent(DatasetStorage)(propsData, el); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters