| 1 | <template> |
| 2 | <div> |
| 3 | <CardEntity :embedded :clickable="selectable" :disabled hoverable> |
| 4 | <template #default> |
| 5 | <div class="flex items-center gap-3"> |
| 6 | <div v-if="selectable" class="check-box mr-2"> |
| 7 | <n-radio v-model:checked="checked" size="large" /> |
| 8 | </div> |
| 9 | <div class="flex flex-col gap-1"> |
| 10 | {{ data.name }} |
| 11 | <p> |
| 12 | {{ data.description }} |
| 13 | </p> |
| 14 | </div> |
| 15 | </div> |
| 16 | </template> |
| 17 | |
| 18 | <template #footerMain> |
| 19 | <div class="flex flex-wrap items-center gap-3"> |
| 20 | <code class="py-1">Auth Keys:</code> |
| 21 | <Badge v-for="authKey of data.keys" :key="authKey.auth_key_name"> |
| 22 | <template #value> |
| 23 | {{ authKey.auth_key_name }} |
| 24 | </template> |
| 25 | </Badge> |
| 26 | </div> |
| 27 | </template> |
| 28 | <template #footerExtra> |
| 29 | <n-button size="small" @click.stop="showDetails = true"> |
| 30 | <template #icon> |
| 31 | <Icon :name="InfoIcon" /> |
| 32 | </template> |
| 33 | Details |
| 34 | </n-button> |
| 35 | </template> |
| 36 | </CardEntity> |
| 37 | |
| 38 | <n-modal |
| 39 | v-model:show="showDetails" |
| 40 | preset="card" |
| 41 | :style="{ maxWidth: 'min(800px, 90vw)', minHeight: 'min(400px, 90vh)', overflow: 'hidden' }" |
| 42 | :title="data.name" |
| 43 | :bordered="false" |
| 44 | segmented |
| 45 | > |
| 46 | <Markdown :source="data.details" /> |
| 47 | </n-modal> |
| 48 | </div> |
| 49 | </template> |
| 50 | |
| 51 | <script setup lang="ts"> |
| 52 | import type { ServiceItemData, ServiceItemType } from "./types" |
| 53 | import { NButton, NModal, NRadio } from "naive-ui" |
| 54 | import { defineAsyncComponent, ref, toRefs } from "vue" |
| 55 | import Badge from "@/components/common/Badge.vue" |
| 56 | import CardEntity from "@/components/common/cards/CardEntity.vue" |
| 57 | import Icon from "@/components/common/Icon.vue" |
| 58 | |
| 59 | const props = defineProps<{ |
| 60 | data: ServiceItemData |
| 61 | type: ServiceItemType |
| 62 | embedded?: boolean |
| 63 | checked?: boolean |
| 64 | selectable?: boolean |
| 65 | disabled?: boolean |
| 66 | }>() |
| 67 | |
| 68 | const Markdown = defineAsyncComponent(() => import("@/components/common/Markdown.vue")) |
| 69 | |
| 70 | const { data, embedded, checked, selectable, disabled } = toRefs(props) |
| 71 | |
| 72 | const InfoIcon = "carbon:information" |
| 73 | |
| 74 | const showDetails = ref(false) |
| 75 | </script> |