diff --git a/src/main/resources/static/css/custom.css b/src/main/resources/static/css/custom.css index 1f3c47f..e3c908f 100644 --- a/src/main/resources/static/css/custom.css +++ b/src/main/resources/static/css/custom.css @@ -1563,3 +1563,12 @@ figure div span { display: inline-block; margin-right: 5px; /* Adjust this value as per your requirement */ } + +.nav-link { + color: #AAAAAA; +} + +.nav-link.active{ + font-weight: bold; + color: #000000; +} \ No newline at end of file diff --git a/src/main/resources/templates/page/tester/apiTester.html b/src/main/resources/templates/page/tester/apiTester.html index 7b38663..6376a9c 100644 --- a/src/main/resources/templates/page/tester/apiTester.html +++ b/src/main/resources/templates/page/tester/apiTester.html @@ -398,6 +398,9 @@ apiRequestTabTitle.append(li); } }, + openTab: function(idx){ + $('#apiRequestTabTitle li:eq(' + idx + ') button').tab('show'); + }, renderTabContent: function (idx) { let apiRequestTabContent = $('#apiRequestTabContent'); @@ -488,11 +491,11 @@ }); me.requests[idx].onDidChangeModelContent(function (e) { - model.requestBody = me.requests[idx].getValue(); + model.requestBody = requestBodyEditor.getValue(); }); target.find('.request_body_type').on('change', function () { - let model = me.requests[idx].getModel(); + let model = requestBodyEditor.getModel(); monaco.editor.setModelLanguage(model, $(this).val()); }); @@ -510,9 +513,7 @@ target.find('.method').val(model.method); this.renderParam(idx); this.renderHeaders(idx); - - - $('#apiRequestTabTitle li:eq(' + view.currentIdx + ') button').tab('show'); + this.openTab(view.currentIdx); }, render: function () { let apiRequestTabContent = $('#apiRequestTabContent'); @@ -903,6 +904,13 @@ view.currentIdx = apiRequests.length - 1; view.renderTabHeader(); view.renderTabContent(view.currentIdx); + } else { + //show selected tab + view.currentIdx = apiRequests.findIndex(function (api) { + return api.id === selectedApi.id; + }); + + view.openTab(view.currentIdx); } } },