reload web ui on start

This commit is contained in:
2025-06-26 12:34:01 +02:00
parent 0180958621
commit 08f61ef9e4
4 changed files with 15 additions and 8 deletions

View File

@@ -53,7 +53,7 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
m_panel1->SetSizer( bSizer2 );
m_panel1->Layout();
bSizer2->Fit( m_panel1 );
m_notebook1->AddPage( m_panel1, _("Info"), false );
m_notebook1->AddPage( m_panel1, _("Info"), true );
m_panel3 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxGridSizer* gSizer1;
gSizer1 = new wxGridSizer( 1, 1, 0, 0 );
@@ -65,7 +65,7 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
m_panel3->SetSizer( gSizer1 );
m_panel3->Layout();
gSizer1->Fit( m_panel3 );
m_notebook1->AddPage( m_panel3, _("Logs"), true );
m_notebook1->AddPage( m_panel3, _("Logs"), false );
m_panel2 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer5;
bSizer5 = new wxBoxSizer( wxVERTICAL );
@@ -137,7 +137,7 @@ MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, co
m_panel4 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_notebook1->AddPage( m_panel4, _("Advanced Settings"), false );
m_panel5 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_notebook1->AddPage( m_panel5, _("a page"), false );
m_notebook1->AddPage( m_panel5, _("Web UI"), false );
bSizer3->Add( m_notebook1, 1, wxEXPAND, 5 );

View File

@@ -20,7 +20,7 @@ LauncherAppMainFrame::LauncherAppMainFrame(wxWindow* parent)
m_webViewSizer->Fit(m_panel5);
Bind(NEW_LINE_OUTPUT_EVENT, &LauncherAppMainFrame::onNewLineOutput, this);
Bind(DHFS_STATE_CHANGE_EVENT, &LauncherAppMainFrame::onShutdown, this);
Bind(DHFS_STATE_CHANGE_EVENT, &LauncherAppMainFrame::onDhfsInstanceStateChange, this);
wxFont font = wxFont(wxSize(16, 16),
wxFontFamily::wxFONTFAMILY_TELETYPE,
wxFontStyle::wxFONTSTYLE_NORMAL,
@@ -31,11 +31,18 @@ LauncherAppMainFrame::LauncherAppMainFrame(wxWindow* parent)
void LauncherAppMainFrame::updateState() {
switch (_dhfsInstance.state()) {
case DhfsInstanceState::RUNNING:
case DhfsInstanceState::RUNNING: {
m_statusText->SetLabel("Running");
m_startStopButton->SetLabel("Stop");
m_statusBar1->SetStatusText("Running", 0);
if (m_notebook1->GetSelection() == 4) {
if (m_webView != nullptr)
m_webView->LoadURL("http://localhost:8080");
}
break;
}
case DhfsInstanceState::STARTING: {
m_statusText->SetLabel("Starting");
m_startStopButton->SetLabel("Stop");
@@ -113,7 +120,7 @@ void LauncherAppMainFrame::OnNotebookPageChanging(wxBookCtrlEvent& event) {
else unloadWebview();
}
void LauncherAppMainFrame::onShutdown(wxCommandEvent& event) {
void LauncherAppMainFrame::onDhfsInstanceStateChange(wxCommandEvent& event) {
updateState();
}

View File

@@ -39,7 +39,7 @@ protected:
void onNewLineOutput(wxCommandEvent& event);
void onShutdown(wxCommandEvent& event);
void onDhfsInstanceStateChange(wxCommandEvent& event);
void updateState();

View File

@@ -1211,7 +1211,7 @@
</object>
<object class="notebookpage" expanded="true">
<property name="bitmap"></property>
<property name="label">a page</property>
<property name="label">Web UI</property>
<property name="select">0</property>
<object class="wxPanel" expanded="true">
<property name="BottomDockable">1</property>