Skip to content

Commit 32e6671

Browse files
committed
refactor: read server URLs from dropdown instead of parsing displayed URLs
Signed-off-by: Yash-Raj-5424 <myash3499@gmail.com>
1 parent 2d5e4c8 commit 32e6671

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

static/js/rest-api-executor.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,18 @@ class RESTAPIExecutor {
177177
/**
178178
* Extract available servers from panel
179179
* @param {Element} operationPanel - The operation panel element
180-
* @returns {Array} Server URLs
180+
* @returns {Array} Server URLs from the server selector dropdown
181181
*/
182182
extractServers(operationPanel) {
183-
const trySection = operationPanel.querySelector('.rest-api-section--try');
184-
if (!trySection) return ['https://cloud.layer5.io'];
183+
const serverSelect = operationPanel.querySelector('[data-server-select]');
184+
if (!serverSelect) return ['https://cloud.layer5.io'];
185185

186186
const servers = [];
187-
const tryItems = trySection.querySelectorAll('.rest-api-try-item');
188-
tryItems.forEach(item => {
189-
const baseUrl = item.dataset.baseUrl;
190-
if (baseUrl && !servers.includes(baseUrl)) {
191-
servers.push(baseUrl);
187+
const options = serverSelect.querySelectorAll('option');
188+
options.forEach(option => {
189+
const url = option.value;
190+
if (url && !servers.includes(url)) {
191+
servers.push(url);
192192
}
193193
});
194194

0 commit comments

Comments
 (0)