opt.: ios / watch

This commit is contained in:
lollipopkit
2023-09-17 00:26:44 +08:00
parent cf943bf41f
commit 1edd54b4df
8 changed files with 106 additions and 101 deletions

32
ios/Runner/Utils.swift Normal file
View File

@@ -0,0 +1,32 @@
//
// Utils.swift
// Runner
//
// Created by lolli on 2023/9/16.
//
import Foundation
extension Date {
func toStr() -> String {
let formatter = DateFormatter()
formatter.dateStyle = .none
formatter.timeStyle = .short
formatter.locale = Locale.current
return formatter.string(from: self)
}
}
enum ContentState {
case loading
case error(String)
case normal(Status)
}
struct Status {
let name: String
let cpu: String
let mem: String
let disk: String
let net: String
}