Loading vospace-ui-frontend/src/api/server/index.js +11 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,17 @@ export default { } }, false, true); }, loadNodeCollections() { let url = BASE_API_URL + 'collections'; return apiRequest({ method: 'GET', url: url, withCredentials: true, headers: { 'Cache-Control': 'no-cache' } }, false, true); }, getUserInfo() { let url = BASE_API_URL + 'user'; return apiRequest({ Loading vospace-ui-frontend/src/components/Collections.vue 0 → 100644 +62 −0 Original line number Diff line number Diff line <!-- This file is part of vospace-ui Copyright (C) 2021 Istituto Nazionale di Astrofisica SPDX-License-Identifier: GPL-3.0-or-later --> <template> <div> <b-button variant="primary" class="float-right" @click="loadCollections">Reload</b-button> <h3>Collections</h3> <div v-if="jobs.length > 0" class="mb-3"> <table class="table b-table table-striped table-hover"> <thead> <tr> <th>Id</th> <th>Title</th> </tr> </thead> <tbody> <tr v-for="job in jobs" :key="job.id"> <td>{{job.type}}</td> <td>{{job.creationTime}}</td> <td>{{job.id}}</td> <td><a :href="'download?jobId=' + job.id" v-if="job.phase === 'COMPLETED' && job.type === 'ARCHIVE'">Download archive</a></td> <td>{{job.phase}}</td> </tr> </tbody> </table> </div> <div v-if="jobs.length === 0"> No jobs </div> <div id="jobs-loading" v-if="jobsLoading" class="loading"> <div class="spinner-wrapper"> <b-spinner variant="primary" style="width: 3rem; height: 3rem;" label="Loading"></b-spinner> </div> </div> <FAQModal/> </div> </template> <script> import FAQModal from './modal/FAQModal.vue' export default { components: { FAQModal }, computed: { jobs() { return this.$store.state.jobs }, jobsLoading() { return this.$store.state.jobsLoading } }, mounted() { this.loadJobs(); this.$store.commit('setLoading', false); }, methods: { loadJobs() { this.$store.dispatch('loadJobs'); } } } </script> vospace-ui-frontend/src/components/CollectionsMenuItem.vue 0 → 100644 +13 −0 Original line number Diff line number Diff line <!-- This file is part of vospace-ui Copyright (C) 2021 Istituto Nazionale di Astrofisica SPDX-License-Identifier: GPL-3.0-or-later --> <template> <b-navbar-nav v-if="this.$store.state.user !== 'anonymous'"> <b-nav-item href="#/collections"> <strong>Collections</strong> </b-nav-item> </b-navbar-nav> </template> } No newline at end of file vospace-ui-frontend/src/components/TopMenu.vue +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ <b-navbar toggleable="lg" type="dark" id="top-menu"> <b-navbar-brand href="#/" class="d-none d-md-block">VOSpace<sup><b>v1.0</b></sup></b-navbar-brand> <JobsMenuItem /> <CollectionsMenuItem /> <b-navbar-nav class="ml-auto"> <!--<b-nav-item right v-b-modal.modal-faq href="#">FAQ</b-nav-item>--> <FAQMenuItem /> Loading @@ -22,11 +23,13 @@ <script> import JobsMenuItem from './JobsMenuItem.vue'; import CollectionsMenuItem from './CollectionsMenuItem.vue'; import FAQMenuItem from './FAQMenuItem.vue'; export default { components: { JobsMenuItem, CollectionsMenuItem, FAQMenuItem }, computed: { Loading vospace-ui-frontend/src/router.js +15 −11 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import VueRouter from 'vue-router'; import Main from './components/Main.vue'; import Jobs from './components/Jobs.vue'; import Collections from './components/Collections.vue' export default new VueRouter({ routes: [{ Loading @@ -19,5 +20,8 @@ export default new VueRouter({ }, { path: '/jobs', component: Jobs }, { path: '/collections', component: Collections }] }) Loading
vospace-ui-frontend/src/api/server/index.js +11 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,17 @@ export default { } }, false, true); }, loadNodeCollections() { let url = BASE_API_URL + 'collections'; return apiRequest({ method: 'GET', url: url, withCredentials: true, headers: { 'Cache-Control': 'no-cache' } }, false, true); }, getUserInfo() { let url = BASE_API_URL + 'user'; return apiRequest({ Loading
vospace-ui-frontend/src/components/Collections.vue 0 → 100644 +62 −0 Original line number Diff line number Diff line <!-- This file is part of vospace-ui Copyright (C) 2021 Istituto Nazionale di Astrofisica SPDX-License-Identifier: GPL-3.0-or-later --> <template> <div> <b-button variant="primary" class="float-right" @click="loadCollections">Reload</b-button> <h3>Collections</h3> <div v-if="jobs.length > 0" class="mb-3"> <table class="table b-table table-striped table-hover"> <thead> <tr> <th>Id</th> <th>Title</th> </tr> </thead> <tbody> <tr v-for="job in jobs" :key="job.id"> <td>{{job.type}}</td> <td>{{job.creationTime}}</td> <td>{{job.id}}</td> <td><a :href="'download?jobId=' + job.id" v-if="job.phase === 'COMPLETED' && job.type === 'ARCHIVE'">Download archive</a></td> <td>{{job.phase}}</td> </tr> </tbody> </table> </div> <div v-if="jobs.length === 0"> No jobs </div> <div id="jobs-loading" v-if="jobsLoading" class="loading"> <div class="spinner-wrapper"> <b-spinner variant="primary" style="width: 3rem; height: 3rem;" label="Loading"></b-spinner> </div> </div> <FAQModal/> </div> </template> <script> import FAQModal from './modal/FAQModal.vue' export default { components: { FAQModal }, computed: { jobs() { return this.$store.state.jobs }, jobsLoading() { return this.$store.state.jobsLoading } }, mounted() { this.loadJobs(); this.$store.commit('setLoading', false); }, methods: { loadJobs() { this.$store.dispatch('loadJobs'); } } } </script>
vospace-ui-frontend/src/components/CollectionsMenuItem.vue 0 → 100644 +13 −0 Original line number Diff line number Diff line <!-- This file is part of vospace-ui Copyright (C) 2021 Istituto Nazionale di Astrofisica SPDX-License-Identifier: GPL-3.0-or-later --> <template> <b-navbar-nav v-if="this.$store.state.user !== 'anonymous'"> <b-nav-item href="#/collections"> <strong>Collections</strong> </b-nav-item> </b-navbar-nav> </template> } No newline at end of file
vospace-ui-frontend/src/components/TopMenu.vue +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ <b-navbar toggleable="lg" type="dark" id="top-menu"> <b-navbar-brand href="#/" class="d-none d-md-block">VOSpace<sup><b>v1.0</b></sup></b-navbar-brand> <JobsMenuItem /> <CollectionsMenuItem /> <b-navbar-nav class="ml-auto"> <!--<b-nav-item right v-b-modal.modal-faq href="#">FAQ</b-nav-item>--> <FAQMenuItem /> Loading @@ -22,11 +23,13 @@ <script> import JobsMenuItem from './JobsMenuItem.vue'; import CollectionsMenuItem from './CollectionsMenuItem.vue'; import FAQMenuItem from './FAQMenuItem.vue'; export default { components: { JobsMenuItem, CollectionsMenuItem, FAQMenuItem }, computed: { Loading
vospace-ui-frontend/src/router.js +15 −11 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import VueRouter from 'vue-router'; import Main from './components/Main.vue'; import Jobs from './components/Jobs.vue'; import Collections from './components/Collections.vue' export default new VueRouter({ routes: [{ Loading @@ -19,5 +20,8 @@ export default new VueRouter({ }, { path: '/jobs', component: Jobs }, { path: '/collections', component: Collections }] })