mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50:08 +02:00
🏗 WIP: Warning manager
This commit is contained in:
@ -149,6 +149,8 @@
|
||||
C473319F2470923A009A0597 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C473319E2470923A009A0597 /* Localizable.strings */; };
|
||||
C47331A2247093B7009A0597 /* StatusMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C47331A1247093B7009A0597 /* StatusMenu.swift */; };
|
||||
C474B00624C0E98C00066A22 /* LocalNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = C474B00524C0E98C00066A22 /* LocalNotification.swift */; };
|
||||
C47699EF28A2F2A30060FEB8 /* WarningManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C47699EE28A2F2A30060FEB8 /* WarningManager.swift */; };
|
||||
C47699F128A2F3150060FEB8 /* Warning.swift in Sources */ = {isa = PBXBuildFile; fileRef = C47699F028A2F3150060FEB8 /* Warning.swift */; };
|
||||
C476FF9822B0DD830098105B /* Alert.swift in Sources */ = {isa = PBXBuildFile; fileRef = C476FF9722B0DD830098105B /* Alert.swift */; };
|
||||
C4811D2422D70A4700B5F6B3 /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4811D2322D70A4700B5F6B3 /* App.swift */; };
|
||||
C4811D2A22D70F9A00B5F6B3 /* MainMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4811D2922D70F9A00B5F6B3 /* MainMenu.swift */; };
|
||||
@ -385,6 +387,8 @@
|
||||
C473319E2470923A009A0597 /* Localizable.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = "<group>"; };
|
||||
C47331A1247093B7009A0597 /* StatusMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusMenu.swift; sourceTree = "<group>"; };
|
||||
C474B00524C0E98C00066A22 /* LocalNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotification.swift; sourceTree = "<group>"; };
|
||||
C47699EE28A2F2A30060FEB8 /* WarningManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WarningManager.swift; sourceTree = "<group>"; };
|
||||
C47699F028A2F3150060FEB8 /* Warning.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Warning.swift; sourceTree = "<group>"; };
|
||||
C476FF9722B0DD830098105B /* Alert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alert.swift; sourceTree = "<group>"; };
|
||||
C4811D2322D70A4700B5F6B3 /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.swift; sourceTree = "<group>"; };
|
||||
C4811D2922D70F9A00B5F6B3 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = "<group>"; };
|
||||
@ -680,6 +684,8 @@
|
||||
C422DDAB28A2DAA100CEAC97 /* Warnings */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C47699F028A2F3150060FEB8 /* Warning.swift */,
|
||||
C47699EE28A2F2A30060FEB8 /* WarningManager.swift */,
|
||||
C422DDAC28A2DAC600CEAC97 /* WarningsWindowController.swift */,
|
||||
);
|
||||
path = Warnings;
|
||||
@ -1258,6 +1264,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C47699EF28A2F2A30060FEB8 /* WarningManager.swift in Sources */,
|
||||
C4ACA38F25C754C100060C66 /* PhpExtension.swift in Sources */,
|
||||
C4D8016622B1584700C6DA1B /* Startup.swift in Sources */,
|
||||
C42C49DB27C2806F0074ABAC /* MainMenu+FixMyValet.swift in Sources */,
|
||||
@ -1324,6 +1331,7 @@
|
||||
5420395F2613607600FB00FA /* Preferences.swift in Sources */,
|
||||
C48D0C9325CC804200CC7490 /* XibLoadable.swift in Sources */,
|
||||
54FCFD2A276C8AA4004CE748 /* CheckboxPreferenceView.swift in Sources */,
|
||||
C47699F128A2F3150060FEB8 /* Warning.swift in Sources */,
|
||||
54D9E0B227E4F51E003B9AD9 /* HotKeysController.swift in Sources */,
|
||||
C4811D2A22D70F9A00B5F6B3 /* MainMenu.swift in Sources */,
|
||||
C40C7F3027722E8D00DDDCDC /* Logger.swift in Sources */,
|
||||
|
@ -94,7 +94,6 @@ extension MainMenu {
|
||||
Log.info("Should present the first launch screen!")
|
||||
DispatchQueue.main.async {
|
||||
// OnboardingWindowController.show()
|
||||
WarningsWindowController.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,6 +174,10 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate
|
||||
PreferencesWindowController.show()
|
||||
}
|
||||
|
||||
@objc func openWarnings() {
|
||||
WarningsWindowController.show()
|
||||
}
|
||||
|
||||
@objc func openDomainList() {
|
||||
DomainListVC.show()
|
||||
}
|
||||
|
@ -76,6 +76,10 @@ class StatusMenu: NSMenu {
|
||||
|
||||
func addCoreMenuItems() {
|
||||
self.addItem(NSMenuItem.separator())
|
||||
if (WarningManager.hasWarnings()) {
|
||||
self.addItem(NSMenuItem(title: "mi_warnings".localized(2),
|
||||
action: #selector(MainMenu.openWarnings), keyEquivalent: ""))
|
||||
}
|
||||
self.addItem(NSMenuItem(title: "mi_preferences".localized,
|
||||
action: #selector(MainMenu.openPrefs), keyEquivalent: ","))
|
||||
self.addItem(NSMenuItem(title: "mi_check_for_updates".localized,
|
||||
|
@ -13,12 +13,17 @@ struct WarningListView: View {
|
||||
List {
|
||||
VStack(alignment: .leading) {
|
||||
WarningView(
|
||||
title: "warnings.arm_compatibility_title".localized,
|
||||
description: "warnings.arm_compatibility.description".localized,
|
||||
title: "warnings.arm_compatibility_title",
|
||||
description: "warnings.arm_compatibility.description",
|
||||
documentationUrl: "https://phpmon.app/documentation/apple-silicon-transition"
|
||||
)
|
||||
Divider()
|
||||
}.frame(height: 90)
|
||||
WarningView(
|
||||
title: "warnings.helper_permissions_title",
|
||||
description: "warnings.helper_permissions.description"
|
||||
)
|
||||
Divider()
|
||||
}
|
||||
|
||||
}
|
||||
.navigationTitle("Warnings")
|
||||
|
@ -15,24 +15,24 @@ struct WarningView: View {
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
HStack(spacing: 5) {
|
||||
HStack(spacing: 10) {
|
||||
Image(systemName: "exclamationmark.triangle.fill")
|
||||
.resizable()
|
||||
.frame(width: 25, height: 25)
|
||||
.padding()
|
||||
.frame(width: 18, height: 18)
|
||||
.foregroundColor(Color.orange)
|
||||
.padding()
|
||||
VStack(alignment: .leading, spacing: 5) {
|
||||
Text(title.localizedForSwiftUI)
|
||||
.fontWeight(.bold)
|
||||
Text(description.localizedForSwiftUI)
|
||||
.font(.body)
|
||||
.font(.system(size: 12))
|
||||
}
|
||||
if documentationUrl != nil {
|
||||
Button("Learn More") {
|
||||
NSWorkspace.shared.open(URL(string: documentationUrl!)!)
|
||||
}
|
||||
}.padding()
|
||||
}
|
||||
}.padding()
|
||||
}.padding(5)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -41,7 +41,8 @@ struct WarningView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
WarningView(
|
||||
title: "warnings.helper_permissions_title",
|
||||
description: "warnings.helper_permissions.description"
|
||||
description: "warnings.helper_permissions.description",
|
||||
documentationUrl: "https://nicoverbruggen.be"
|
||||
)
|
||||
WarningView(
|
||||
title: "warnings.helper_permissions_title",
|
||||
|
13
phpmon/Domain/Warnings/Warning.swift
Normal file
13
phpmon/Domain/Warnings/Warning.swift
Normal file
@ -0,0 +1,13 @@
|
||||
//
|
||||
// Warning.swift
|
||||
// PHP Monitor
|
||||
//
|
||||
// Created by Nico Verbruggen on 09/08/2022.
|
||||
// Copyright © 2022 Nico Verbruggen. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct Warning {
|
||||
|
||||
}
|
15
phpmon/Domain/Warnings/WarningManager.swift
Normal file
15
phpmon/Domain/Warnings/WarningManager.swift
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// WarningManager.swift
|
||||
// PHP Monitor
|
||||
//
|
||||
// Created by Nico Verbruggen on 09/08/2022.
|
||||
// Copyright © 2022 Nico Verbruggen. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class WarningManager {
|
||||
|
||||
// TODO: Singleton initialization at launch
|
||||
|
||||
}
|
@ -55,6 +55,8 @@
|
||||
"mi_detected_extensions" = "Detected Extensions";
|
||||
"mi_no_extensions_detected" = "No additional extensions detected.";
|
||||
|
||||
"mi_warnings" = "⚠️ %i Warnings...";
|
||||
|
||||
"mi_valet" = "Laravel Valet";
|
||||
"mi_domain_list" = "View Domains List...";
|
||||
|
||||
|
Reference in New Issue
Block a user