Skip to content

Commit

Permalink
Fixed major issue with dead code in the UI.
Browse files Browse the repository at this point in the history
Signed-off-by: Quobix <dave@quobix.com>
  • Loading branch information
daveshanley committed Aug 24, 2023
1 parent a3abf5c commit 43f1ed1
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions ui/src/wiretap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,19 @@ export class WiretapComponent extends LitElement {
private readonly _linkCacheStore: Bag<Map<string, Map<string, HttpTransactionBase[]>>>;
private readonly _specStore: Bag<string>;
private readonly _bus: Bus;
private readonly _useTLS: boolean = false;
private readonly _wiretapChannel: Channel;
private readonly _wiretapSpecChannel: Channel;
private readonly _wiretapControlsChannel: Channel;
private readonly _wiretapReportChannel: Channel;
private readonly _wiretapConfigChannel: Channel;
private readonly _staticNotificationChannel: Channel;
private readonly _wiretapPort: string;
private readonly _wiretapVersion: string;
private _transactionChannelSubscription: Subscription;
private _specChannelSubscription: Subscription;
private _configChannelSubscription: Subscription;
private _staticChannelSubscription: Subscription;
private _useTLS: boolean = false;

private _transactionContainer: HttpTransactionContainerComponent;

Expand Down Expand Up @@ -72,14 +82,15 @@ export class WiretapComponent extends LitElement {
// extract port from session storage.
this._wiretapPort = localStorage.getItem("wiretapPort");

if (!this._wiretapPort) {
this._wiretapPort = "9092"; // default port
}

const useTLS = localStorage.getItem("wiretapTLS");
if (useTLS && useTLS == 'true') {
this._useTLS = true;
}

if (!this._wiretapPort) {
this._wiretapPort = "9092"; // default port
}

// extract version from session storage.
this._wiretapVersion = localStorage.getItem("wiretapVersion");
Expand Down Expand Up @@ -120,6 +131,13 @@ export class WiretapComponent extends LitElement {
this._linkCacheStore =
this._storeManager.createBag<Map<string, Map<string, HttpTransactionBase[]>>>(WiretapLinkCacheStore);

// set up wiretap channels
this._wiretapChannel = this._bus.createChannel(WiretapChannel);
this._wiretapSpecChannel = this._bus.createChannel(SpecChannel);
this._wiretapControlsChannel = this._bus.createChannel(WiretapControlsChannel);
this._wiretapReportChannel = this._bus.createChannel(WiretapReportChannel);
this._wiretapConfigChannel = this._bus.createChannel(WiretapConfigurationChannel);
this._staticNotificationChannel = this._bus.createChannel(WiretapStaticChannel);

// map local bus channels to broker destinations.
this._bus.mapChannelToBrokerDestination(TopicPrefix + WiretapChannel, WiretapChannel);
Expand All @@ -129,6 +147,12 @@ export class WiretapComponent extends LitElement {
this._bus.mapChannelToBrokerDestination(QueuePrefix + WiretapConfigurationChannel, WiretapConfigurationChannel);
this._bus.mapChannelToBrokerDestination(TopicPrefix + WiretapStaticChannel, WiretapStaticChannel);

// handle incoming messages on different channels.
this._transactionChannelSubscription = this._wiretapChannel.subscribe(this.wireTransactionHandler());
this._specChannelSubscription = this._wiretapSpecChannel.subscribe(this.specHandler());
this._configChannelSubscription = this._wiretapConfigChannel.subscribe(this.configHandler());
this._staticChannelSubscription = this._staticNotificationChannel.subscribe(this.staticHandler());


// load previous transactions from local storage.
this.loadHistoryFromLocalStorage().then((previousTransactions: Map<string, HttpTransaction>) => {
Expand Down

0 comments on commit 43f1ed1

Please sign in to comment.