Files
flutter_server_box/ios/Runner/Utils.swift
2023-09-17 00:26:44 +08:00

33 lines
552 B
Swift

//
// 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
}