generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Phillip Kruger <[email protected]>
- Loading branch information
1 parent
31fc316
commit 9862b62
Showing
5 changed files
with
182 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
:quarkus-version: 3.1.0.Final | ||
:quarkus-version: 3.1.2.Final | ||
:quarkus-minio-version: 3.1.0.Final |
38 changes: 38 additions & 0 deletions
38
...src/main/java/io/quarkiverse/minio/client/deployment/devui/MinioClientDevUIProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.quarkiverse.minio.client.deployment.devui; | ||
|
||
import io.quarkiverse.minio.client.MiniosBuildTimeConfiguration; | ||
import io.quarkiverse.minio.client.deployment.devservices.MinioBuildTimeConfig; | ||
import io.quarkiverse.minio.client.devui.MinioJsonRPCService; | ||
import io.quarkus.deployment.IsDevelopment; | ||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.devui.spi.JsonRPCProvidersBuildItem; | ||
import io.quarkus.devui.spi.page.CardPageBuildItem; | ||
import io.quarkus.devui.spi.page.Page; | ||
|
||
public class MinioClientDevUIProcessor { | ||
|
||
@BuildStep(onlyIf = IsDevelopment.class) | ||
void createCard(BuildProducer<CardPageBuildItem> cardProducer, MinioBuildTimeConfig devServiceConfig, | ||
MiniosBuildTimeConfiguration configuration) { | ||
|
||
final CardPageBuildItem card = new CardPageBuildItem(); | ||
|
||
card.addBuildTimeData("enabled", devServiceConfig.devservices.enabled.orElse(true)); | ||
|
||
card.addPage(Page.externalPageBuilder("Min.io console") | ||
.icon("font-awesome-solid:signs-post") | ||
.dynamicUrlJsonRPCMethodName("getMinioConsoleUrl") | ||
.doNotEmbed()); | ||
|
||
card.setCustomCard("qwc-minio-card.js"); | ||
|
||
cardProducer.produce(card); | ||
} | ||
|
||
@BuildStep(onlyIf = IsDevelopment.class) | ||
JsonRPCProvidersBuildItem createJsonRPCServiceForCache() { | ||
return new JsonRPCProvidersBuildItem(MinioJsonRPCService.class); | ||
} | ||
|
||
} |
105 changes: 105 additions & 0 deletions
105
minio-client/deployment/src/main/resources/dev-ui/qwc-minio-card.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { LitElement, html, css} from 'lit'; | ||
import { pages } from 'build-time-data'; | ||
import { enabled } from 'build-time-data'; | ||
import 'qwc/qwc-extension-link.js'; | ||
import { JsonRpc } from 'jsonrpc' | ||
import 'qui-badge'; | ||
|
||
export class QwcMinioCard extends LitElement { | ||
jsonRpc = new JsonRpc(this); | ||
|
||
static styles = css` | ||
.identity { | ||
display: flex; | ||
justify-content: flex-start; | ||
} | ||
.loginDetails { | ||
padding-top: 10px; | ||
color: var(--lumo-contrast-70pct); | ||
font-size: smaller; | ||
text-align: center; | ||
} | ||
.description { | ||
padding-bottom: 10px; | ||
} | ||
.card-content { | ||
color: var(--lumo-contrast-90pct); | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
padding: 10px 10px; | ||
height: 100%; | ||
} | ||
.card-content slot { | ||
display: flex; | ||
flex-flow: column wrap; | ||
padding-top: 5px; | ||
} | ||
`; | ||
|
||
static properties = { | ||
extensionName: {type: String}, | ||
description: {type: String}, | ||
guide: {type: String}, | ||
namespace: {type: String}, | ||
_loginDetails: {type: String} | ||
} | ||
|
||
constructor() { | ||
super(); | ||
} | ||
|
||
connectedCallback() { | ||
super.connectedCallback(); | ||
this.jsonRpc.getLoginDetails().then(jsonRpcResponse => { | ||
this._loginDetails = jsonRpcResponse.result; | ||
}); | ||
} | ||
|
||
render() { | ||
return html`<div class="card-content" slot="content"> | ||
<div class="identity"> | ||
<div class="description">${this.description}</div> | ||
</div> | ||
${this._renderCardLinks()} | ||
${this._renderLoginDetails()} | ||
</div> | ||
`; | ||
} | ||
|
||
_renderCardLinks(){ | ||
if(enabled){ | ||
|
||
return html`${pages.map(page => html` | ||
<qwc-extension-link slot="link" | ||
namespace="${this.namespace}" | ||
extensionName="${this.name}" | ||
iconName="${page.icon}" | ||
displayName="${page.title}" | ||
staticLabel="${page.staticLabel}" | ||
dynamicLabel="${page.dynamicLabel}" | ||
streamingLabel="${page.streamingLabel}" | ||
path="${page.id}" | ||
?embed=${page.embed} | ||
externalUrl="${page.metadata.externalUrl}" | ||
dynamicUrlMethodName="${page.metadata.dynamicUrlMethodName}" | ||
webcomponent="${page.componentLink}" > | ||
</qwc-extension-link> | ||
`)}`; | ||
} else { | ||
return html`<span>Disabled</span>`; | ||
} | ||
|
||
} | ||
|
||
_renderLoginDetails(){ | ||
if(this._loginDetails){ | ||
return html`<div class="loginDetails"> | ||
<span>Access Key: <qui-badge><span>${this._loginDetails.accesskey}</span></qui-badge></span><br/> | ||
<span>Secret Key: <qui-badge><span>${this._loginDetails.secretkey}</span></qui-badge></span> | ||
</div>`; | ||
} | ||
} | ||
|
||
} | ||
customElements.define('qwc-minio-card', QwcMinioCard); |
24 changes: 24 additions & 0 deletions
24
...o-client/runtime/src/main/java/io/quarkiverse/minio/client/devui/MinioJsonRPCService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.quarkiverse.minio.client.devui; | ||
|
||
import org.eclipse.microprofile.config.Config; | ||
import org.eclipse.microprofile.config.ConfigProvider; | ||
|
||
import io.smallrye.common.annotation.NonBlocking; | ||
import io.vertx.core.json.JsonObject; | ||
|
||
public class MinioJsonRPCService { | ||
|
||
Config config = ConfigProvider.getConfig(); | ||
|
||
@NonBlocking | ||
public String getMinioConsoleUrl() { | ||
return config.getOptionalValue("quarkus.minio.console", String.class).orElse(null); | ||
} | ||
|
||
@NonBlocking | ||
public JsonObject getLoginDetails() { | ||
return JsonObject.of( | ||
"accesskey", config.getOptionalValue("quarkus.minio.access-key", String.class).orElse(null), | ||
"secretkey", config.getOptionalValue("quarkus.minio.secret-key", String.class).orElse(null)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<actions> | ||
<action> | ||
<actionName>CUSTOM-skipTests</actionName> | ||
<displayName>skipTests</displayName> | ||
<goals> | ||
<goal>clean</goal> | ||
<goal>install</goal> | ||
</goals> | ||
<properties> | ||
<skipTests>true</skipTests> | ||
</properties> | ||
</action> | ||
</actions> |