dev-ui.qwc-logging-manager-loggers.js Maven / Gradle / Ivy
import '@vaadin/grid';
import '@vaadin/grid/vaadin-grid-sort-column.js';
import '@vaadin/vertical-layout';
import '@vaadin/icon';
import '@vaadin/icons';
import { LitElement, html, css} from 'lit';
import { JsonRpc } from 'jsonrpc';
export class QwcLoggingManagerLoggers extends LitElement {
jsonRpc = new JsonRpc(this);
static styles = css`
.logger-table {
height: 650px;
}
.ml-10 {
margin-left: 10px;
}
`
static properties = {
_loggers: { state: true },
_filteredLoggers: { state: true }
}
constructor() {
super();
}
connectedCallback() {
super.connectedCallback();
this._refreshLoggers();
}
disconnectedCallback() {
super.disconnectedCallback();
}
_refreshLoggers() {
this.jsonRpc.getLoggers().then(jsonRpcResponse => {
this._resetLoggers(jsonRpcResponse.result);
});
}
_resetLoggers(result) {
this._loggers = result;
this._filteredLoggers = result;
}
render() {
return html`
{
const searchTerm = (e.detail.value || '').trim();
const matchesTerm = (value) =>
value.toLowerCase().includes(searchTerm.toLowerCase());
if (this._loggers) {
this._filteredLoggers = this._loggers.filter(
({ name }) =>
!searchTerm ||
matchesTerm(name)
);
}
}}"
>
`
}
}
customElements.define('qwc-logging-manager-loggers', QwcLoggingManagerLoggers);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy