dev-ui.qwc-rest-client-clients.js Maven / Gradle / Ivy
import { LitElement, html, css} from 'lit';
import { JsonRpc } from 'jsonrpc';
import '@vaadin/icon';
import '@vaadin/progress-bar';
import '@vaadin/checkbox';
import '@vaadin/grid';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
import '@vaadin/grid/vaadin-grid-sort-column.js';
export class QwcRestClientClients extends LitElement {
jsonRpc = new JsonRpc(this);
// Component style
static styles = css`
:host {
display: block;
height: 100%;
}
.datatable {
height: 100%;
}
code {
font-size: 85%;
}`;
// Component properties
static properties = {
_clients: {state: true}
}
constructor() {
super();
this._clients = null;
}
// Components callbacks
/**
* Called when displayed
*/
connectedCallback() {
super.connectedCallback();
this.jsonRpc.getAll().then(jsonRpcResponse => {
this._clients = jsonRpcResponse.result;
});
}
/**
* Called when it needs to render the components
* @returns {*}
*/
render() {
if (this._clients) {
return this._renderClientsTable();
} else {
return html`Loading REST Clients...`;
}
}
// View / Templates
_renderClientsTable() {
return html`
`;
}
_clientInterfaceRenderer(client){
return html`
${client.clientInterface}
`;
}
_configKeyRenderer(client){
return html`
${client.configKey}
`;
}
_isBeanRenderer(client){
if(client.isBean !== false){
return html`
`;
}
}
}
customElements.define('qwc-rest-client-clients', QwcRestClientClients);