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

🐛 Show question mark if service not found

This commit is contained in:
2022-01-27 18:23:12 +01:00
parent 4670894cfd
commit d0962c2387
2 changed files with 14 additions and 5 deletions

View File

@ -78,13 +78,22 @@ class ServicesView: NSView, XibLoadable {
}
func applyServiceStyling(_ serviceName: String, _ imageView: NSImageView) {
if ServicesView.services[serviceName] != nil && ServicesView.services[serviceName]!.running {
if ServicesView.services[serviceName] == nil {
imageView.image = NSImage(named: "ServiceLoading")
imageView.contentTintColor = NSColor.black
return
}
if ServicesView.services[serviceName]!.running {
imageView.image = NSImage(named: "ServiceOn")
imageView.contentTintColor = NSColor.black
} else {
imageView.image = NSImage(named: "ServiceOff")
imageView.contentTintColor = NSColor.init(red: 246/255, green: 71/255, blue: 71/255, alpha: 1.0)
return
}
imageView.image = NSImage(named: "ServiceOff")
imageView.contentTintColor = NSColor.init(
red: 246/255, green: 71/255, blue: 71/255, alpha: 1.0
)
}
deinit {

View File

@ -40,7 +40,7 @@
<key>LSUIElement</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2021 Nico Verbruggen. All rights reserved.</string>
<string>Copyright © 2019-2022 Nico Verbruggen. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>