Skip to content

Commit fbdcbba

Browse files
committed
feat(tray): add Config button to dashboard panel via open-config API
Adds POST /api/open-config endpoint that invokes configWindowFunc to show the config window. Adds a gear-icon Config button to the dashboard action-buttons row with a click handler that calls the endpoint.
1 parent d08d2b4 commit fbdcbba

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

cmd/sap-devs-tray/frontend/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
<div class="action-buttons">
6868
<button type="button" class="fd-button fd-button--emphasized" id="btn-sync">&#8635; Sync Now</button>
6969
<button type="button" class="fd-button" id="btn-inject">&#8635; Inject Now</button>
70+
<button type="button" class="fd-button" id="btn-config">&#9881; Config</button>
7071
</div>
7172

7273
<script src="js/app.js"></script>

cmd/sap-devs-tray/frontend/js/app.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@
215215
});
216216
}
217217

218+
var btnConfig = document.getElementById('btn-config');
219+
if (btnConfig) {
220+
btnConfig.addEventListener('click', function() {
221+
fetch('/api/open-config?token=' + token, { method: 'POST' });
222+
});
223+
}
224+
218225
fetchState();
219226
setInterval(fetchState, 30000);
220227
});

0 commit comments

Comments
 (0)