|
@@ -1,12 +1,11 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
|
+import ngx from '@/api/ngx'
|
|
import { useNginxPerformance } from '@/composables/useNginxPerformance'
|
|
import { useNginxPerformance } from '@/composables/useNginxPerformance'
|
|
import { useSSE } from '@/composables/useSSE'
|
|
import { useSSE } from '@/composables/useSSE'
|
|
import { NginxStatus } from '@/constants'
|
|
import { NginxStatus } from '@/constants'
|
|
import { useUserStore } from '@/pinia'
|
|
import { useUserStore } from '@/pinia'
|
|
import { useGlobalStore } from '@/pinia/moudule/global'
|
|
import { useGlobalStore } from '@/pinia/moudule/global'
|
|
import { ClockCircleOutlined, ReloadOutlined } from '@ant-design/icons-vue'
|
|
import { ClockCircleOutlined, ReloadOutlined } from '@ant-design/icons-vue'
|
|
-import axios from 'axios'
|
|
|
|
-import { storeToRefs } from 'pinia'
|
|
|
|
import ConnectionMetricsCard from './components/ConnectionMetricsCard.vue'
|
|
import ConnectionMetricsCard from './components/ConnectionMetricsCard.vue'
|
|
import PerformanceStatisticsCard from './components/PerformanceStatisticsCard.vue'
|
|
import PerformanceStatisticsCard from './components/PerformanceStatisticsCard.vue'
|
|
import PerformanceTablesCard from './components/PerformanceTablesCard.vue'
|
|
import PerformanceTablesCard from './components/PerformanceTablesCard.vue'
|
|
@@ -39,16 +38,14 @@ async function toggleStubStatus() {
|
|
try {
|
|
try {
|
|
stubStatusLoading.value = true
|
|
stubStatusLoading.value = true
|
|
stubStatusError.value = ''
|
|
stubStatusError.value = ''
|
|
- const response = await axios.post('/api/nginx/stub_status', {
|
|
|
|
- enable: !stubStatusEnabled.value,
|
|
|
|
- })
|
|
|
|
|
|
+ const response = await ngx.toggle_stub_status(!stubStatusEnabled.value)
|
|
|
|
|
|
- if (response.data.stub_status_enabled !== undefined) {
|
|
|
|
- stubStatusEnabled.value = response.data.stub_status_enabled
|
|
|
|
|
|
+ if (response.stub_status_enabled !== undefined) {
|
|
|
|
+ stubStatusEnabled.value = response.stub_status_enabled
|
|
}
|
|
}
|
|
|
|
|
|
- if (response.data.error) {
|
|
|
|
- stubStatusError.value = response.data.error
|
|
|
|
|
|
+ if (response.error) {
|
|
|
|
+ stubStatusError.value = response.error
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
fetchInitialData().then(connectSSE)
|
|
fetchInitialData().then(connectSSE)
|