import { ConnectedPosition } from '@angular/cdk/overlay';
import { DatePipe, DecimalPipe, JsonPipe, KeyValuePipe, SlicePipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, OnInit, Signal, computed, effect, signal } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { humanBytes } from '@deepkit/core';
import {
ButtonGroupComponent,
CheckboxComponent,
DropdownComponent,
IconComponent,
InputComponent,
LabelComponent,
LabelGridComponent,
OpenDropdownDirective,
OptionDirective,
SelectBoxComponent,
TabButtonComponent,
TableCellDirective,
TableColumnDirective,
TableComponent,
} from '@deepkit/desktop-ui';
import { CodeHighlightComponent, DeepkitBoxComponent } from '@deepkit/ui-library';
import { Client, RpcAction, clearClient, clients } from '../collector';
@Component({
styles: `
:host {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
.client {
display: flex;
flex-direction: row;
height: 100%;
flex: 1;
.stats {
width: 300px;
padding: 10px;
}
}
.filter {
height: 28px;
display: flex;
align-items: center;
}
.stats {
.block {
margin: 5px 0;
}
}
.summary-actions {
table-layout: fixed;
width: 100%;
.action {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.value {
width: 40px;
text-align: right;
padding-left: 10px;
padding-right: 5px;
}
}
.data {
flex: 1;
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
code-highlight {
margin-left: 5px;
}
table.pretty {
table-layout: fixed;
width: 100%;
td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 5px;
}
}
`,
template: `
{{ message.action }}
{{ message.timestamp | date: 'medium' }}
Took:
@if (message.took) {
{{ message.took | number: '0.0-3' }} ms
} @else {
@if (message.mode !== 'static') {
@if (message.completed) {
{{ message.completed - message.timestamp | number: '0.0-3' }} ms
} @else {
active
}
}
}
Total size:
{{ humanBytes(message.size) }}
Sent size:
{{ humanBytes(message.sizeSent) }}
Received size:
{{ humanBytes(message.sizeReceived) }}