Skip to content

Commit

Permalink
fix: remove console river
Browse files Browse the repository at this point in the history
  • Loading branch information
RFbkak37y3kIY committed Nov 19, 2023
1 parent e95c136 commit 4f9f63e
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/app/components/Home/Home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class HomeComponent implements OnInit {
...files.filter((i: any) => i.children),
...files.filter((i: any) => !i.children)
];
console.log('FILES', this.files);
// console.log('FILES', this.files);
}
onClose(idx: number): void {
this.dialogs = this.dialogs.filter((i, k) => k !== idx);
Expand All @@ -72,7 +72,7 @@ export class HomeComponent implements OnInit {
if (!filename) {
return;
}
console.log('downloading file', filename);
// console.log('downloading file', filename);
const href = encodeURIComponent('/' + filename);
const url = `/webshark/json?method=download&capture=${href}&token=self`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export class ChartAndTableComponent implements OnInit {
return;
}

console.log({ val });
// console.log({ val });
const _data = val;
const arrTitle: any[] = [];
Object.entries(_data).forEach(([key, value]: any) => {
if (Array.isArray(value)) {
console.log({ key, value });
// console.log({ key, value });
this._data = value || [];
} else {
// this.title += `${value}`;
Expand All @@ -31,10 +31,10 @@ export class ChartAndTableComponent implements OnInit {
* get data for chart
*/
//
console.log('this._data', this._data);
// console.log('this._data', this._data);
var o: any = {};
this._data.forEach((i: any) => {
console.log(i)
// console.log(i)
Object.entries(i).map(([key, val]) => {
if (typeof val === 'number') {
if (!o[key]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class FlexibleChartComponent implements OnInit, AfterViewInit, OnDestroy

@Input() set typeOfChart(val: TypeOfChart) {
this._typeOfChart = val;
console.log({ val });
// console.log({ val });
this.redraw();
}
get typeOfChart(): TypeOfChart {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class MenuStatComponent implements OnInit {
async initMenu() {
try {
this.menuTreeIndex = [];
console.log('MENU:ngOnInit()')
// console.log('MENU:ngOnInit()')
const info = await this.webSharkDataService.getInfo();
const {
stats, nstat, convs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class TapRtpStreamsComponent implements OnInit {
isDone = done;
}

console.log({ collectArrayData });
// console.log({ collectArrayData });
return new Blob(collectArrayData, { type: DATA_TYPE });

}
Expand All @@ -88,7 +88,7 @@ export class TapRtpStreamsComponent implements OnInit {
this.progressMessage.push(`Reading data from ${this.captureFile} file`);
this.cdr.detectChanges();
const blobData: Blob = await this.getFileArrayOfUint8Array(this.captureFile);
console.log(this.captureFile, { blobData });
// console.log(this.captureFile, { blobData });
// const blobUrl = await transcode(blobData);
// console.log(blobUrl)

Expand All @@ -104,12 +104,12 @@ export class TapRtpStreamsComponent implements OnInit {
offset += 16;
return [offset, ...i.c, blobData.slice(offset, offset + +i.c[5], DATA_TYPE)];
})
console.log(arrOffset);
// console.log(arrOffset);
this.progressMessage.push('Collect payload binary to streams')
this.cdr.detectChanges();
// rtp-streams
const { taps: [{ streams: rtpStreams }] } = await this.webSharkDataService.getTapJson('rtp-streams');
console.log(rtpStreams);
// console.log(rtpStreams);

const arr = rtpStreams.map((streamData: any) => {
return {
Expand All @@ -120,24 +120,24 @@ export class TapRtpStreamsComponent implements OnInit {
.map((i: any) => (i[8] as Blob).slice(54)), { type: DATA_TYPE })
};
})
console.log({ arr })
// console.log({ arr })
const codecDictionary: any = {
'g711a': 'alaw',
'g711u': 'mulaw',
'g722': 'g722',
};
const out: any[] = [];
for (let item of arr) {
console.log('<>>>>', item.data);
// console.log('<>>>>', item.data);

const codec = codecDictionary[(item.data.payload + '').toLowerCase()] || 'g722';
console.log('<>>>>', {codec});
// console.log('<>>>>', {codec});

// const i = arr[0];
this.progressMessage.push(`FFmpeg:: converting ${item.ssrc} stream to audio (mp3)`);
this.cdr.detectChanges();
const blobUrl = await transcode(item.blob, codec, `audio-${item.ssrc}.mp3`);
console.log(blobUrl)
// console.log(blobUrl)

out.push({ ssrc: item.ssrc, blobUrl });
this.blobSaveAsFile(blobUrl, `audio-${item.ssrc}.mp3`);
Expand Down Expand Up @@ -205,14 +205,14 @@ export class TapRtpStreamsComponent implements OnInit {

}
async rowClick({ row }: any) {
console.log({ row });
// console.log({ row });
const id = `player-${hash(JSON.stringify(row))}`;
let playerElement = this.players.find(p => p.id === id);
if (!playerElement) {
const rowData = await this.webSharkDataService.getRTPStreamTap(row);
// const mp3link = this.webSharkDataService.getMp3LinkByRowData(row);
const { taps: [{ ssrc }] } = rowData;
console.log(this.audioStreamsBlobURL, { rowData })
// console.log(this.audioStreamsBlobURL, { rowData })

playerElement = {
id,
Expand Down Expand Up @@ -246,7 +246,7 @@ export class TapRtpStreamsComponent implements OnInit {
console.log({ event });
}
onZoomAudio(event: any, player: any) {
console.log(event.wheelDelta);
// console.log(event.wheelDelta);
if (!player._myZoom) {
player._myZoom = 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class TreeFilterComponent implements OnInit, AfterViewInit {
}
this.textFilterTree = val;
this.onKeyUpFilterTree();
console.log('textFilterTree = val')
// console.log('textFilterTree = val')
}
@Input() set jsonData(val: any) {
if (!val) {
Expand Down Expand Up @@ -69,7 +69,7 @@ export class TreeFilterComponent implements OnInit, AfterViewInit {
}
this.dataSource.data = val;
this.dataIndex = [];
console.log('this.dataSource.data = val;')
// console.log('this.dataSource.data = val;')
const pushToIndex = (i: any) => {
i.forEach(({ name, description, children }: any) => {
const o: any = { name, description: description || name };
Expand Down Expand Up @@ -185,7 +185,7 @@ export class TreeFilterComponent implements OnInit, AfterViewInit {
tc.collapseAll();
}
}
console.log('------------', this.bufferFiltered)
// console.log('------------', this.bufferFiltered)
const b = this.dataIndex.filter(i => !!Math.max(...this.textFilterTree.toLowerCase().split('||').map(f => {
return (i.description + i.name + (i.children || '')).toLowerCase().includes(f)
})));
Expand All @@ -201,7 +201,7 @@ export class TreeFilterComponent implements OnInit, AfterViewInit {
this.cdr.detectChanges();
}
onClickLine(data: any) {
console.log(data)
// console.log(data)
this.clickRow.emit(data);
}
}
6 changes: 3 additions & 3 deletions src/app/components/menu/menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class MenuComponent implements OnInit {
async initMenu() {
try {
this.menuTreeIndex = [];
console.log('MENU:ngOnInit()')
// console.log('MENU:ngOnInit()')
const {
stats, nstat, convs,
seqa, taps, eo,
Expand Down Expand Up @@ -98,7 +98,7 @@ export class MenuComponent implements OnInit {
return menu;
});

console.log('menu', { menuCollection, menuTree: this.menuTree });
// console.log('menu', { menuCollection, menuTree: this.menuTree });
this.cdr.detectChanges();
} catch (err) {
this.menuTree = [];
Expand All @@ -108,6 +108,6 @@ export class MenuComponent implements OnInit {
onSelected(event: any) {
const menuItem = this.menuTreeIndex.find((i: any) => i.name === event.name);
menuItem?.func();
console.log(event, this.menuTreeIndex.find((i: any) => i.name === event.name))
// console.log(event, this.menuTreeIndex.find((i: any) => i.name === event.name))
}
}
6 changes: 3 additions & 3 deletions src/ffmpeg-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!self.crossOriginIsolated) {

const { createFFmpeg, fetchFile } = FFmpeg;
const ffmpeg = createFFmpeg({
log: true,
log: false,
corePath: "./ffmpeg/ffmpeg-core.js",
progress: ({ ratio }) => {
message.innerHTML = `Complete: ${(ratio * 100.0).toFixed(2)}%`;
Expand Down Expand Up @@ -88,7 +88,7 @@ const defaults = {

const transcode = async (blobData, codec, output) => {
try {
console.log("Loading ffmpeg-core.js");
// console.log("Loading ffmpeg-core.js");

if (!ffmpeg.isLoaded()) {
await ffmpeg.load();
Expand Down Expand Up @@ -122,7 +122,7 @@ const transcode = async (blobData, codec, output) => {

const ffmpeg_data = await ffmpeg.run(...command);

console.log(ffmpeg_data);
// console.log(ffmpeg_data);
// await ffmpeg.run(
// "-f",
// "g722",
Expand Down
2 changes: 1 addition & 1 deletion src/proxy.demo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"/webshark/*": {
"target": "http://de4.sipcapture.io:8085/",
"target": "http://localhost:8085/",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
Expand Down

0 comments on commit 4f9f63e

Please sign in to comment.