diff --git a/ide/src/base-ui/select/LitSelect.ts b/ide/src/base-ui/select/LitSelect.ts index 6f6768bef04f461d1171cf824f4c222686d0ed89..aad124e5c4d87417f569bb5ed2acf24fbeb63129 100644 --- a/ide/src/base-ui/select/LitSelect.ts +++ b/ide/src/base-ui/select/LitSelect.ts @@ -216,12 +216,12 @@ export class LitSelect extends BaseElement { initElements(): void { this.selectVInputEl = this.shadowRoot!.querySelector('#select-input') as HTMLInputElement; - this.selectVInputEl?.addEventListener('keyup', (e) => { - if (e.code === 'Enter' || e.code === 'NumpadEnter') {// @ts-ignore - this.selectVInputEl.blur();// @ts-ignore - this.selectInputEl.value=this.selectVInputEl.value; - } - }); + this.selectVInputEl?.addEventListener('keyup', (e) => { + if (e.code === 'Enter' || e.code === 'NumpadEnter') {// @ts-ignore + this.selectVInputEl.blur();// @ts-ignore + this.selectInputEl.value = this.selectVInputEl.value; + } + }); if (this.showSearchInput) { this.shadowRoot!.querySelector('.body-select')!.style.display = 'block'; this.selectSearchInputEl = this.shadowRoot!.querySelector('#search-input') as HTMLInputElement; diff --git a/ide/src/base-ui/select/LitSelectV.ts b/ide/src/base-ui/select/LitSelectV.ts index 28f3f1919f6325c9b6e95e7cf524b04042d01366..a6d2e5cdb339ed13d83e74ba9ed7832355bfbd6b 100644 --- a/ide/src/base-ui/select/LitSelectV.ts +++ b/ide/src/base-ui/select/LitSelectV.ts @@ -109,7 +109,7 @@ export class LitSelectV extends BaseElement { return this.hasAttribute('is-all'); } - dataSource(selectVData: Array, valueStr: string,isSingle?:boolean): void { + dataSource(selectVData: Array, valueStr: string, isSingle?: boolean): void { this.selectVOptions!.innerHTML = ''; if (selectVData.length > 0) { this.selectVBody!.style.display = 'block'; @@ -125,14 +125,14 @@ export class LitSelectV extends BaseElement { option.textContent = valueStr; this.selectVOptions!.appendChild(option); this.initDataItem(selectVData); - if(isSingle){ + if (isSingle) { this.initSingleCustomOptions(); } else { this.initCustomOptions(); } } else { this.initDataItem(selectVData); - if(isSingle){ + if (isSingle) { this.initSingleCustomOptions(); } else { this.initOptions(); @@ -171,7 +171,7 @@ export class LitSelectV extends BaseElement { this.selectVInputEl?.addEventListener('keyup', (e) => { if (e.code === 'Enter' || e.code === 'NumpadEnter') {// @ts-ignore this.selectVInputEl.blur(); - } + } });// @ts-ignore this.selectVInputEl!.oninput = (ev: InputEvent): void => { // @ts-ignore @@ -250,7 +250,7 @@ export class LitSelectV extends BaseElement { `; } - connectedCallback(): void {} + connectedCallback(): void { } initCustomOptions(): void { let querySelector = this.shadowRoot?.querySelector( @@ -291,22 +291,22 @@ export class LitSelectV extends BaseElement { } initSingleCustomOptions(): void { - let selectedOption = this.shadowRoot?.querySelector( - `lit-select-option[value="${this.currentvalueStr}"]` - ) as LitSelectOption | null; - if (selectedOption) { - selectedOption.setAttribute('selected', ''); - } - this.shadowRoot?.querySelectorAll('lit-select-option').forEach((option) => { - option.addEventListener('onSelected', () => { - this.shadowRoot?.querySelectorAll('lit-select-option').forEach((o) => { - o.removeAttribute('selected'); - }); - option.setAttribute('selected', ''); // @ts-ignore - this.selectVInputEl!.value = option.textContent!; - this.currentvalueStr = option.textContent!; - }); - }); + let selectedOption = this.shadowRoot?.querySelector( + `lit-select-option[value="${this.currentvalueStr}"]` + ) as LitSelectOption | null; + if (selectedOption) { + selectedOption.setAttribute('selected', ''); + } + this.shadowRoot?.querySelectorAll('lit-select-option').forEach((option) => { + option.addEventListener('onSelected', () => { + this.shadowRoot?.querySelectorAll('lit-select-option').forEach((o) => { + o.removeAttribute('selected'); + }); + option.setAttribute('selected', ''); // @ts-ignore + this.selectVInputEl!.value = option.textContent!; + this.currentvalueStr = option.textContent!; + }); + }); } initOptions(): void { @@ -369,5 +369,5 @@ export class LitSelectV extends BaseElement { }); } - attributeChangedCallback(name: unknown, oldValue: unknown, newValue: unknown): void {} + attributeChangedCallback(name: unknown, oldValue: unknown, newValue: unknown): void { } } diff --git a/ide/src/hdc/hdcclient/HdcClient.ts b/ide/src/hdc/hdcclient/HdcClient.ts index 93c726df2794bf7aa7d2e26b5839924d79562da0..5393d55cbd76d9da46093ea60d4845a828676304 100644 --- a/ide/src/hdc/hdcclient/HdcClient.ts +++ b/ide/src/hdc/hdcclient/HdcClient.ts @@ -77,7 +77,7 @@ export class HdcClient implements DataListener { case AuthType.AUTH_TOKEN: continue; case AuthType.AUTH_SIGNATURE: - const hdcMsgUrl = this.isSigna ? 'signatureHdcMsg' : 'encryptHdcMsg' + const hdcMsgUrl = this.isSigna ? 'signatureHdcMsg' : 'encryptHdcMsg'; const response = await fetch(`${window.location.origin}/application/${hdcMsgUrl}?message=` + returnBuf); const dataBody = await response.json(); let signatureHdcMsg = ''; diff --git a/ide/src/trace/component/SpBubblesAI.ts b/ide/src/trace/component/SpBubblesAI.ts index 9d03886ff403a2eb81483ac2b231cea5649492de..addf5fdf2293dce66850445ca9c50b0005a3dfa3 100644 --- a/ide/src/trace/component/SpBubblesAI.ts +++ b/ide/src/trace/component/SpBubblesAI.ts @@ -23,7 +23,7 @@ export class SpBubblesAI extends BaseElement { const xiaoLubanEl: HTMLElement | undefined | null = this.shadowRoot?.querySelector('#xiao-luban-help'); xiaoLubanEl?.addEventListener('click', () => { this.xiaoLubanEvent(); - }) + }); let isShowXiaoLuban: boolean = FlagsConfig.getFlagsConfigEnableStatus('xiaoLuBan'); if (isShowXiaoLuban) { xiaoLubanEl?.setAttribute('enabled', ''); @@ -45,7 +45,7 @@ export class SpBubblesAI extends BaseElement { 'msgType': 'text', 'timestamp': new Date().getTime().toString(), 'botUser': 'p_xiaoluban', - } + }; fetch('https://smartperf.rnd.huawei.com/xiaoluban/resource', { method: 'post', body: JSON.stringify(data), @@ -54,9 +54,9 @@ export class SpBubblesAI extends BaseElement { } }).then(res => { if (res.status === 200) { - window.open('im:p_xiaoluban', "_self"); + window.open('im:p_xiaoluban', '_self'); } - }) + }); } } diff --git a/ide/src/trace/component/SpFlags.ts b/ide/src/trace/component/SpFlags.ts index a8e6cf63527a7d75e13d7ec0cdf2fa84d17cb9f7..308ee5c24821e205a25ee4083c3e6b19ccae0e70 100644 --- a/ide/src/trace/component/SpFlags.ts +++ b/ide/src/trace/component/SpFlags.ts @@ -18,22 +18,22 @@ import { SpFlagHtml } from './SpFlag.html'; const NUM = '000000'; //vsync二级下拉选框对应的value和content const VSYNC_CONTENT = [ - { value: 'H:VsyncGenerator', content: "VsyncGeneratior" }, + { value: 'H:VsyncGenerator', content: 'VsyncGeneratior' }, { value: 'H:rs_SendVsync', content: 'Vsync-rs' }, { value: 'H:rs_SendVsync', content: 'Vsync-app' } -] +]; //cat二级下拉选框对应的value和content const CAT_CONTENT = [ - { value: 'business', content: "Business first" }, + { value: 'business', content: 'Business first' }, { value: 'thread', content: 'Thread first' } -] +]; //hang二级下拉选框对应的value和content const HANG_CONTENT = [ - { value: `33${NUM}`, content: "Instant" }, + { value: `33${NUM}`, content: 'Instant' }, { value: `100${NUM}`, content: 'Circumstantial' }, { value: `250${NUM}`, content: 'Micro' }, { value: `500${NUM}`, content: 'Severe' } -] +]; //整合默认值 const CONFIG_STATE: unknown = { @@ -214,7 +214,7 @@ export class SpFlags extends BaseElement { } else { userIdInputEl.style.border = '1px solid red'; } - }) + }); userIdInputEl.className = 'device_input'; userIdInputEl.id = 'user_id_input'; configFooterDiv.appendChild(userIdLabelEl); diff --git a/ide/src/trace/component/chart/SpChartManager.ts b/ide/src/trace/component/chart/SpChartManager.ts index 68a962fd5e5d0ed29ca95a61f619c83641191328..a852490e04703fb9da1a9fdf35edca557d3645ae 100644 --- a/ide/src/trace/component/chart/SpChartManager.ts +++ b/ide/src/trace/component/chart/SpChartManager.ts @@ -58,7 +58,7 @@ import { sliceSender } from '../../database/data-trafic/SliceSender'; import { BaseStruct } from '../../bean/BaseStruct'; import { SpGpuCounterChart } from './SpGpuCounterChart'; import { SpUserFileChart } from './SpUserPluginChart'; -import { SpImportUserPluginsChart } from './SpImportUserPluginsChart' +import { SpImportUserPluginsChart } from './SpImportUserPluginsChart'; import { queryDmaFenceIdAndCat } from '../../database/sql/dmaFence.sql'; import { queryAllFuncNames } from '../../database/sql/Func.sql'; diff --git a/ide/src/trace/component/chart/SpFrameTimeChart.ts b/ide/src/trace/component/chart/SpFrameTimeChart.ts index 30c95421fa3eb49752ed160f10bd7173a067412a..7f1b0b762060e789d4b2c351b2cbd10c18c48445 100644 --- a/ide/src/trace/component/chart/SpFrameTimeChart.ts +++ b/ide/src/trace/component/chart/SpFrameTimeChart.ts @@ -246,7 +246,7 @@ export class SpFrameTimeChart { this.flagConfig = FlagsConfig.getFlagsConfig('AnimationAnalysis'); let appNameMap: Map = new Map(); //@ts-ignore - if (this.flagConfig?.AnimationAnalysis === 'Enabled' && sourceTypeName[0].value !== "txt-based-trace") { + if (this.flagConfig?.AnimationAnalysis === 'Enabled' && sourceTypeName[0].value !== 'txt-based-trace') { if (process.processName?.startsWith('render_service')) { let targetRowList = processRow.childrenList.filter( (childRow) => childRow.rowType === 'thread' && childRow.name.startsWith('render_service') diff --git a/ide/src/trace/component/chart/SpImportUserPluginsChart.ts b/ide/src/trace/component/chart/SpImportUserPluginsChart.ts index de06578d59327160ee766cfc182fd988dbfba958..3baccaff92dcaa5d9acd6b99a2bbfe453635480b 100644 --- a/ide/src/trace/component/chart/SpImportUserPluginsChart.ts +++ b/ide/src/trace/component/chart/SpImportUserPluginsChart.ts @@ -25,6 +25,7 @@ import { ProcessMemStruct } from '../../bean/ProcessMemStruct'; import { MemRender } from '../../database/ui-worker/ProcedureWorkerMem'; import { FuncRender, FuncStruct } from '../../database/ui-worker/ProcedureWorkerFunc'; import { ThreadRender } from '../../database/ui-worker/ProcedureWorkerThread'; +import { promises } from 'dns'; const FOLD_HEIGHT = 24; export class SpImportUserPluginsChart { private trace: SpSystemTrace; @@ -35,7 +36,7 @@ export class SpImportUserPluginsChart { this.trace = trace; } - async init(traceId?: string) { + async init(traceId?: string): Promise { this.traceId = traceId; //@ts-ignore let folderRow = this.createFolderRow(this.traceId); @@ -66,7 +67,7 @@ export class SpImportUserPluginsChart { * @param row * @param start_ts */ - addTraceRowEventListener(row: TraceRow) { + addTraceRowEventListener(row: TraceRow): void { row.uploadEl?.addEventListener('sample-file-change', (e: unknown) => { this.getJsonData(e).then((res: unknown) => { if (row.childrenList.length) { this.handleDynamicRowList(row); } @@ -104,17 +105,17 @@ export class SpImportUserPluginsChart { this.addDrawAttributes(item, childRow, element); row.summaryProtoPid!.push(childRow.protoPid); row.addChildTraceRow(childRow); - } - } - }) + }; + }; + }); row.expansion = true; - } - this.trace.refreshCanvas(false) - }) - }) + }; + this.trace.refreshCanvas(false); + }); + }); } //清空row-parent-id='UserPluginsRows'动态添加的子Row的list数据 - handleDynamicRowList(row: TraceRow) { + handleDynamicRowList(row: TraceRow): void { row.summaryProtoPid = []; // 使用querySelectorAll找到所有row-parent-id='UserPluginsRows'的div元素 //@ts-ignore @@ -135,21 +136,23 @@ export class SpImportUserPluginsChart { row.childrenList = []; } - addDrawAttributes(item: { rowType: string, threadName: string }, childRow: TraceRow, element: unknown) { + addDrawAttributes(item: { rowType: string, threadName: string }, childRow: TraceRow, element: unknown): void { //@ts-ignore if (element.supplier) { - childRow.supplier = async () => { + //@ts-ignore + childRow.supplier = async (): Promise => { //@ts-ignore let res = await element.supplier!(); - return res - } + return res; + }; //@ts-ignore } else if (element.supplierFrame) { - childRow.supplierFrame = async () => { + //@ts-ignore + childRow.supplierFrame = async (): Promise => { //@ts-ignore let res = await element.supplierFrame!(); - return res - } + return res; + }; } if (item.rowType === TraceRow.ROW_TYPE_MEM) {//处理mem childRow.findHoverStruct = (): void => { @@ -180,10 +183,10 @@ export class SpImportUserPluginsChart { } //@ts-ignore if (element.asyncFuncThreadName) { - //@ts-ignore - childRow.asyncFuncThreadName = element.asyncFuncThreadName; //@ts-ignore - childRow.asyncFuncNamePID = element.asyncFuncNamePID; + childRow.asyncFuncThreadName = element.asyncFuncThreadName; + //@ts-ignore + childRow.asyncFuncNamePID = element.asyncFuncNamePID; } childRow.findHoverStruct = (): void => { //@ts-ignore @@ -206,14 +209,14 @@ export class SpImportUserPluginsChart { let reader = new FileReader(); //@ts-ignore reader.readAsText(file.detail || file); - reader.onloadend = (e: unknown) => { + reader.onloadend = (e: unknown): void => { //@ts-ignore const fileContent = e.target?.result; try { resolve(JSON.parse(fileContent)); document.dispatchEvent( new CustomEvent('file-correct') - ) + ); SpStatisticsHttpUtil.addOrdinaryVisitAction({ event: 'seach-row', action: 'seach-row', @@ -221,10 +224,10 @@ export class SpImportUserPluginsChart { } catch (error) { document.dispatchEvent( new CustomEvent('file-error') - ) + ); } } - }) + }); } } export const folderThreadHandler = (row: TraceRow, trace: SpSystemTrace) => { diff --git a/ide/src/trace/component/chart/SpProcessChart.ts b/ide/src/trace/component/chart/SpProcessChart.ts index af5b0d19f81bd443923282c1647f24983bc71154..4ac0f5ccb8efd6226eec05adb7bed05cc70f18d6 100644 --- a/ide/src/trace/component/chart/SpProcessChart.ts +++ b/ide/src/trace/component/chart/SpProcessChart.ts @@ -1383,17 +1383,20 @@ export class SpProcessChart { ({ setArrayLenThanOne, setArrayLenOnlyOne } = this.hanldAsyncFunc(it, asyncRemoveCatArr));//len等于0和大于0的分类 //@ts-ignore let aggregateData = {...setArrayLenThanOne, ...setArrayLenOnlyOne }; - Reflect.ownKeys(aggregateData).map((key: any) => { - let param: Array = aggregateData[key]; + Reflect.ownKeys(aggregateData).map((key: unknown) => { + let param: Array = aggregateData[key]; + //@ts-ignore this.makeAddAsyncFunction(param, it, processRow, key); }) //@ts-ignore - Reflect.ownKeys(asyncCat).map((key: any) => { + Reflect.ownKeys(asyncCat).map((key: unknown) => { //@ts-ignore - let param: Array = asyncCat[key]; + let param: Array = asyncCat[key]; if (flag) {//处理business + //@ts-ignore this.makeAddAsyncFunction(param, it, processRow, key); } else {//处理thread + //@ts-ignore this.makeAddAsyncFunction(param, it, processRow, key, param[0].tid); } }) diff --git a/ide/src/trace/component/chart/SpSegmentationChart.ts b/ide/src/trace/component/chart/SpSegmentationChart.ts index 0fecf8815c4d9cb699746e7f0c4decb5901a5741..430d7bf5456f10c05056fe6645d1a457ee3cefcd 100644 --- a/ide/src/trace/component/chart/SpSegmentationChart.ts +++ b/ide/src/trace/component/chart/SpSegmentationChart.ts @@ -24,7 +24,7 @@ import { type AllStatesRender, AllstatesStruct } from '../../database/ui-worker/ import { StateGroup } from '../../bean/StateModle'; import { queryAllFuncNames } from '../../database/sql/Func.sql'; import { Utils } from '../trace/base/Utils'; -import { TabPaneFreqUsage } from "../trace/sheet/frequsage/TabPaneFreqUsage"; +import { TabPaneFreqUsage } from '../trace/sheet/frequsage/TabPaneFreqUsage'; const UNIT_HEIGHT: number = 20; const MS_TO_US: number = 1000000; const MIN_HEIGHT: number = 2; diff --git a/ide/src/trace/component/schedulingAnalysis/processAnalysis/TabProcessAnalysis.ts b/ide/src/trace/component/schedulingAnalysis/processAnalysis/TabProcessAnalysis.ts index 5624ce821fb7c086fb07293c4f3ba8e6ddf6a321..4cf79f3364906aaee261fca84ea5903423554703 100644 --- a/ide/src/trace/component/schedulingAnalysis/processAnalysis/TabProcessAnalysis.ts +++ b/ide/src/trace/component/schedulingAnalysis/processAnalysis/TabProcessAnalysis.ts @@ -20,7 +20,7 @@ import './Top10ProcessSwitchCount.ts'; import { Top10LongestRunTimeProcess } from './Top10LongestRunTimeProcess'; import { Top10ProcessSwitchCount } from './Top10ProcessSwitchCount'; -@element("tab-process-analysis") +@element('tab-process-analysis') export class TabProcessAnalysis extends BaseElement { private currentTabID: string | undefined; private currentTab: BaseElement | undefined; diff --git a/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10LongestRunTimeProcess.ts b/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10LongestRunTimeProcess.ts index 38d168739206b1fa4d8267ddaa70657ca62b766c..77da6c9ebea66cacdbac1df123a457d4eabeb4d7 100644 --- a/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10LongestRunTimeProcess.ts +++ b/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10LongestRunTimeProcess.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { BaseElement, element } from "../../../../base-ui/BaseElement"; +import { BaseElement, element } from '../../../../base-ui/BaseElement'; import { LitTable } from '../../../../base-ui/table/lit-table'; import { procedurePool } from '../../../database/Procedure'; import { info } from '../../../../log/Log'; @@ -25,7 +25,7 @@ import { LitChartColumn } from '../../../../base-ui/chart/column/LitChartColumn' import '../../../../base-ui/chart/column/LitChartColumn'; import { Utils } from '../../trace/base/Utils'; -@element("top10-longest-runtime-process") +@element('top10-longest-runtime-process') export class Top10LongestRunTimeProcess extends BaseElement { traceChange: boolean = false; private processRunTimeTbl: LitTable | null | undefined; @@ -48,7 +48,7 @@ export class Top10LongestRunTimeProcess extends BaseElement { /** * 初始化操作,若trace发生改变,将所有变量设置为默认值并重新请求数据。若trace未改变,跳出初始化 */ - init() { + init(): void { if (!this.traceChange) { if (this.processRunTimeTbl!.recycleDataSource.length > 0) { this.processRunTimeTbl?.reMeauseHeight(); @@ -63,16 +63,16 @@ export class Top10LongestRunTimeProcess extends BaseElement { this.processMap = Utils.getInstance().getProcessMap(); this.threadMap = Utils.getInstance().getThreadMap(); this.queryLogicWorker( - "scheduling-Process Top10RunTime", - "query Process Top10 Run Time Analysis Time:", + 'scheduling-Process Top10RunTime', + 'query Process Top10 Run Time Analysis Time:', this.callBack.bind(this) ); } - + /** * 清除已存储数据 */ - clearData() { + clearData(): void { this.traceChange = true; this.processSwitchCountChart!.dataSource = []; this.processRunTimeTbl!.recycleDataSource = []; @@ -93,7 +93,7 @@ export class Top10LongestRunTimeProcess extends BaseElement { */ queryLogicWorker(option: string, log: string, handler: (res: Array) => void, pid?: number): void { let processThreadCountTime = new Date().getTime(); - procedurePool.submitWithName('logic0', option, {pid: pid}, undefined, handler); + procedurePool.submitWithName('logic0', option, { pid: pid }, undefined, handler); let durTime = new Date().getTime() - processThreadCountTime; info(log, durTime); } @@ -111,8 +111,8 @@ export class Top10LongestRunTimeProcess extends BaseElement { const pStr: string | null = this.processMap.get(arr[i].pid!)!; const tStr: string | null = this.threadMap.get(arr[i].tid!)!; result.push({ - NO: i + 1, - pid: arr[i].pid || this.processId, + NO: i + 1, + pid: arr[i].pid || this.processId, pName: pStr === null ? 'Process ' : pStr, dur: arr[i].dur, tid: arr[i].tid, @@ -151,28 +151,28 @@ export class Top10LongestRunTimeProcess extends BaseElement { xField: 'pid', yField: 'dur', seriesField: 'size', - color: (a) => { - return '#0a59f7'; + color: (a): string => { + return '#0a59f7'; }, - hoverHandler: (data) => { + hoverHandler: (data): void => { if (data) { this.processRunTimeTbl!.setCurrentHover(data); } else { this.processRunTimeTbl!.mouseOut(); } }, - tip: (obj) => { + tip: (obj): string => { return `
Process_Id:${ - // @ts-ignore - obj[0].obj.pid}
+ // @ts-ignore + obj[0].obj.pid}
Process_Name:${ - // @ts-ignore - obj[0].obj.pName}
+ // @ts-ignore + obj[0].obj.pName}
Run_Time:${ - // @ts-ignore - obj[0].obj.dur}
+ // @ts-ignore + obj[0].obj.dur} `; }, @@ -184,7 +184,7 @@ export class Top10LongestRunTimeProcess extends BaseElement { * 大函数块拆解分为两部分,此部分为Top10线程数据 * @param result 需要显示在表格中的数据 */ - threadCallback(result: Array):void { + threadCallback(result: Array): void { this.nodataThr!.noData = result === undefined || result.length === 0; this.threadRunTimeTbl!.recycleDataSource = result; this.threadRunTimeTbl!.reMeauseHeight(); @@ -195,31 +195,31 @@ export class Top10LongestRunTimeProcess extends BaseElement { xField: 'tid', yField: 'dur', seriesField: 'size', - color: (a) => { - return '#0a59f7'; + color: (a): string => { + return '#0a59f7'; }, - hoverHandler: (data) => { + hoverHandler: (data): void => { if (data) { this.threadRunTimeTbl!.setCurrentHover(data); } else { this.threadRunTimeTbl!.mouseOut(); } }, - tip: (obj) => { + tip: (obj): string => { return `
Process_Id:${ - // @ts-ignore - obj[0].obj.pid}
+ // @ts-ignore + obj[0].obj.pid}
Thread_Id:${ - // @ts-ignore - obj[0].obj.tid}
+ // @ts-ignore + obj[0].obj.tid}
Thread_Name:${ - // @ts-ignore - obj[0].obj.tName}
+ // @ts-ignore + obj[0].obj.tName}
Run_Time:${ - // @ts-ignore - obj[0].obj.dur}
+ // @ts-ignore + obj[0].obj.dur} `; }, @@ -317,36 +317,47 @@ export class Top10LongestRunTimeProcess extends BaseElement { * @param detail 点击的列名,以及排序状态0 1 2分别代表不排序、升序排序、降序排序 * @param data 表格中需要排序的数据 */ - sortByColumn(detail: any, data: Array): void { + sortByColumn(detail: unknown, data: Array): void { // @ts-ignore function compare(processThreadCountProperty, sort, type) { - return function (a: any, b: any) { + return function (a: unknown, b: unknown) { if (type === 'number') { // @ts-ignore return sort === 2 + // @ts-ignore ? parseFloat(b[processThreadCountProperty]) - - parseFloat(a[processThreadCountProperty]) + // @ts-ignore + parseFloat(a[processThreadCountProperty]) + // @ts-ignore : parseFloat(a[processThreadCountProperty]) - - parseFloat(b[processThreadCountProperty]); + // @ts-ignore + parseFloat(b[processThreadCountProperty]); } else { if (sort === 2) { + // @ts-ignore return b[processThreadCountProperty] .toString() + // @ts-ignore .localeCompare(a[processThreadCountProperty].toString()); } else { + // @ts-ignore return a[processThreadCountProperty] .toString() + // @ts-ignore .localeCompare(b[processThreadCountProperty].toString()); } } }; } - if ( detail.key === 'pName' || detail.key === 'tName') { + // @ts-ignore + if (detail.key === 'pName' || detail.key === 'tName') { data.sort( + // @ts-ignore compare(detail.key, detail.sort, 'string') ); } else { data.sort( + // @ts-ignore compare(detail.key, detail.sort, 'number') ); } @@ -410,7 +421,7 @@ export class Top10LongestRunTimeProcess extends BaseElement { padding-right: 15px; } - ` + `; } /** diff --git a/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10ProcessSwitchCount.ts b/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10ProcessSwitchCount.ts index c2b050d893bdb9f51a49f4c41d14a12519423348..b0f7b34ca06635b81332f3b764288ec21ed0772c 100644 --- a/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10ProcessSwitchCount.ts +++ b/ide/src/trace/component/schedulingAnalysis/processAnalysis/Top10ProcessSwitchCount.ts @@ -93,7 +93,7 @@ export class Top10ProcessSwitchCount extends BaseElement { */ queryLogicWorker(option: string, log: string, handler: (res: Array) => void, pid?: number): void { let processThreadCountTime = new Date().getTime(); - procedurePool.submitWithName('logic0', option, {pid: pid}, undefined, handler); + procedurePool.submitWithName('logic0', option, { pid: pid }, undefined, handler); let durTime = new Date().getTime() - processThreadCountTime; info(log, durTime); } @@ -109,8 +109,8 @@ export class Top10ProcessSwitchCount extends BaseElement { const pStr: string | null = this.processMap.get(arr[i].pid!)!; const tStr: string | null = this.threadMap.get(arr[i].tid!)!; result.push({ - NO: i + 1, - pid: arr[i].pid || this.processId, + NO: i + 1, + pid: arr[i].pid || this.processId, pName: pStr === null ? 'Process ' : pStr, switchCount: arr[i].occurrences, tid: arr[i].tid, @@ -151,25 +151,25 @@ export class Top10ProcessSwitchCount extends BaseElement { label: { type: 'outer', }, - hoverHandler: (data) => { + hoverHandler: (data): void => { if (data) { this.processSwitchCountTbl!.setCurrentHover(data); } else { this.processSwitchCountTbl!.mouseOut(); } }, - tip: (obj) => { + tip: (obj): string => { return `
Process_Id:${ - // @ts-ignore - obj.obj.pid}
+ // @ts-ignore + obj.obj.pid}
Process_Name:${ - // @ts-ignore - obj.obj.pName}
+ // @ts-ignore + obj.obj.pName}
Switch Count:${ - // @ts-ignore - obj.obj.switchCount}
+ // @ts-ignore + obj.obj.switchCount} `; }, @@ -201,28 +201,28 @@ export class Top10ProcessSwitchCount extends BaseElement { label: { type: 'outer', }, - hoverHandler: (data) => { + hoverHandler: (data): void => { if (data) { this.threadSwitchCountTbl!.setCurrentHover(data); } else { this.threadSwitchCountTbl!.mouseOut(); } }, - tip: (obj) => { + tip: (obj): string => { return `
Thread_Id:${ - // @ts-ignore - obj.obj.tid}
+ // @ts-ignore + obj.obj.tid}
Thread_Name:${ - // @ts-ignore - obj.obj.tName}
+ // @ts-ignore + obj.obj.tName}
Switch Count:${ - // @ts-ignore - obj.obj.switchCount}
+ // @ts-ignore + obj.obj.switchCount}
Process_Id:${ - // @ts-ignore - obj.obj.pid}
+ // @ts-ignore + obj.obj.pid} `; }, @@ -338,25 +338,33 @@ export class Top10ProcessSwitchCount extends BaseElement { * @param detail 点击的列名,以及排序状态0 1 2分别代表不排序、升序排序、降序排序 * @param data 表格中需要排序的数据 */ - sortByColumn(detail: {key: string, sort: number}, data: Array): void { + sortByColumn(detail: { key: string, sort: number }, data: Array): void { // @ts-ignore function compare(processThreadCountProperty, sort, type) { - return function (a: any, b: any) { + return function (a: unknown, b: unknown) { if (type === 'number') { // @ts-ignore return sort === 2 + // @ts-ignore ? parseFloat(b[processThreadCountProperty]) - - parseFloat(a[processThreadCountProperty]) + // @ts-ignore + parseFloat(a[processThreadCountProperty]) + // @ts-ignore : parseFloat(a[processThreadCountProperty]) - - parseFloat(b[processThreadCountProperty]); + // @ts-ignore + parseFloat(b[processThreadCountProperty]); } else { if (sort === 2) { + // @ts-ignore return b[processThreadCountProperty] .toString() + // @ts-ignore .localeCompare(a[processThreadCountProperty].toString()); } else { + // @ts-ignore return a[processThreadCountProperty] .toString() + // @ts-ignore .localeCompare(b[processThreadCountProperty].toString()); } } @@ -426,7 +434,7 @@ export class Top10ProcessSwitchCount extends BaseElement { * 节点html代码块 * @returns 返回节点代码块字符串 */ - initTagHtml() :string { + initTagHtml(): string { return `
@@ -487,5 +495,5 @@ interface Top10ProcSwiCount { pName?: string, tName?: string, switchCount?: number, - occurrences?: number + occurrences?: number } \ No newline at end of file diff --git a/ide/src/trace/component/setting/SpArkTs.ts b/ide/src/trace/component/setting/SpArkTs.ts index 72d25056a501f94da3b1280cef9d854508934ea5..12623ca2c973155563eaa8fd665c4425b7202fe3 100644 --- a/ide/src/trace/component/setting/SpArkTs.ts +++ b/ide/src/trace/component/setting/SpArkTs.ts @@ -127,7 +127,7 @@ export class SpArkTs extends BaseElement { } else { Cmd.getDebugProcess().then((processList) => { if (processList.length > 0) { - this.processInput!.dataSource(processList, '',true); + this.processInput!.dataSource(processList, '', true); } else { this.processInput!.dataSource([], ''); } diff --git a/ide/src/trace/component/setting/SpHilogRecord.ts b/ide/src/trace/component/setting/SpHilogRecord.ts index da564a8b60941420a3afcf69d6eed6cc4c49c497..1bcc7a70e2ffeaaed04ef3a5b3b57059a32207bd 100644 --- a/ide/src/trace/component/setting/SpHilogRecord.ts +++ b/ide/src/trace/component/setting/SpHilogRecord.ts @@ -71,7 +71,7 @@ export class SpHilogRecord extends BaseElement { } else { Cmd.getProcess().then((processList) => { if (processList.length > 0) { - this.processSelectEl!.dataSource(processList, 'ALL-Process',true); + this.processSelectEl!.dataSource(processList, 'ALL-Process', true); } else { this.processSelectEl!.dataSource([], ''); } diff --git a/ide/src/trace/component/setting/SpHisysEvent.ts b/ide/src/trace/component/setting/SpHisysEvent.ts index cdeb053038b69ca21b5c10cab949fbaf513abc5b..779567297cb6ed1c237e00214fa2db891cdb30a7 100644 --- a/ide/src/trace/component/setting/SpHisysEvent.ts +++ b/ide/src/trace/component/setting/SpHisysEvent.ts @@ -106,7 +106,7 @@ export class SpHisysEvent extends BaseElement { this.eventConfig = JSON.parse(dec.decode(buffer)); let domainList = Object.keys(this.eventConfig!); if (domainList.length > 0) { - this.domainInputEL!.dataSource(domainList, 'ALL-Domain',true); + this.domainInputEL!.dataSource(domainList, 'ALL-Domain', true); } else { this.domainInputEL!.dataSource([], ''); } @@ -132,7 +132,7 @@ export class SpHisysEvent extends BaseElement { if (eventConfigElement) { let eventNameList = Object.keys(eventConfigElement); if (eventNameList?.length > 0) { - this.eventNameInputEL!.dataSource(eventNameList, 'ALL-Event',true); + this.eventNameInputEL!.dataSource(eventNameList, 'ALL-Event', true); } else { this.eventNameInputEL!.dataSource([], ''); } @@ -147,7 +147,7 @@ export class SpHisysEvent extends BaseElement { let eventList = Object.keys(currentEvent); currentData.push(...eventList); }); - this.eventNameInputEL!.dataSource(currentData, 'ALL-Event',true); + this.eventNameInputEL!.dataSource(currentData, 'ALL-Event', true); } else { this.eventNameInputEL!.dataSource([], ''); } diff --git a/ide/src/trace/component/setting/SpSdkConfig.ts b/ide/src/trace/component/setting/SpSdkConfig.ts index fe2ed6c08b0333230ead95152217ba27393dc266..a8426c1a3e1de4ece2cb47b6fc7050a7daa552d3 100644 --- a/ide/src/trace/component/setting/SpSdkConfig.ts +++ b/ide/src/trace/component/setting/SpSdkConfig.ts @@ -170,7 +170,7 @@ export class SpSdkConfig extends BaseElement { }); } }) - .catch(() => {}); + .catch(() => { }); if (this.worker === null) { // @ts-ignore if (window.useWb) { @@ -178,7 +178,7 @@ export class SpSdkConfig extends BaseElement { } this.worker = new Worker(new URL('../../database/ConfigWorker', import.meta.url)); } - } catch (e) {} + } catch (e) { } } initElements(): void { @@ -200,7 +200,7 @@ export class SpSdkConfig extends BaseElement { inputDiv.addEventListener('mousedown', () => { if (this.startSamp) { inputDiv!.removeAttribute('readonly'); - this.selectConfig!.dataSource(this.wasmList, '',true); + this.selectConfig!.dataSource(this.wasmList, '', true); } else { inputDiv!.setAttribute('readonly', 'readonly'); return; diff --git a/ide/src/trace/component/setting/SpVmTracker.ts b/ide/src/trace/component/setting/SpVmTracker.ts index fbe3b440e139f8d6eebe1c60eb38db6c5c5739b4..c8d53df7a6bf33e9c6a190e55ffe5575db6a36f5 100644 --- a/ide/src/trace/component/setting/SpVmTracker.ts +++ b/ide/src/trace/component/setting/SpVmTracker.ts @@ -80,7 +80,7 @@ export class SpVmTracker extends BaseElement { } else { Cmd.getProcess().then((processList) => { if (processList.length > 0) { - this.vmTrackerProcessInput!.dataSource(processList, '',true); + this.vmTrackerProcessInput!.dataSource(processList, '', true); } else { this.vmTrackerProcessInput!.dataSource([], ''); }