feat(network): 按概念图重排网络卡片与状态摘要
This commit is contained in:
@@ -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