feat: require ingress for egress
This commit is contained in:
parent
036366a875
commit
e4438baa65
@ -140,6 +140,11 @@ func Run(ctx context.Context, params RunParams) error {
|
||||
continue
|
||||
}
|
||||
case terminal.CommandStartDestination:
|
||||
if !state.Source.Live {
|
||||
ui.ShowSourceNotLiveModal()
|
||||
continue
|
||||
}
|
||||
|
||||
mp.StartDestination(c.URL)
|
||||
case terminal.CommandStopDestination:
|
||||
mp.StopDestination(c.URL)
|
||||
|
@ -91,7 +91,7 @@ func TestIntegration(t *testing.T) {
|
||||
contents := getContents()
|
||||
require.True(t, len(contents) > 2, "expected at least 3 lines of output")
|
||||
|
||||
assert.Contains(t, contents[2], "Status ready", "expected mediaserver status to be ready")
|
||||
assert.Contains(t, contents[2], "Status waiting", "expected mediaserver status to be waiting")
|
||||
},
|
||||
2*time.Minute,
|
||||
time.Second,
|
||||
@ -281,7 +281,7 @@ func TestIntegrationDestinationValidations(t *testing.T) {
|
||||
contents := getContents()
|
||||
require.True(t, len(contents) > 2, "expected at least 3 lines of output")
|
||||
|
||||
assert.Contains(t, contents[2], "Status ready", "expected mediaserver status to be ready")
|
||||
assert.Contains(t, contents[2], "Status waiting", "expected mediaserver status to be waiting")
|
||||
},
|
||||
2*time.Minute,
|
||||
time.Second,
|
||||
|
@ -297,6 +297,17 @@ func (ui *UI) run(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (ui *UI) ShowSourceNotLiveModal() {
|
||||
ui.app.QueueUpdateDraw(func() {
|
||||
ui.showModal(
|
||||
pageNameModalStartupCheck,
|
||||
fmt.Sprintf("Source is not live.\nStart streaming to the source URL then try again:\n\n%s", ui.sourceViews.url.GetText(true)),
|
||||
[]string{"Ok"},
|
||||
nil,
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// ShowStartupCheckModal shows a modal dialog to the user, asking if they want
|
||||
// to kill a running instance of Octoplex.
|
||||
//
|
||||
@ -571,7 +582,7 @@ func (ui *UI) redrawFromState(state domain.AppState) {
|
||||
|
||||
ui.sourceViews.status.SetText("[black:green]receiving" + durStr)
|
||||
} else if state.Source.Container.Status == domain.ContainerStatusRunning && state.Source.Container.HealthState == "healthy" {
|
||||
ui.sourceViews.status.SetText("[black:yellow]ready")
|
||||
ui.sourceViews.status.SetText("[black:yellow]waiting")
|
||||
} else {
|
||||
ui.sourceViews.status.SetText("[white:red]not ready")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user