增加 服务器状态组件

This commit is contained in:
iVampireSP.com 2023-03-16 20:35:41 +08:00
parent 399b523893
commit 9d62ff9f23
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,32 @@
<template>
<span v-if="status === 'up'"
class="text-success">
正常
</span>
<span v-else-if="status === 'down'"
class="text-danger">
离线
</span>
<span v-else-if="status === 'maintenance'"
class="text-warning">
维护
</span>
</template>
<script setup>
defineProps({
status: {
type: String,
required: true
}
})
</script>

View File

@ -13,7 +13,9 @@
}" class="list-group-item list-group-item-action" aria-current="true">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{ server.name }}</h5>
<small>{{ server.status }}</small>
<small>
<server-status :status="server.status"></server-status>
</small>
</div>
<p class="mb-1">
<span class="badge bg-primary" v-show="server.allow_http">HTTP</span>
@ -36,6 +38,7 @@
<script setup>
import {ref} from 'vue'
import http from '../../plugins/http'
import ServerStatus from "../../components/ServerStatus.vue";
const servers = ref([{