增加 服务器状态组件
This commit is contained in:
parent
399b523893
commit
9d62ff9f23
32
resources/js/components/ServerStatus.vue
Normal file
32
resources/js/components/ServerStatus.vue
Normal 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>
|
@ -13,7 +13,9 @@
|
|||||||
}" class="list-group-item list-group-item-action" aria-current="true">
|
}" class="list-group-item list-group-item-action" aria-current="true">
|
||||||
<div class="d-flex w-100 justify-content-between">
|
<div class="d-flex w-100 justify-content-between">
|
||||||
<h5 class="mb-1">{{ server.name }}</h5>
|
<h5 class="mb-1">{{ server.name }}</h5>
|
||||||
<small>{{ server.status }}</small>
|
<small>
|
||||||
|
<server-status :status="server.status"></server-status>
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<p class="mb-1">
|
<p class="mb-1">
|
||||||
<span class="badge bg-primary" v-show="server.allow_http">HTTP</span>
|
<span class="badge bg-primary" v-show="server.allow_http">HTTP</span>
|
||||||
@ -36,6 +38,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {ref} from 'vue'
|
import {ref} from 'vue'
|
||||||
import http from '../../plugins/http'
|
import http from '../../plugins/http'
|
||||||
|
import ServerStatus from "../../components/ServerStatus.vue";
|
||||||
|
|
||||||
|
|
||||||
const servers = ref([{
|
const servers = ref([{
|
||||||
|
Loading…
Reference in New Issue
Block a user