feat(network): 按概念图重排网络卡片与状态摘要
This commit is contained in:
@@ -32,6 +32,7 @@ struct PanelTrendChart: View {
|
||||
var boundaryDates: Set<Date> = []
|
||||
var intervals: [TimeInterval] = []
|
||||
var plotHeight: CGFloat = 58
|
||||
var showsLegendValues = true
|
||||
@Environment(\.accessibilityReduceMotion) private var reduceMotion
|
||||
@State private var retainedScale: Double = 1
|
||||
@State private var smallSamples = 0
|
||||
@@ -80,7 +81,9 @@ struct PanelTrendChart: View {
|
||||
HStack(spacing: 3) {
|
||||
RoundedRectangle(cornerRadius: 1).fill(tint).frame(width: 7, height: 7)
|
||||
Text(label)
|
||||
Text(verbatim: formatted(values.last ?? nil, format: format)).monospacedDigit()
|
||||
if showsLegendValues {
|
||||
Text(verbatim: formatted(values.last ?? nil, format: format)).monospacedDigit()
|
||||
}
|
||||
}.font(.system(size: 9)).lineLimit(1).minimumScaleFactor(0.8)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ struct ResourceCard<Content: View>: View {
|
||||
let color: Color
|
||||
let value: String
|
||||
var secondaryValue: String? = nil
|
||||
var valueColor: Color? = nil
|
||||
var secondaryValueColor: Color? = nil
|
||||
var status: String? = nil
|
||||
var statusWarning = false
|
||||
var statusHelp: Text? = nil
|
||||
@@ -42,8 +44,10 @@ struct ResourceCard<Content: View>: View {
|
||||
HStack(alignment: .center, spacing: 6) {
|
||||
AnimatedMetricText(value: value)
|
||||
.font(.system(size: 13, weight: .semibold))
|
||||
.foregroundStyle(valueColor ?? color)
|
||||
if let secondaryValue {
|
||||
AnimatedMetricText(value: secondaryValue).font(.system(size: 13, weight: .semibold))
|
||||
.foregroundStyle(secondaryValueColor ?? color)
|
||||
}
|
||||
}.foregroundStyle(color).lineLimit(1).minimumScaleFactor(0.65)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user