Skip to content

Commit

Permalink
fix: render status
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfuboy committed Sep 9, 2022
1 parent e7dd0e3 commit 7146c04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<span
i18n="@@RequestHeaders"
nz-tooltip
[nzTooltipTitle]="wsStatus ? 'Editable only before connection' : ''"
[nzTooltipTitle]="wsStatus !== 'disconnect' ? 'Editable only before connection' : ''"
>Headers</span
>
</ng-template>
Expand All @@ -79,7 +79,7 @@
</nz-tab>
<nz-tab [nzTitle]="queryTitleTmp" [nzForceRender]="true">
<ng-template #queryTitleTmp>
<span i18n nz-tooltip [nzTooltipTitle]="wsStatus ? 'Editable only before connection' : ''"
<span i18n nz-tooltip [nzTooltipTitle]="wsStatus !== 'disconnect' ? 'Editable only before connection' : ''"
>Query Params</span
>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ export class WebsocketComponent implements OnInit, OnDestroy {
this.model.response.responseBody[index].isExpand = status == null ? true : !status;
}
renderStatus(status) {
const hash = new Map().set(true, 'Connected').set(false, 'Disconnect').set(null, 'Connecting');
const hash = new Map()
.set('connected', 'Connected')
.set('disconnect', 'Disconnect')
.set('connecting', 'Connecting');
return hash.get(status);
}
rawDataChange(e) {
Expand Down

0 comments on commit 7146c04

Please sign in to comment.