Skip to content

Commit

Permalink
add ep info card
Browse files Browse the repository at this point in the history
  • Loading branch information
lindongchen committed Jun 19, 2024
1 parent fcdd756 commit f07f0ba
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gui/src/views/mesh/EndpointDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ref,onActivated,watch, computed } from "vue";
import { useRouter } from 'vue-router'
import PipyProxyService from '@/service/PipyProxyService';
import MeshSelector from './common/MeshSelector.vue';
import EndpointInfo from './EndpointInfo.vue';
import Services from './Services.vue';
import Ports from './Ports.vue';
import { useStore } from 'vuex';
Expand Down Expand Up @@ -65,6 +66,15 @@ const go = (path) => {
</AppHeader>
<div class="text-center">
<TabView class="" v-model:activeIndex="active">

<TabPanel>
<template #header>
<div>
<i class="pi pi-info-circle mr-2" />Info
</div>
</template>
<EndpointInfo :ep="props.ep"/>
</TabPanel>
<TabPanel>
<template #header>
<div>
Expand Down
77 changes: 77 additions & 0 deletions gui/src/views/mesh/EndpointInfo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<script setup>
import { ref, onMounted, computed, watch } from 'vue';
const props = defineProps(['ep','loading']);
const windowWidth = computed(() => window.innerWidth);
const isMobile = computed(() => windowWidth.value<=768);
</script>

<template>
<Loading v-if="props.loading" />
<div v-else-if="props.ep" class="md:m-3">
<BlockViewer containerClass="surface-section px-1 md:px-1 lg:px-1" >
<div >
<ul class="list-none p-0 m-0">
<FormItem label="Name">
<Chip class="pl-0 pr-3 mr-2">
<span class="bg-primary border-circle w-2rem h-2rem flex align-items-center justify-content-center">
<i class="pi pi-bookmark"/>
</span>
<span class="ml-2 font-medium">
{{props.ep?.name || 'Unknow'}}
</span>
</Chip>
</FormItem>
<FormItem label="Username">
<Chip class="pl-0 pr-3 mr-2">
<span class="bg-primary border-circle w-2rem h-2rem flex align-items-center justify-content-center">
<i class="pi pi-user"/>
</span>
<span class="ml-2 font-medium">
{{props.ep?.username || 'Unknow'}}
</span>
</Chip>
</FormItem>
<FormItem label="IP" v-if="props.ep?.ip">
<Chip class="pl-0 pr-3 mr-2">
<span class="bg-primary border-circle w-2rem h-2rem flex align-items-center justify-content-center">
<i class="pi pi-map-marker"/>
</span>
<span class="ml-2 font-medium">
{{props.ep?.ip || 'Unknow'}}
</span>
</Chip>
</FormItem>
<FormItem label="Port" v-if="props.ep?.port">
<Chip class="pl-0 pr-3 mr-2">
<span class="bg-primary border-circle w-2rem h-2rem flex align-items-center justify-content-center">
<i class="pi pi-sort"/>
</span>
<span class="ml-2 font-medium">
{{props.ep?.port || 'Unknow'}}
</span>
</Chip>
</FormItem>
</ul>
</div>
</BlockViewer>
</div>
<Empty v-else title="Unknow EP" :error="props.error"/>
</template>


<style scoped lang="scss">
:deep(.p-breadcrumb){
border-radius: 0;
border-left: none;
border-right: none;
}
.bootstrap{
:deep(.add-tag-input){
width:120px;
}
:deep(.add-tag-input:hover){
width:160px;
}
}
</style>

0 comments on commit f07f0ba

Please sign in to comment.