For postman-like http client change default tab for response view to Browser Preview

This commit is contained in:
Peter Stockings
2024-03-29 19:57:23 +11:00
parent e92a1ad69d
commit c2cf448528

View File

@@ -82,7 +82,7 @@ show_refresh=False, show_link=False, show_edit_form=True, show_client=True, show
this.responseHeaders = [];
this.responseSize = 0;
this.activeTab = 'Query Params';
this.activeResponseTab = 'Body'
this.activeResponseTab = 'Browser Preview'
this.headers = [{ key: 'Content-Type', value: 'application/json' }, { key: '', value: '' }];
this.queryParams = [{ key: '', value: '' }];
},
@@ -163,7 +163,7 @@ show_refresh=False, show_link=False, show_edit_form=True, show_client=True, show
]),
this.response ? m("div.my-4.p-4.shadow.rounded-lg", [
m("div.flex.items-center.mb-4.justify-between", [
m("ul.flex.border.border-gray-300.rounded-t-lg", [{ name: 'Body', count: null }, { name: 'Headers', count: this.responseHeaders.length }, { name: 'Browser Preview', count: null }].map(({ name, count }) =>
m("ul.flex.border.border-gray-300.rounded-t-lg", [{ name: 'Browser Preview', count: null }, { name: 'Headers', count: this.responseHeaders.length }, { name: 'Body', count: null }].map(({ name, count }) =>
m("li.mr-3.py-2.px-4.border-orange-400.focus:outline-none.hover:text-orange-500.cursor-pointer", {
class: this.activeResponseTab === name ? "border-b-2 text-orange-600" : "",
onclick: () => this.activeResponseTab = name