Skip to content

Commit

Permalink
Merge pull request #624 from sipcapture/devel
Browse files Browse the repository at this point in the history
Update version
  • Loading branch information
RFbkak37y3kIY committed Jul 11, 2023
2 parents 80ccb92 + a1d0ca0 commit f79d9cf
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 17 deletions.
Expand Up @@ -134,11 +134,36 @@ <h1 style="text-align: center; padding: 8rem; color: #aaa">
</div>
</div>
<div class="VS-Container-horizontal">
<div
*ngIf="isSafari"
class="VS-Container"
style="overflow: auto !important"
(scroll)="onScrollVScrollWrapper($event)"
>
<div
class="VS-Container"
style="height: initial; overflow: initial !important;"
[style.min-width.px]="pageWidth + 100"

>
<div style="height: 92px"></div>
<app-flow-item
*ngFor="let item of arrayItems; let idx = index"
[item]="item"
[idx]="idx"
[isGroupByAlias]="_isCombineByAlias"
[isSimplify]="isSimplify"
[isAbsolute]="false"
(itemClick)="onClickMessage($event.idx, $event.event, item)"
></app-flow-item>
<div style="height: 60px"></div>
</div>
</div>
<div
class="VS-Container"
style="overflow-y: hidden !important"
(scroll)="onScrollVScrollWrapper($event)"
*ngIf="!isExport"
*ngIf="!isExport && !isSafari"
#VScrollWrapper
>
<cdk-virtual-scroll-viewport
Expand Down Expand Up @@ -234,7 +259,7 @@ <h1 style="text-align: center; padding: 8rem; color: #aaa">
</div> -->
<div
class="virtual-scrollbar"
*ngIf="!isExport"
*ngIf="!isExport && !isSafari"
(mousedown)="setScrollTarget('virtualScrollbar')"
(scroll)="setVirtualScrollHeight($event)"
#virtualScrollbar
Expand Down
Expand Up @@ -49,8 +49,7 @@ export class CustomVirtualScrollStrategy extends FixedSizeVirtualScrollStrategy
],
})
export class TabFlowComponent
implements OnInit, AfterViewInit, AfterViewChecked, OnDestroy
{
implements OnInit, AfterViewInit, AfterViewChecked, OnDestroy {
@ViewChild('flowscreen', { static: true }) flowscreen: ElementRef;
@ViewChild('canvas', { static: true }) canvas: ElementRef;
@ViewChild('downloadLink', { static: true }) downloadLink: ElementRef;
Expand All @@ -59,6 +58,11 @@ export class TabFlowComponent
@ViewChild('VScrollWrapper') VScrollWrapper: ElementRef;
@ViewChild('labelContainer') labelContainer: ElementRef;
@Input() callIDColorList: Array<CallIDColor>;
/**
* Detect Safari browser
*/
isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);


_interval = null;
public getVirtualScrollHeight: string = `translateY(1px)`;
Expand Down Expand Up @@ -103,7 +107,7 @@ export class TabFlowComponent
this._isSimplify = v;
try {
this.virtualScroll._contentWrapper;
} catch (e) {}
} catch (e) { }
requestAnimationFrame(() => this.cdr.detectChanges());
}
get isSimplify(): boolean {
Expand Down Expand Up @@ -175,7 +179,7 @@ export class TabFlowComponent
private messageDetailsService: MessageDetailsService,
private copyService: CopyService,
private transactionFilterService: TransactionFilterService
) {}
) { }

ngOnInit() {
this.getVirtualScrollHeight = `translateY(1px)`;
Expand Down Expand Up @@ -312,9 +316,8 @@ export class TabFlowComponent
const color = this.callIDColorList?.find(
(callID) => callID.callID === item.callid
);
const compiledColor = `hsla(${color?.decompiledColor?.hue}, ${
color?.decompiledColor?.saturation
}%, ${color?.decompiledColor?.lightness - 10}%, 1)`;
const compiledColor = `hsla(${color?.decompiledColor?.hue}, ${color?.decompiledColor?.saturation
}%, ${color?.decompiledColor?.lightness - 10}%, 1)`;
item.options = {
mosColor,
color:
Expand Down Expand Up @@ -364,8 +367,8 @@ export class TabFlowComponent
return isCombineByAlias
? [srcAlias || i.source_ip, dstAlias || i.destination_ip]
: isSimplifyPort
? [i.source_ip, i.destination_ip]
: [`${sIP}:${i.source_port}`, `${dIP}:${i.destination_port}`];
? [i.source_ip, i.destination_ip]
: [`${sIP}:${i.source_port}`, `${dIP}:${i.destination_port}`];
});

// sort hosts by Items timeline
Expand Down Expand Up @@ -431,8 +434,8 @@ export class TabFlowComponent
? host.alias === alias
: host.ip === ip
: this.isSimplifyPort
? host.ip === ip
: host.ip === ip && (host.port * 1 === port * 1 || !port);
? host.ip === ip
: host.ip === ip && (host.port * 1 === port * 1 || !port);
} catch (err) {
throw host;
}
Expand Down Expand Up @@ -608,9 +611,8 @@ export class TabFlowComponent
const color = this.callIDColorList?.find(
(callID) => callID.callID === callid
);
const adjustedColor = `hsl(${color?.decompiledColor?.hue}, ${
color?.decompiledColor?.saturation
}%, ${color?.decompiledColor?.lightness / 1.5}%, 1`;
const adjustedColor = `hsl(${color?.decompiledColor?.hue}, ${color?.decompiledColor?.saturation
}%, ${color?.decompiledColor?.lightness / 1.5}%, 1`;
return typeof color !== 'undefined'
? adjustedColor
: Functions.getColorByString(callid, undefined, 50, 1);
Expand Down Expand Up @@ -647,7 +649,7 @@ export class TabFlowComponent
try {
const { scrollLeft } = event?.target || {};
this.flowscreen.nativeElement.style.marginLeft = `${-scrollLeft}px`;
} catch (e) {}
} catch (e) { }
}

cdkWheelScroll(event?: any) {
Expand Down

0 comments on commit f79d9cf

Please sign in to comment.