mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-13 11:22:07 +08:00
ui: Reset Access Tokens for all Map Services
This commit is contained in:
@@ -19,6 +19,8 @@ sunnypilot - 0.9.7.0 (2024-xx-xx)
|
||||
* RE-ENABLED: Map-based Turn Speed Control (M-TSC) for supported platforms
|
||||
* openpilot Longitudianl Control available cars
|
||||
* Custom Stock Longitudinal Control available cars
|
||||
* UPDATED: Reset Mapbox Access Token -> Reset Access Tokens for Map Services
|
||||
* Reset self-service access tokens for Mapbox, Amap, and Google Maps
|
||||
* UI Updates
|
||||
* Display Metrics Below Chevron
|
||||
* NEW❗: Metrics is now being displayed below the chevron instead of above
|
||||
|
||||
@@ -321,11 +321,19 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
|
||||
});
|
||||
addItem(resetCalibBtn);
|
||||
|
||||
auto resetMapboxTokenBtn = new ButtonControl(tr("Reset Mapbox Access Token"), tr("RESET"), "");
|
||||
auto resetMapboxTokenBtn = new ButtonControl(tr("Reset Access Tokens for Map Services"), tr("RESET"), tr("Reset self-service access tokens for Mapbox, Amap, and Google Maps."));
|
||||
connect(resetMapboxTokenBtn, &ButtonControl::clicked, [=]() {
|
||||
if (ConfirmationDialog::confirm(tr("Are you sure you want to reset the Mapbox access token?"), tr("Reset"), this)) {
|
||||
params.remove("CustomMapboxTokenPk");
|
||||
params.remove("CustomMapboxTokenSk");
|
||||
if (ConfirmationDialog::confirm(tr("Are you sure you want to reset access tokens for all map services?"), tr("Reset"), this)) {
|
||||
std::vector<std::string> tokens = {
|
||||
"CustomMapboxTokenPk",
|
||||
"CustomMapboxTokenSk",
|
||||
"AmapKey1",
|
||||
"AmapKey2",
|
||||
"GmapKey"
|
||||
};
|
||||
for (const auto& token : tokens) {
|
||||
params.remove(token);
|
||||
}
|
||||
}
|
||||
});
|
||||
addItem(resetMapboxTokenBtn);
|
||||
|
||||
Reference in New Issue
Block a user