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