2024-11-02 18:41:13 +00:00
|
|
|
<template>
|
2024-11-03 17:54:42 +00:00
|
|
|
<Loading class="container" :loading="loading">
|
|
|
|
<Message v-if="error" type="danger">Error loading containers</Message>
|
|
|
|
<ul v-if="!loading && !error">
|
|
|
|
<li v-for="container in containers" :key="container.name">
|
|
|
|
{{ container.name }}
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</Loading>
|
2024-11-02 18:41:13 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2024-11-03 17:54:42 +00:00
|
|
|
import Loading from '@/components/Loading.vue'
|
|
|
|
import Message from '@/components/Message.vue'
|
|
|
|
import axios from 'axios'
|
|
|
|
|
2024-11-02 18:41:13 +00:00
|
|
|
export default {
|
2024-11-02 21:43:27 +00:00
|
|
|
name: 'Containers',
|
2024-11-03 17:54:42 +00:00
|
|
|
components: {
|
|
|
|
Loading,
|
|
|
|
Message,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
containers: [],
|
|
|
|
error: false,
|
|
|
|
loading: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async mounted() {
|
|
|
|
try {
|
|
|
|
this.containers = await axios.get(`${this.$api}/api/containers`)
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error)
|
|
|
|
this.error = true
|
|
|
|
} finally {
|
|
|
|
this.loading = false
|
|
|
|
}
|
|
|
|
},
|
2024-11-02 18:41:13 +00:00
|
|
|
}
|
|
|
|
</script>
|