dev-ui.qwc-automatiko-functions.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of automatiko-function-deployment Show documentation
Show all versions of automatiko-function-deployment Show documentation
Function Deployment module for Quarkus Extension for Automatiko Engine
import { LitElement, html, css} from 'lit';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
import { functions } from 'build-time-data';
import '@vaadin/grid';
import '@vaadin/vertical-layout';
import 'qui-badge';
export class QwcAutomatikoFunctions extends LitElement {
static styles = css`
.arctable {
height: 100%;
padding-bottom: 10px;
}
code {
font-size: 85%;
}
.annotation {
color: var(--lumo-contrast-50pct);
}
.producer {
color: var(--lumo-primary-text-color);
}
`;
static properties = {
_functions: {state: true},
};
constructor() {
super();
this._functions = functions;
}
textToClipboard (text) {
var dummy = document.createElement("textarea");
document.body.appendChild(dummy);
dummy.value = text;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
}
render() {
if (this._functions) {
return html`
`;
} else {
return html`No functions found`;
}
}
_nameRenderer(func) {
return html`
${func.name}
`;
}
_endpointRenderer(func) {
return html`
${func.endpoint}
`;
}
_getRenderer(func) {
return html`
${func.getInstructions}
`;
}
_getCopyRenderer(func) {
return html`
this.textToClipboard(func.curlGet)} class="button">
`;
}
_postRenderer(func) {
return html`
${func.postInstructions}
`;
}
_postCopyRenderer(func) {
return html`
this.textToClipboard(func.curlPost)} class="button">
`;
}
}
customElements.define('qwc-automatiko-functions', QwcAutomatikoFunctions);