mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-06 19:40:08 +02:00
✨ Add message about failing to load info (#258)
This commit is contained in:
@ -29,29 +29,60 @@ struct StatsView: View {
|
||||
@State var maxPostSize: String
|
||||
@State var maxUploadSize: String
|
||||
|
||||
init(memoryLimit: String, maxPostSize: String, maxUploadSize: String) {
|
||||
self.memoryLimit = memoryLimit
|
||||
self.maxPostSize = maxPostSize
|
||||
self.maxUploadSize = maxUploadSize
|
||||
}
|
||||
|
||||
public func hasErrorState() -> Bool {
|
||||
return self.memoryLimit == "⚠️"
|
||||
|| self.maxPostSize == "⚠️"
|
||||
|| self.maxUploadSize == "⚠️"
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .firstTextBaseline, spacing: 30) {
|
||||
VStack(alignment: .center, spacing: 3) {
|
||||
SectionHeaderView(text: "mi_memory_limit".localized.uppercased())
|
||||
Text(memoryLimit)
|
||||
.fontWeight(.medium)
|
||||
if self.hasErrorState() {
|
||||
HStack {
|
||||
Text("⚠️")
|
||||
.frame(maxWidth: 20, alignment: .center)
|
||||
.font(.system(size: 16))
|
||||
VStack {
|
||||
Text("warnings.limits_error.title".localizedForSwiftUI)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.font(.system(size: 11))
|
||||
Text("warnings.limits_error.steps".localizedForSwiftUI)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
.font(.system(size: 11))
|
||||
}
|
||||
}
|
||||
VStack(alignment: .center, spacing: 3) {
|
||||
SectionHeaderView(text: "mi_post_max_size".localized.uppercased())
|
||||
Text(maxPostSize)
|
||||
.fontWeight(.medium)
|
||||
.font(.system(size: 16))
|
||||
}
|
||||
VStack(alignment: .center, spacing: 3) {
|
||||
SectionHeaderView(text: "mi_upload_max_filesize".localized.uppercased())
|
||||
Text(maxUploadSize)
|
||||
.fontWeight(.medium)
|
||||
.font(.system(size: 16))
|
||||
.padding(10)
|
||||
.padding(.leading, 30)
|
||||
.padding(.trailing, 30)
|
||||
} else {
|
||||
HStack(alignment: .firstTextBaseline, spacing: 30) {
|
||||
VStack(alignment: .center, spacing: 3) {
|
||||
SectionHeaderView(text: "mi_memory_limit".localized.uppercased())
|
||||
Text(memoryLimit)
|
||||
.fontWeight(.medium)
|
||||
.font(.system(size: 16))
|
||||
}
|
||||
VStack(alignment: .center, spacing: 3) {
|
||||
SectionHeaderView(text: "mi_post_max_size".localized.uppercased())
|
||||
Text(maxPostSize)
|
||||
.fontWeight(.medium)
|
||||
.font(.system(size: 16))
|
||||
}
|
||||
VStack(alignment: .center, spacing: 3) {
|
||||
SectionHeaderView(text: "mi_upload_max_filesize".localized.uppercased())
|
||||
Text(maxUploadSize)
|
||||
.fontWeight(.medium)
|
||||
.font(.system(size: 16))
|
||||
}
|
||||
}
|
||||
.padding(10)
|
||||
.background(Color.debug)
|
||||
}
|
||||
.padding(10)
|
||||
.background(Color.debug)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -736,6 +736,9 @@ ALLGEMEINE TIPPS ZUR FEHLERSUCHE
|
||||
|
||||
// WARNINGS
|
||||
|
||||
"warnings.limits_error.title" = "PHP Monitor konnte die Grenzwerte nicht abrufen.";
|
||||
"warnings.limits_error.steps" = "Versuchen Sie, 'php -v' in Ihrem Terminal auszuführen.";
|
||||
|
||||
"warnings.title" = "PHP Doktor";
|
||||
"warnings.description" = "Der **PHP Doktor** schlägt Verbesserungen an Ihrer aktiven Systemkonfiguration vor.";
|
||||
"warnings.disclaimer" = "Sie können alle Empfehlungen aus dem PHP-Monitor-Menü in den Einstellungen ausblenden, aber es wird empfohlen, dass Sie sich mit allen umsetzbaren Punkten befassen.";
|
||||
|
@ -736,6 +736,9 @@ COMMON TROUBLESHOOTING TIPS
|
||||
|
||||
// WARNINGS
|
||||
|
||||
"warnings.limits_error.title" = "PHP Monitor could not retrieve limits.";
|
||||
"warnings.limits_error.steps" = "Try running ‘php -v’ in your terminal.";
|
||||
|
||||
"warnings.title" = "PHP Doctor";
|
||||
"warnings.description" = "**PHP Doctor** will suggest improvements to your active system configuration.";
|
||||
"warnings.disclaimer" = "You may choose to hide all recommendations from the PHP Monitor menu in Preferences, but it is recommended that you deal with all actionable items.";
|
||||
|
@ -735,6 +735,9 @@ VEELVOORKOMENDE PROBLEEMOPLOSSINGSTIPS
|
||||
|
||||
// WARNINGS
|
||||
|
||||
"warnings.limits_error.title" = "PHP Monitor kon de limieten niet ophalen.";
|
||||
"warnings.limits_error.steps" = "Run ‘php -v’ in jouw terminal om te testen.";
|
||||
|
||||
"warnings.title" = "PHP Doctor";
|
||||
"warnings.description" = "**PHP Doctor** geeft suggesties voor verbeteringen aan uw actieve systeemconfiguratie.";
|
||||
"warnings.disclaimer" = "U kunt ervoor kiezen om alle aanbevelingen te verbergen in het PHP Monitor-menu in de Voorkeuren, maar het wordt aanbevolen om alle actiepunten aan te pakken.";
|
||||
|
@ -729,6 +729,9 @@ MỘT SỐ MẸO KHẮC PHỤC THƯỜNG GẶP
|
||||
|
||||
// WARNINGS
|
||||
|
||||
"warnings.limits_error.title" = "PHP Monitor không thể lấy giới hạn.";
|
||||
"warnings.limits_error.steps" = "Thử chạy 'php -v' trong cửa sổ terminal của bạn.";
|
||||
|
||||
"warnings.title" = "PHP Doctor";
|
||||
"warnings.description" = "**PHP Doctor** sẽ đề xuất cải tiến cho cấu hình hệ thống hoạt động của bạn.";
|
||||
"warnings.disclaimer" = "Bạn có thể ẩn tất cả các đề xuất từ menu PHP Monitor trong Tùy chọn, nhưng khuyến nghị là bạn nên xử lý tất cả các mục hành động được đề xuất.";
|
||||
|
Reference in New Issue
Block a user