diff --git a/Dockerfile b/Dockerfile index 53fbf9f7..6a40a719 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,6 @@ FROM node:12-alpine RUN apk add git && git clone https://github.com/sipcapture/homer-ui /app WORKDIR /app -RUN npm install && npm install -g @angular/cli +RUN npm install && npm install -g @angular/cli@8.3.14 CMD ["ng","build"] diff --git a/angular.json b/angular.json index ed03aebd..9fd4ce28 100644 --- a/angular.json +++ b/angular.json @@ -23,7 +23,9 @@ }, "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + { "glob": "worker-javascript.js", "input": "./d /ace-builds/src-min/", "output": "/" }, + { "glob": "worker-json.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" } ], "styles": [ "src/styles.scss" @@ -37,7 +39,9 @@ "node_modules/ace-builds/src-min/mode-javascript.js", "node_modules/ace-builds/src-min/worker-html.js", "node_modules/ace-builds/src-min/worker-css.js", - "node_modules/ace-builds/src-min/worker-javascript.js" + "node_modules/ace-builds/src-min/worker-javascript.js", + "node_modules/ace-builds/src-min/mode-json.js", + "node_modules/ace-builds/src-min/worker-json.js" ] }, "configurations": { @@ -184,11 +188,15 @@ "node_modules/ace-builds/src-min/mode-javascript.js", "node_modules/ace-builds/src-min/worker-html.js", "node_modules/ace-builds/src-min/worker-css.js", - "node_modules/ace-builds/src-min/worker-javascript.js" + "node_modules/ace-builds/src-min/worker-javascript.js", + "node_modules/ace-builds/src-min/mode-json.js", + "node_modules/ace-builds/src-min/worker-json.js" ], "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + { "glob": "worker-javascript.js", "input": "./d /ace-builds/src-min/", "output": "/" }, + { "glob": "worker-json.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" } ] } }, diff --git a/package-lock.json b/package-lock.json index 334c7207..75da4f89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "homer-ui", - "version": "7.7.0", + "version": "7.8.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b8626307..68f03a34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homer-ui", - "version": "7.7.0", + "version": "7.8.1", "scripts": { "ng": "ng", "start": "ng serve --port 80", diff --git a/src/VERSION.ts b/src/VERSION.ts index f16c6166..257f4734 100644 --- a/src/VERSION.ts +++ b/src/VERSION.ts @@ -1 +1 @@ -export const VERSION = '7.8.0'; +export const VERSION = '7.8.1'; diff --git a/src/app/components/preference/dialogs/dialog-advanced/dialog-advanced.component.html b/src/app/components/preference/dialogs/dialog-advanced/dialog-advanced.component.html index 178eb42b..320ac5d6 100644 --- a/src/app/components/preference/dialogs/dialog-advanced/dialog-advanced.component.html +++ b/src/app/components/preference/dialogs/dialog-advanced/dialog-advanced.component.html @@ -21,7 +21,7 @@ Data
, @Inject(MAT_DIALOG_DATA) public data: any) { if ( data.isnew ) { data.data = { - partid: 10, - category: '', - param: '', - data: {}, - } + partid: 10, + category: '', + param: '', + data: {}, + }; } - data.data.data = data.isnew ? + data.data.data = data.isnew ? '' : (typeof data.data.data === 'string' ? data.data.data : @@ -30,5 +30,12 @@ export class DialogAdvancedComponent { onNoClick(): void { this.dialogRef.close(); } + ngOnInit() { + if (this.data.data.category === 'scripts') { + this.mode = 'javascript'; + } else { + this.mode = 'json'; + } + } -} \ No newline at end of file +} diff --git a/src/app/components/search-grid-call/detail-dialog/detail-dialog.component.html b/src/app/components/search-grid-call/detail-dialog/detail-dialog.component.html index 797260c5..8c4831f1 100644 --- a/src/app/components/search-grid-call/detail-dialog/detail-dialog.component.html +++ b/src/app/components/search-grid-call/detail-dialog/detail-dialog.component.html @@ -17,7 +17,7 @@ [ngStyle]="{'display': (activeTab <= 1) ? 'block' : 'none'}" >filter_list -
@@ -25,24 +25,12 @@
- - Combined by Alias - - -
+ + + {{type.value}} + + - - Show Ports - -
PayloadType:
{{ checkboxItem.title }} - - -
CallId:
-
+
{ const fc = Functions.cloneObject; this.sipDataItem.data.messages = fc(this._messagesBuffer).messages.filter(i => { diff --git a/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.html b/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.html index cd9ae928..c0867232 100644 --- a/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.html +++ b/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.html @@ -8,19 +8,20 @@
+
-
-
{{(!_isSimplifyPort ? 'PORT:' + itemhost.PORT : '')}}
-
{{ itemhost.shortIPtext2 }}
-
-
{{ shortcutIPv6String(ip) }}
-
+ +
{{ @@ -28,6 +29,15 @@ itemhost.shortIPtext2 : itemhost.alias }}
+ +
{{ itemhost.shortIPtext2 }}
+
+
{{ shortcutIPv6String(ip) }}
+
+
@@ -39,10 +49,10 @@ *ngFor="let item of arrayItems; let idx = index" [ngStyle]="{ 'min-width.px': (isSimplify ? 150 : 200) * (flowGridLines.length), - 'display': item.invisibleDisplayNone ? 'none' : 'flex', - 'overflow': item.invisibleDisplayNone ? 'hidden' : 'inherit', - 'max-height.px': !item.invisible ? 100 : 0, - 'opacity': !item.invisible ? 1 : 0.0001 + 'display': 'flex', + 'overflow': 'inherit', + 'max-height.px': 100, + 'opacity': 1 }">
@@ -58,7 +68,7 @@ }} {{ item.QOS ? item.QOS.MOS + ' [' + item.QOS.qosTYPEless + ']' : '' }}
-
{{item.ruri_user}}
+
{{ item.ruri_user }}
{{ item.srcPort }}
{{ item.dstPort }}
-
[{{ idx + 1 }}][{{ item.proto | uppercase }}] {{ item.micro_ts }}
-
+ {{ item.diffTs }} s
+ +
[{{ idx + 1 }}][{{ item.proto | uppercase }}] {{ item.micro_ts }}
+
+ {{ item.diffTs }} s
+
+ +
[{{ idx + 1 }}][{{ item.proto | uppercase }}] {{ item.micro_ts }} + {{ item.diffTs }} s
+
+ {{ item.diffTs }} s
+
diff --git a/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.scss b/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.scss index 0f5adc0d..80fd166c 100644 --- a/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.scss +++ b/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.scss @@ -253,3 +253,18 @@ border-radius: 4px; } } +.iptooltip{ + white-space: pre-line !important; + + font-size:11px !important; + font-weight: bold; + +} +.copysnack { + color:white !important; + background-color:rgb(61, 61, 61) !important; + .mat-simple-snackbar-action { + color: rgb(28, 221, 160) !important; + } + +} \ No newline at end of file diff --git a/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.ts b/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.ts index 73441549..3600dfa7 100644 --- a/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.ts +++ b/src/app/components/search-grid-call/detail-dialog/tab-flow/tab-flow.component.ts @@ -9,12 +9,15 @@ import { OnDestroy, ElementRef, ChangeDetectionStrategy, - ChangeDetectorRef + ChangeDetectorRef, + ViewEncapsulation } from '@angular/core'; import * as moment from 'moment'; import { MesagesData } from '../tab-messages/tab-messages.component'; import { Functions } from '../../../../helpers/functions'; import * as html2canvas from 'html2canvas'; +import { MatSnackBar } from '@angular/material/snack-bar'; + enum FlowItemType { SIP = 'SIP', @@ -27,7 +30,9 @@ enum FlowItemType { selector: 'app-tab-flow', templateUrl: './tab-flow.component.html', styleUrls: ['./tab-flow.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + encapsulation: ViewEncapsulation.None, + }) export class TabFlowComponent implements OnInit, AfterViewInit, OnDestroy { @ViewChild('flowtitle', {static: false}) flowtitle; @@ -43,7 +48,7 @@ export class TabFlowComponent implements OnInit, AfterViewInit, OnDestroy { _qosData: any; _flagAfterViewInit = false; _isSimplify = false; - public _isSimplifyPort = true; + public _isSimplifyPort = false; public _isCombineByAlias = true; private _dataItem: any; flowGridLines = []; @@ -57,7 +62,7 @@ export class TabFlowComponent implements OnInit, AfterViewInit, OnDestroy { if (!filters) { return; } - this._isSimplifyPort = !filters.isSimplifyPort; + this._isSimplifyPort = filters.isSimplifyPort; this._isCombineByAlias = filters.isCombineByAlias; setTimeout(this.initData.bind(this)); } @@ -105,7 +110,7 @@ export class TabFlowComponent implements OnInit, AfterViewInit, OnDestroy { arrayItemsRTP_AGENT: Array = []; _interval: any; - constructor(private cdr: ChangeDetectorRef) { } + constructor(private cdr: ChangeDetectorRef, private _snackBar :MatSnackBar) { } ngAfterViewInit() { this._flagAfterViewInit = true; @@ -319,7 +324,7 @@ export class TabFlowComponent implements OnInit, AfterViewInit, OnDestroy { if (at.length === 2 && at[1].arrip.length) { at.push({ empty: true - }) + }); } this.flowGridLines = Array.from({length: at.length - 1}); @@ -436,8 +441,8 @@ export class TabFlowComponent implements OnInit, AfterViewInit, OnDestroy { } pipeToString(itemhost) { const arr = itemhost.arrip || [itemhost.IP]; - return arr.join(' | '); - } + return arr.join(', '); + } onSavePng() { if (!this._flagAfterViewInit) { setTimeout(this.onSavePng.bind(this), 1000); @@ -453,4 +458,29 @@ export class TabFlowComponent implements OnInit, AfterViewInit, OnDestroy { }); } } + onCopyToClipboard(e){ + var el = document.createElement('textarea'); + el.value = e; + el.setAttribute('readonly', ''); + document.body.appendChild(el); + el.select(); + document.execCommand('copy'); + document.body.removeChild(el); + window.alert( "IP " + e + " copied to clipboard" ) + } + openSnackBar(e){ + var el = document.createElement('textarea'); + el.value = e; + el.setAttribute('readonly', ''); + document.body.appendChild(el); + el.select(); + document.execCommand('copy'); + document.body.removeChild(el); + let message = e; + let action = "copied to clipboard" + this._snackBar.open(message,action,{ + duration:3000, + panelClass: 'copysnack' + }) + } } diff --git a/src/app/components/search-grid-call/search-grid-call.component.ts b/src/app/components/search-grid-call/search-grid-call.component.ts index 73efd440..2f555121 100644 --- a/src/app/components/search-grid-call/search-grid-call.component.ts +++ b/src/app/components/search-grid-call/search-grid-call.component.ts @@ -948,7 +948,12 @@ export class SearchGridCallComponent implements OnInit, OnDestroy, AfterViewInit } if ( row.isLog || (row.data.payloadType === 1 && (row.data.raw || row.data.item && row.data.item.raw))) { - const data = row.data.item || row.data; + let data; + if (typeof row.data.item !== 'undefined' && row.data.item.length < 1) { + data = row.data.item; + } else { + data = row.data; + } mData.data = data || {}; mData.data.item = { raw: mData && mData.data && mData.data.raw ? mData.data.raw : 'raw is empty' diff --git a/src/app/components/widgets/protosearch-widget/protosearch-widget.component.ts b/src/app/components/widgets/protosearch-widget/protosearch-widget.component.ts index 06ae6031..b8989029 100644 --- a/src/app/components/widgets/protosearch-widget/protosearch-widget.component.ts +++ b/src/app/components/widgets/protosearch-widget/protosearch-widget.component.ts @@ -207,7 +207,11 @@ export class ProtosearchWidgetComponent implements IWidget, OnInit, AfterViewIni item.formControl.setValue(item.value); } if (item.field_name === ConstValue.CONTAINER && item.value !== '') { - this.targetResultsContainerValue.setValue(item.value); + if (!Array.isArray(item.value)) { + this.targetResultsContainerValue.setValue([item.value]); + } else { + this.targetResultsContainerValue.setValue(item.value); + } } if (item.type && @@ -254,7 +258,11 @@ export class ProtosearchWidgetComponent implements IWidget, OnInit, AfterViewIni if (item.field_name === ConstValue.CONTAINER) { const _c = this._cache ? this._cache.fields.find(i => i.name === ConstValue.CONTAINER) : null; if (_c) { - this.targetResultsContainerValue.setValue(_c.value); + if (!Array.isArray(_c.value)) { + this.targetResultsContainerValue.setValue([_c.value]); + } else { + this.targetResultsContainerValue.setValue(_c.value); + } item.value = _c.value; } else { item.value = Functions.cloneObject(this.widgetResultList[0]); diff --git a/src/app/components/widgets/smart-input-widget/smart-input-widget.component.ts b/src/app/components/widgets/smart-input-widget/smart-input-widget.component.ts index 6fb3d75a..60288e03 100644 --- a/src/app/components/widgets/smart-input-widget/smart-input-widget.component.ts +++ b/src/app/components/widgets/smart-input-widget/smart-input-widget.component.ts @@ -256,7 +256,11 @@ export class SmartInputWidgetComponent implements IWidget, OnInit, AfterViewInit item.formControl.setValue(item.value); } if (item.field_name === ConstValue.CONTAINER && item.value !== '') { - this.targetResultsContainerValue.setValue(item.value); + if (!Array.isArray(item.value)) { + this.targetResultsContainerValue.setValue([item.value]); + } else { + this.targetResultsContainerValue.setValue(item.value); + } } if (item.type && @@ -303,7 +307,11 @@ export class SmartInputWidgetComponent implements IWidget, OnInit, AfterViewInit if (item.field_name === ConstValue.CONTAINER) { const _c = this._cache ? this._cache.fields.find(i => i.name === ConstValue.CONTAINER) : null; if (_c) { - this.targetResultsContainerValue.setValue(_c.value); + if (!Array.isArray(_c.value)) { + this.targetResultsContainerValue.setValue([_c.value]); + } else { + this.targetResultsContainerValue.setValue(_c.value); + } item.value = _c.value; } else { item.value = Functions.cloneObject(this.widgetResultList[0]);