Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev UI - First version of build steps and build items pages #32270

Merged
merged 8 commits into from
Apr 4, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,13 @@ void createBuildTimeData(BuildProducer<BuildTimeConstBuildItem> buildTimeConstPr
internalBuildTimeData.addBuildTimeData("devServices", devServiceDescriptions);

Page buildSteps = Page.webComponentPageBuilder().internal()
.namespace("devui-build-information")
.namespace("devui-build-metrics")
.title("Build Steps")
phillip-kruger marked this conversation as resolved.
Show resolved Hide resolved
.icon("font-awesome-solid:hammer")
.componentLink("qwc-build-steps.js").build();

Page buildItems = Page.webComponentPageBuilder().internal()
.namespace("devui-build-information")
.namespace("devui-build-metrics")
.title("Build Items")
.icon("font-awesome-solid:trowel")
.componentLink("qwc-build-items.js").build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ AdditionalBeanBuildItem additionalBeans() {

@BuildStep
JsonRPCProvidersBuildItem createJsonRPCService() {
return new JsonRPCProvidersBuildItem("build-metrics", BuildMetricsJsonRPCService.class);
return new JsonRPCProvidersBuildItem("devui-build-metrics", BuildMetricsJsonRPCService.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class JsonRpc {

_setExtensionName(discoveredNamespace, serviceIdentifier){
if(serviceIdentifier){
this._extensionName = serviceIdentifier;
this._extensionName = discoveredNamespace + "-" + serviceIdentifier;
}else {
this._extensionName = discoveredNamespace;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import '@vaadin/horizontal-layout';
*/
export class QwcBuildItems extends LitElement {

jsonRpc = new JsonRpc(this, true, 'build-metrics');
jsonRpc = new JsonRpc("devui-build-metrics", true);

static styles = css`
.build-items {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
Expand All @@ -36,6 +37,10 @@ export class QwcBuildItems extends LitElement {

.summary {
margin-bottom: 15px;
}

.datatable {
width: 100%;
}`;

static properties = {
Expand All @@ -52,7 +57,11 @@ export class QwcBuildItems extends LitElement {
}

render() {
return html`${until(this._render(), html`<span>Loading build items...</span>`)}`;
if (this._buildStepsMetrics && this._filtered) {
return this._render();
}else {
return html`<span>Loading build items...</span>`;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phillip-kruger quick question: so the render method is called repeatedly by default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Render gets called on startup and when any state: true property change

}

_match(value, term) {
Expand All @@ -75,17 +84,16 @@ export class QwcBuildItems extends LitElement {
}

_render() {
if (this._buildStepsMetrics && this._filtered) {
return html`<div class="build-items">
return html`<div class="build-items">
<div class="summary">Produced <strong>${this._buildStepsMetrics.itemsCount}</strong> build items.</div>
<vaadin-text-field
placeholder="Filter"
style="width: 100%;"
@value-changed="${(e) => this._filter(e)}">
<vaadin-icon slot="prefix" icon="font-awesome-solid:filter"></vaadin-icon>
</vaadin-text-field>
<vaadin-grid .items="${this._filtered}" style="width: 100%;" class="datatable" theme="row-stripes">
<vaadin-grid-sort-column auto-width resizable flex-grow="0"
<vaadin-grid .items="${this._filtered}" class="datatable" theme="row-stripes">
<vaadin-grid-sort-column resizable
header="Build item"
path="class"
class="cell"
Expand All @@ -99,7 +107,6 @@ export class QwcBuildItems extends LitElement {
${columnBodyRenderer(this._countRenderer, [])}>
</vaadin-grid-sort-column>
</vaadin-grid></div>`;
}
}

_classRenderer(item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import '@vaadin/horizontal-layout';
*/
export class QwcBuildSteps extends LitElement {

jsonRpc = new JsonRpc(this, true, 'build-metrics');
jsonRpc = new JsonRpc("devui-build-metrics", true);

static styles = css`
.build-steps {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
Expand All @@ -36,6 +37,10 @@ export class QwcBuildSteps extends LitElement {

.summary {
margin-bottom: 15px;
}

.datatable {
width: 100%;
}`;

static properties = {
Expand All @@ -52,7 +57,11 @@ export class QwcBuildSteps extends LitElement {
}

render() {
return html`${until(this._render(), html`<span>Loading build steps...</span>`)}`;
if (this._buildStepsMetrics && this._filtered) {
return this._render();
}else {
return html`<span>Loading build steps...</span>`;
}
}

_match(value, term) {
Expand All @@ -75,7 +84,6 @@ export class QwcBuildSteps extends LitElement {
}

_render() {
if (this._buildStepsMetrics && this._filtered) {
return html`<div class="build-steps">
<div class="summary">Executed <strong>${this._buildStepsMetrics.records.length}</strong> build steps on <strong>${Object.keys(this._buildStepsMetrics.threadSlotRecords).length}</strong> threads in <strong>${this._buildStepsMetrics.duration} ms</strong>.</div>
<vaadin-text-field
Expand All @@ -84,8 +92,8 @@ export class QwcBuildSteps extends LitElement {
@value-changed="${(e) => this._filter(e)}">
<vaadin-icon slot="prefix" icon="font-awesome-solid:filter"></vaadin-icon>
</vaadin-text-field>
<vaadin-grid .items="${this._filtered}" style="width: 100%;" class="datatable" theme="row-stripes">
<vaadin-grid-sort-column auto-width resizable flex-grow="0"
<vaadin-grid .items="${this._filtered}" class="datatable" theme="row-stripes">
<vaadin-grid-sort-column resizable
header="Build step"
path="stepId"
class="cell"
Expand Down Expand Up @@ -113,7 +121,6 @@ export class QwcBuildSteps extends LitElement {
${columnBodyRenderer(this._threadRenderer, [])}>
</vaadin-grid-column>
</vaadin-grid></div>`;
}
}

_stepIdRenderer(record) {
Expand Down