From d2846741bccb17efc458d1a8f98ef9837928eeee Mon Sep 17 00:00:00 2001 From: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com> Date: Wed, 19 Mar 2025 14:06:42 -0700 Subject: [PATCH] ui: Error log button to Developer panel (#627) * Add error log to developer panel * Testing debug * Fix condition for retry handling in action workflow Updated the logic to properly check for 'NONE' author association instead of 'FIRST_TIME_CONTRIBUTOR' when determining retry limits. This ensures the workflow behaves as intended for contributors without prior activity. * Clean * Refine workflow condition logic for PR checks Updated the `if` condition in the lfs-maintenance workflow to improve clarity and ensure proper evaluation. This change aligns the logical grouping for better readability and correctness in forked PR handling. * Add lang files * Update selfdrive/ui/qt/offroad/developer_panel.cc Co-authored-by: Jason Wen * Refactor GitHub runner control to local variable Replaced the `enableGithubRunner` member variable with a local variable, as it is not used elsewhere in the class. Simplified visibility management for developer panel toggles in release branches. * Updating translations --------- Co-authored-by: DevTekVE Co-authored-by: Jason Wen --- selfdrive/ui/qt/offroad/developer_panel.cc | 11 +++++++++++ selfdrive/ui/qt/offroad/developer_panel.h | 1 + selfdrive/ui/translations/main_ar.ts | 12 ++++++++++++ selfdrive/ui/translations/main_de.ts | 12 ++++++++++++ selfdrive/ui/translations/main_es.ts | 12 ++++++++++++ selfdrive/ui/translations/main_fr.ts | 12 ++++++++++++ selfdrive/ui/translations/main_ja.ts | 12 ++++++++++++ selfdrive/ui/translations/main_ko.ts | 12 ++++++++++++ selfdrive/ui/translations/main_pt-BR.ts | 12 ++++++++++++ selfdrive/ui/translations/main_th.ts | 12 ++++++++++++ selfdrive/ui/translations/main_tr.ts | 12 ++++++++++++ selfdrive/ui/translations/main_zh-CHS.ts | 12 ++++++++++++ selfdrive/ui/translations/main_zh-CHT.ts | 12 ++++++++++++ 13 files changed, 144 insertions(+) diff --git a/selfdrive/ui/qt/offroad/developer_panel.cc b/selfdrive/ui/qt/offroad/developer_panel.cc index e679720a1..b918a9353 100644 --- a/selfdrive/ui/qt/offroad/developer_panel.cc +++ b/selfdrive/ui/qt/offroad/developer_panel.cc @@ -60,6 +60,14 @@ DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : ListWidget(parent) { auto enableGithubRunner = new ParamControl("EnableGithubRunner", tr("Enable GitHub runner service"), tr("Enables or disables the github runner service."), ""); addItem(enableGithubRunner); + // error log button + errorLogBtn = new ButtonControl(tr("Error Log"), tr("VIEW"), tr("View the error log for sunnypilot crashes.")); + connect(errorLogBtn, &ButtonControl::clicked, [=]() { + std::string txt = util::read_file("/data/community/crashes/error.log"); + ConfirmationDialog::rich(QString::fromStdString(txt), this); + }); + addItem(errorLogBtn); + // Joystick and longitudinal maneuvers should be hidden on release branches is_release = params.getBool("IsReleaseBranch"); @@ -112,6 +120,9 @@ void DeveloperPanel::updateToggles(bool _offroad) { } experimentalLongitudinalToggle->refresh(); + // Handle specific controls visibility for release branches + errorLogBtn->setVisible(!is_release); + offroad = _offroad; } diff --git a/selfdrive/ui/qt/offroad/developer_panel.h b/selfdrive/ui/qt/offroad/developer_panel.h index beecc24de..c1783444e 100644 --- a/selfdrive/ui/qt/offroad/developer_panel.h +++ b/selfdrive/ui/qt/offroad/developer_panel.h @@ -16,6 +16,7 @@ private: Params params; ParamControl* adbToggle; ParamControl* joystickToggle; + ButtonControl* errorLogBtn; ParamControl* longManeuverToggle; ParamControl* experimentalLongitudinalToggle; ParamControl* hyundaiRadarTracksToggle; diff --git a/selfdrive/ui/translations/main_ar.ts b/selfdrive/ui/translations/main_ar.ts index 4cb648dc3..643d563a7 100644 --- a/selfdrive/ui/translations/main_ar.ts +++ b/selfdrive/ui/translations/main_ar.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + عرض + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_de.ts b/selfdrive/ui/translations/main_de.ts index 5a994c4ad..622a822ba 100644 --- a/selfdrive/ui/translations/main_de.ts +++ b/selfdrive/ui/translations/main_de.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + ANSEHEN + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_es.ts b/selfdrive/ui/translations/main_es.ts index 77b1ecb6e..25ed875ef 100644 --- a/selfdrive/ui/translations/main_es.ts +++ b/selfdrive/ui/translations/main_es.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + VER + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_fr.ts b/selfdrive/ui/translations/main_fr.ts index 94ebdb0a1..2da3eabaf 100644 --- a/selfdrive/ui/translations/main_fr.ts +++ b/selfdrive/ui/translations/main_fr.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + VOIR + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_ja.ts b/selfdrive/ui/translations/main_ja.ts index 1c6ab9a8b..9d20a1e7d 100644 --- a/selfdrive/ui/translations/main_ja.ts +++ b/selfdrive/ui/translations/main_ja.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + 確認 + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_ko.ts b/selfdrive/ui/translations/main_ko.ts index 3286cc081..8a7dc29fd 100644 --- a/selfdrive/ui/translations/main_ko.ts +++ b/selfdrive/ui/translations/main_ko.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + 보기 + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_pt-BR.ts b/selfdrive/ui/translations/main_pt-BR.ts index 7a18c3598..5fc837513 100644 --- a/selfdrive/ui/translations/main_pt-BR.ts +++ b/selfdrive/ui/translations/main_pt-BR.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + VER + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_th.ts b/selfdrive/ui/translations/main_th.ts index abb3088df..ca3effbb7 100644 --- a/selfdrive/ui/translations/main_th.ts +++ b/selfdrive/ui/translations/main_th.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + ดู + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_tr.ts b/selfdrive/ui/translations/main_tr.ts index 4e0e93c70..a03a63dfb 100644 --- a/selfdrive/ui/translations/main_tr.ts +++ b/selfdrive/ui/translations/main_tr.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + BAK + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_zh-CHS.ts b/selfdrive/ui/translations/main_zh-CHS.ts index c9807fa2d..6b1bee2d9 100644 --- a/selfdrive/ui/translations/main_zh-CHS.ts +++ b/selfdrive/ui/translations/main_zh-CHS.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + 查看 + + + View the error log for sunnypilot crashes. + + DevicePanel diff --git a/selfdrive/ui/translations/main_zh-CHT.ts b/selfdrive/ui/translations/main_zh-CHT.ts index 1df2d934a..17fa912d2 100644 --- a/selfdrive/ui/translations/main_zh-CHT.ts +++ b/selfdrive/ui/translations/main_zh-CHT.ts @@ -159,6 +159,18 @@ Enables or disables the github runner service. + + Error Log + + + + VIEW + 觀看 + + + View the error log for sunnypilot crashes. + + DevicePanel