fix: arch-02 make type file
This commit is contained in:
@@ -74,19 +74,10 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed, ref, watch} from "vue"
|
import {computed, ref, watch} from "vue"
|
||||||
|
import { SystemMetrics } from "~/types/system";
|
||||||
|
|
||||||
type MetricKey = "cpu" | "ram" | "incoming" | "outgoing"
|
type MetricKey = "cpu" | "ram" | "incoming" | "outgoing"
|
||||||
|
|
||||||
type SystemMetrics = {
|
|
||||||
cpuPercent: number
|
|
||||||
memoryPercent: number
|
|
||||||
totalMemory: number
|
|
||||||
usedMemory: number
|
|
||||||
incomingMbps: number
|
|
||||||
outgoingMbps: number
|
|
||||||
sampledAt: string
|
|
||||||
}
|
|
||||||
|
|
||||||
type HistoryPoint = {
|
type HistoryPoint = {
|
||||||
sampledAt: string
|
sampledAt: string
|
||||||
cpu: number
|
cpu: number
|
||||||
|
|||||||
@@ -46,16 +46,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed} from "vue"
|
import {computed} from "vue"
|
||||||
|
import { SystemMetrics } from "~/types/system";
|
||||||
type SystemMetrics = {
|
|
||||||
cpuPercent: number
|
|
||||||
memoryPercent: number
|
|
||||||
totalMemory: number
|
|
||||||
usedMemory: number
|
|
||||||
incomingMbps: number
|
|
||||||
outgoingMbps: number
|
|
||||||
sampledAt: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
metrics: SystemMetrics | null
|
metrics: SystemMetrics | null
|
||||||
|
|||||||
@@ -64,6 +64,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed, onMounted, ref} from "vue"
|
import {computed, onMounted, ref} from "vue"
|
||||||
import { apiFetch } from "~/composables/useApiAuth"
|
import { apiFetch } from "~/composables/useApiAuth"
|
||||||
|
import { SystemMetrics } from "~/types/system";
|
||||||
|
|
||||||
definePageMeta({layout: false})
|
definePageMeta({layout: false})
|
||||||
|
|
||||||
type DiskSourceResult = {
|
type DiskSourceResult = {
|
||||||
@@ -90,16 +92,6 @@ type DiagramItem = {
|
|||||||
totalText: string
|
totalText: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type SystemMetrics = {
|
|
||||||
cpuPercent: number
|
|
||||||
memoryPercent: number
|
|
||||||
totalMemory: number
|
|
||||||
usedMemory: number
|
|
||||||
incomingMbps: number
|
|
||||||
outgoingMbps: number
|
|
||||||
sampledAt: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const rawResults = ref<DiskSourceResult[]>([])
|
const rawResults = ref<DiskSourceResult[]>([])
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const systemMetrics = ref<SystemMetrics | null>(null)
|
const systemMetrics = ref<SystemMetrics | null>(null)
|
||||||
|
|||||||
9
types/system.ts
Normal file
9
types/system.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export type SystemMetrics = {
|
||||||
|
cpuPercent: number
|
||||||
|
memoryPercent: number
|
||||||
|
totalMemory: number
|
||||||
|
usedMemory: number
|
||||||
|
incomingMbps: number
|
||||||
|
outgoingMbps: number
|
||||||
|
sampledAt: string
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user