forked from certinia/debug-log-analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabaseSection.ts
More file actions
50 lines (45 loc) · 1.21 KB
/
DatabaseSection.ts
File metadata and controls
50 lines (45 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (c) 2021 Certinia Inc. All rights reserved.
*/
import { LitElement, css, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { Method } from '../../parsers/ApexLogParser.js';
import { globalStyles } from '../../styles/global.styles.js';
import '../BadgeBase.js';
@customElement('database-section')
export class DatabaseSection extends LitElement {
@property({ type: String })
title = '';
@property({ type: Object, attribute: false })
dbLines: Method[] = [];
static styles = [
globalStyles,
css`
.dbSection {
padding: 10px 5px 5px 0px;
}
.dbTitle {
font-weight: bold;
font-size: 1.2em;
}
.dbBlock {
margin-left: 10px;
font-weight: normal;
}
`,
];
render() {
const totalCount = this.dbLines.length;
let totalRows = 0;
this.dbLines.forEach((value) => {
totalRows += value.dmlRowCount.self || value.soqlRowCount.self || 0;
});
return html`
<div class="dbSection">
<span class="dbTitle">${this.title}</span>
<badge-base>Count: ${totalCount}</badge-base>
<badge-base>Rows: ${totalRows}</badge-base>
</div>
`;
}
}