1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-08 04:20:07 +02:00

👌 More compact ServicesView

This commit is contained in:
2023-01-18 19:56:54 +01:00
parent e509f6b59d
commit b6b1174ca3
2 changed files with 6 additions and 9 deletions

View File

@ -7,7 +7,7 @@
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "0.988", "blue" : "0.988",
"green" : "0.580", "green" : "0.580",
"red" : "0.277" "red" : "0.278"
} }
}, },
"idiom" : "universal" "idiom" : "universal"

View File

@ -35,8 +35,8 @@ struct ServicesView: View {
var perRow: Int var perRow: Int
var rowCount: Int var rowCount: Int
var rowSpacing: Int = 0 var rowSpacing: Int = 0
var rowHeight: Int = 50 var rowHeight: Int = 48
var statusHeight: Int = 30 var statusHeight: Int = 20
var allRowHeight: CGFloat var allRowHeight: CGFloat
var height: CGFloat var height: CGFloat
@ -66,15 +66,14 @@ struct ServicesView: View {
} }
.frame(height: CGFloat(self.height - CGFloat(self.statusHeight))) .frame(height: CGFloat(self.height - CGFloat(self.statusHeight)))
.frame(maxWidth: .infinity, alignment: .center) .frame(maxWidth: .infinity, alignment: .center)
// .background(Color.red)
VStack(alignment: .center) { VStack(alignment: .center) {
HStack { HStack {
Circle() Circle()
.frame(width: 12, height: 12) .frame(width: 10, height: 10)
.foregroundColor(self.manager.statusColor) .foregroundColor(self.manager.statusColor)
Text(self.manager.statusMessage) Text(self.manager.statusMessage)
.font(.system(size: 12)) .font(.system(size: 11))
if self.manager.statusColor == .red { if self.manager.statusColor == .red {
HelpButton { HelpButton {
let type = manager.hasError let type = manager.hasError
@ -108,8 +107,6 @@ struct ServiceView: View {
Text(service.name.uppercased()) Text(service.name.uppercased())
.font(.system(size: 10)) .font(.system(size: 10))
.frame(minWidth: 70, alignment: .center) .frame(minWidth: 70, alignment: .center)
.padding(.top, 4)
.padding(.bottom, 2)
if isBusy { if isBusy {
ProgressView() ProgressView()
.scaleEffect(x: 0.4, y: 0.4, anchor: .center) .scaleEffect(x: 0.4, y: 0.4, anchor: .center)
@ -163,7 +160,7 @@ struct ServiceView: View {
.frame(width: 12.0, height: 12.0) .frame(width: 12.0, height: 12.0)
.foregroundColor( .foregroundColor(
service.status == .active service.status == .active
? Color("StatusColorGreen") ? Color.primary
: Color("StatusColorRed") : Color("StatusColorRed")
) )
} }