diff --git a/src/app/components/ch-help/ch-help.component.html b/src/app/components/ch-help/ch-help.component.html index 6389078..53e0f7d 100644 --- a/src/app/components/ch-help/ch-help.component.html +++ b/src/app/components/ch-help/ch-help.component.html @@ -1,4 +1,5 @@
close
+
diff --git a/src/app/components/ch-help/ch-help.component.scss b/src/app/components/ch-help/ch-help.component.scss index e374688..169e81a 100644 --- a/src/app/components/ch-help/ch-help.component.scss +++ b/src/app/components/ch-help/ch-help.component.scss @@ -1,12 +1,13 @@ :host { + position: relative; background-color: #fafafa; max-height: calc(100% - 1rem); overflow: hidden; - flex: 1; + // flex: 1; } .frame { border: 0; width: calc(100% - 1rem); - height: 100%; + height: calc(100vh - 13.3rem); margin: 0 0 0 1rem; } diff --git a/src/app/pages/home.page/home.page.component.html b/src/app/pages/home.page/home.page.component.html index 19406d6..fe1a2ec 100644 --- a/src/app/pages/home.page/home.page.component.html +++ b/src/app/pages/home.page/home.page.component.html @@ -36,10 +36,17 @@ [ngClass]="{ dark: isDarkMode }" style="width: 100%; height: calc(100vh - 4rem)" > - - + + - + DB Tree @@ -83,13 +90,26 @@ {{ item }} - + + + + Docs + + + + @@ -131,13 +151,12 @@

No Data

Elapsed: - {{ - dataForFile?.statistics?.elapsed - | number - }} - sec + {{ + timeShorter( + dataForFile?.statistics?.elapsed || + 0 + ) + }}
Rows: @@ -147,12 +166,14 @@

No Data

Size: - {{ - dataForFile?.statistics?.bytes_read + + {{ + bytesToSize( + dataForFile?.statistics + ?.bytes_read || 0 + ) }} - B. +
No Data
- - + --> diff --git a/src/app/pages/home.page/home.page.component.scss b/src/app/pages/home.page/home.page.component.scss index 71bbf1a..8e1e21a 100644 --- a/src/app/pages/home.page/home.page.component.scss +++ b/src/app/pages/home.page/home.page.component.scss @@ -71,6 +71,11 @@ h1 { :host ::ng-deep .mat-expansion-panel-body { padding: 0; } +mat-expansion-panel { + mat-expansion-panel-header { + height: auto !important; + } +} .example-table-container { position: relative; height: 100%; diff --git a/src/app/pages/home.page/home.page.component.ts b/src/app/pages/home.page/home.page.component.ts index f850fe2..4817e66 100644 --- a/src/app/pages/home.page/home.page.component.ts +++ b/src/app/pages/home.page/home.page.component.ts @@ -69,7 +69,7 @@ export class HomePageComponent implements OnInit { console.log(this.currentRow.size) this.docsService.listen().subscribe(doc_link => { this.isDocsShows = !!doc_link; - this.isLeftPanel = !doc_link; + // this.isLeftPanel = !doc_link; }) } getDynamicDictionary() { @@ -83,7 +83,7 @@ export class HomePageComponent implements OnInit { const bool = query.includes('system.functions'); const r: Dictionary[] = data?.map((value: any) => ({ name: value[0] + '()', - icon: bool ? 1: 2, + icon: bool ? 1 : 2, type: bool ? 'function' : 'format' })); @@ -331,6 +331,37 @@ export class HomePageComponent implements OnInit { } }) } + bytesToSize(bytes: any): string { + const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; + if (bytes === 0) { + return 'n/a'; + } + const i = Math.floor(+Math.log(bytes) / +Math.log(1024)) + if (i === 0) { + return `${bytes} ${sizes[i]}`; + } + return `${(bytes / (1024 ** i)).toFixed(1)} ${sizes[i]}` + } + timeShorter(sec: number): string { + const ms = Math.round((sec) * 1000); + const _ = (n: number) => (n + '').length === 1 ? '0' + n : n; + const o = { + 'hours': _(Math.floor(ms / (1000 * 60 * 60))), + 'min': _(Math.floor(ms / (1000 * 60) % 60)), + 'sec': _(Math.floor((ms / 1000) % 60)), + 'ms': ((ms % 1000) / 1000) ? ((ms % 1000) / 1000).toString().replace('0.', '') : '000' + }; + if (ms < 1000) { // ms + return `${ms} ms`; + } else if (ms < 1000 * 60) { // sec + return `${o.sec}.${o.ms} sec`; + } else if (ms < 1000 * 60 * 60) { // min + return `${o.min}:${o.sec}.${o.ms} min`; + } else { // hours + return `${o.hours}:${o.min}:${o.sec}.${o.ms} hour(s)`; + } + + } } export function promiseWait(sec = 1000): Promise {