mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2026-04-02 17:40:08 +02:00
♻️ Refactor layout of alert
This commit is contained in:
@@ -20,34 +20,30 @@ struct StartupAlertView: View {
|
|||||||
|
|
||||||
// Fix command description: only shown in idle state when a fix is available
|
// Fix command description: only shown in idle state when a fix is available
|
||||||
if viewModel.state == .idle && viewModel.hasFix {
|
if viewModel.state == .idle && viewModel.hasFix {
|
||||||
Divider()
|
|
||||||
|
|
||||||
StartupFixCommandView(
|
StartupFixCommandView(
|
||||||
command: viewModel.check.fixDescription ?? ""
|
command: viewModel.check.fixDescription ?? ""
|
||||||
)
|
)
|
||||||
.padding(15)
|
.padding(.horizontal, 10).padding(.leading, 72)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Terminal output: shown during and after fix execution
|
// Terminal output: shown during and after fix execution
|
||||||
if !viewModel.outputLines.isEmpty
|
if !viewModel.outputLines.isEmpty
|
||||||
&& (viewModel.state == .running || viewModel.state == .completed || viewModel.state == .failed) {
|
&& (viewModel.state == .running || viewModel.state == .completed || viewModel.state == .failed) {
|
||||||
Divider()
|
|
||||||
|
|
||||||
StartupOutputView(
|
StartupOutputView(
|
||||||
lines: viewModel.outputLines,
|
lines: viewModel.outputLines,
|
||||||
isRunning: viewModel.state == .running
|
isRunning: viewModel.state == .running
|
||||||
)
|
)
|
||||||
.padding(15)
|
.padding(15).padding(.leading, 72)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Description text: shown in idle state
|
// Description text: shown in idle state
|
||||||
if !viewModel.check.descriptionText.isEmpty && viewModel.state == .idle {
|
if !viewModel.check.descriptionText.isEmpty && viewModel.state == .idle {
|
||||||
Divider()
|
|
||||||
|
|
||||||
MarkdownTextView(viewModel.check.descriptionText, fontSize: 12)
|
MarkdownTextView(viewModel.check.descriptionText, fontSize: 12)
|
||||||
.padding(15)
|
.padding(.vertical, 15)
|
||||||
|
.padding(.horizontal, 20)
|
||||||
|
.padding(.leading, 64)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +57,7 @@ struct StartupAlertView: View {
|
|||||||
onFix: { viewModel.runFix() }
|
onFix: { viewModel.runFix() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.frame(width: 500)
|
.frame(width: 550)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user