-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathManageIndex.vue
More file actions
91 lines (73 loc) · 3.5 KB
/
ManageIndex.vue
File metadata and controls
91 lines (73 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<script setup lang="ts">
import { BAlert } from "bootstrap-vue";
import { computed } from "vue";
import type { UserConcreteObjectStore } from "@/api/objectStores";
import type { TableField } from "@/components/Common/GTable.types";
import { DESCRIPTION_FIELD, NAME_FIELD, TEMPLATE_FIELD, TYPE_FIELD } from "@/components/ConfigTemplates/fields";
import { useInstanceTesting } from "@/components/ConfigTemplates/useConfigurationTesting";
import { useFiltering } from "@/components/ConfigTemplates/useInstanceFiltering";
import { useObjectStoreInstancesStore } from "@/stores/objectStoreInstancesStore";
import _l from "@/utils/localization";
import InstanceDropdown from "./InstanceDropdown.vue";
import GTable from "@/components/Common/GTable.vue";
import ManageIndexHeader from "@/components/ConfigTemplates/ManageIndexHeader.vue";
import LoadingSpan from "@/components/LoadingSpan.vue";
import ObjectStoreBadges from "@/components/ObjectStore/ObjectStoreBadges.vue";
import ObjectStoreTypeSpan from "@/components/ObjectStore/ObjectStoreTypeSpan.vue";
import TemplateSummarySpan from "@/components/ObjectStore/Templates/TemplateSummarySpan.vue";
const objectStoreInstancesStore = useObjectStoreInstancesStore();
interface Props {
message?: string;
}
defineProps<Props>();
const BADGE_FIELD: TableField = {
key: "badges",
label: _l(" "),
sortable: false,
};
const fields: TableField[] = [NAME_FIELD, DESCRIPTION_FIELD, TYPE_FIELD, TEMPLATE_FIELD, BADGE_FIELD];
const allItems = computed<UserConcreteObjectStore[]>(() => objectStoreInstancesStore.getInstances);
const { activeInstances } = useFiltering(allItems);
const loading = computed(() => objectStoreInstancesStore.loading);
objectStoreInstancesStore.fetchInstances();
function reload() {
objectStoreInstancesStore.fetchInstances();
}
const testInstanceUrl = "/api/object_store_instances/{uuid}/test";
const { ConfigurationTestSummaryModal, showTestResults, testResults, test, testingError } =
useInstanceTesting(testInstanceUrl);
</script>
<template>
<div>
<ConfigurationTestSummaryModal v-model="showTestResults" :error="testingError" :test-results="testResults" />
<ManageIndexHeader header="Galaxy Storage" :message="message" create-route="/object_store_instances/create" />
<GTable
id="user-object-stores-index"
caption-top
fixed
hover
show-empty
striped
:fields="fields"
:items="activeInstances">
<template v-slot:empty>
<LoadingSpan v-if="loading" message="Loading Galaxy storage instances" />
<BAlert v-else id="no-object-store-instances" variant="info" show>
No Galaxy storage instances found, click the create button to configure a new one.
</BAlert>
</template>
<template v-slot:cell(badges)="{ item }">
<ObjectStoreBadges size="1x" :badges="item.badges" />
</template>
<template v-slot:cell(name)="{ item }">
<InstanceDropdown :object-store="item" @entryRemoved="reload" @test="test(item)" />
</template>
<template v-slot:cell(type)="{ item }">
<ObjectStoreTypeSpan :type="item.type" />
</template>
<template v-slot:cell(template)="{ item }">
<TemplateSummarySpan :template-version="item.template_version ?? 0" :template-id="item.template_id" />
</template>
</GTable>
</div>
</template>