mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
33 lines
552 B
Swift
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
|
|
}
|