Skip to content

Commit

Permalink
linting and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
williamsyang-work committed Feb 20, 2024
1 parent ff623b1 commit 0a4f424
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,9 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
<>
{/* Render the grey-out overlay if the server is down */}
{serverStatus === false && (
<div className="overlay">
<div className="warning-text">Please reconnect to resume using the application.</div>
</div>
<div className="overlay">
<div className="warning-text">Please reconnect to resume using the application.</div>
</div>
)}
<div
className="trace-context-container"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,18 @@ export class TraceExplorerServerStatusWidget extends ReactWidget {
};

render(): React.ReactNode {
const className = this.serverOn ? 'fa fa-check-circle-o fa-lg' : 'fa fa-times-circle-o fa-lg';

const className = this.serverOn ?
'fa fa-check-circle-o fa-lg' :
'fa fa-times-circle-o fa-lg';

const title = this.serverOn ?
'Server health and latency are good. No known issues' :
'Trace Viewer Critical Error: Trace Server Offline';
const title = this.serverOn
? 'Server health and latency are good. No known issues'
: 'Trace Viewer Critical Error: Trace Server Offline';

const color = this.serverOn ? 'green' : 'red';

return (
<div className="server-status-header">
<span className="theia-header">Server Status </span>
<i
id="server-status-id"
className={className}
title={title}
style={{ color, marginLeft: '5px' }}
/>
<i id="server-status-id" className={className} title={title} style={{ color, marginLeft: '5px' }} />
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ export class TraceExplorerWidget extends BaseWidget {
protected onServerStatusChange = (status: boolean): void => this.doHandleOnServerStatusChange(status);

protected doHandleOnServerStatusChange(status: boolean): void {

this.serverStatusWidget.updateStatus(status);
if (status === true) {
this.togglePlaceholderWidget(true);
Expand All @@ -154,5 +153,4 @@ export class TraceExplorerWidget extends BaseWidget {
this.traceViewsContainer.show();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ export class TraceServerConnectionStatusClientImpl implements TraceServerConnect
public updateStatus(status: boolean): void {
this._status = status;
if (this.active) {
this.listeners.forEach(fn => {
fn(status);
console.dir(fn);
});
this.listeners.forEach(fn => fn(status));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export class TraceViewerContribution
@inject(TracePreferences) protected tracePreferences: TracePreferences;
@inject(TraceServerConfigService) protected readonly traceServerConfigService: TraceServerConfigService;
@inject(MessageService) protected readonly messageService: MessageService;
@inject(TraceServerConnectionStatusClient) protected readonly serverStatusService: TraceServerConnectionStatusClient;
@inject(TraceServerConnectionStatusClient)
protected readonly serverStatusService: TraceServerConnectionStatusClient;

readonly id = TraceViewerWidget.ID;
readonly label = 'Trace Viewer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ export class TraceViewerWidget extends ReactWidget implements StatefulWidget {
@inject(ThemeService) protected readonly themeService: ThemeService;
@inject(OverviewPreferences) protected overviewPreferences: OverviewPreferences;
@inject(FileDialogService) protected readonly fileDialogService: FileDialogService;
@inject(TraceServerConnectionStatusClient) protected readonly connectionStatusService: TraceServerConnectionStatusClient;
@inject(TraceServerConnectionStatusClient)
protected readonly connectionStatusService: TraceServerConnectionStatusClient;

@postConstruct()
protected init(): void {
Expand Down Expand Up @@ -152,7 +153,6 @@ export class TraceViewerWidget extends ReactWidget implements StatefulWidget {
if (this.loadTraceOverview) {
this.doHandleTraceOverviewOpenedSignal(this.openedExperiment?.UUID);
}

}

protected readonly toDisposeOnNewExplorer = new DisposableCollection();
Expand Down Expand Up @@ -183,7 +183,6 @@ export class TraceViewerWidget extends ReactWidget implements StatefulWidget {
signalManager().off(Signals.OVERVIEW_OUTPUT_SELECTED, this.onTraceOverviewOutputSelected);
signalManager().off(Signals.SAVE_AS_CSV, this.onSaveAsCSV);
this.connectionStatusService.removeServerStatusChangeListener(this.onServerStatusChange);

}

protected async loadExperiment(): Promise<boolean> {
Expand Down Expand Up @@ -412,11 +411,9 @@ export class TraceViewerWidget extends ReactWidget implements StatefulWidget {
messageManager={this._signalHandler}
serverStatus={this.serverStatus}
/>
) :
!this.serverStatus ? (
) : !this.serverStatus ? (
'Server offline. Waiting to load...'
) :
(
) : (
'Trace is loading...'
)}
</div>
Expand Down

0 comments on commit 0a4f424

Please sign in to comment.