field : fieldValues.entrySet()) {
+ BytecodeCreator existFieldValue = creator.ifNotNull(field.getValue()).trueBranch();
+ existFieldValue.invokeVirtualMethod(
+ ofMethod(UriBuilder.class, "queryParam", UriBuilder.class, String.class, Object[].class),
+ uriBuilder, existFieldValue.load(field.getKey()),
+ existFieldValue.marshalAsArray(Object.class, field.getValue()));
+ }
+
return creator.invokeVirtualMethod(
ofMethod(UriBuilder.class, "build", URI.class, Object[].class), uriBuilder, creator.newArray(Object.class, 0));
}
diff --git a/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/utils/QueryImplementor.java b/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/utils/QueryImplementor.java
new file mode 100644
index 0000000000000..28ad2fb05fa0a
--- /dev/null
+++ b/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/utils/QueryImplementor.java
@@ -0,0 +1,78 @@
+package io.quarkus.rest.data.panache.deployment.utils;
+
+import static io.quarkus.gizmo.MethodDescriptor.ofConstructor;
+import static io.quarkus.gizmo.MethodDescriptor.ofMethod;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import io.quarkus.gizmo.AssignableResultHandle;
+import io.quarkus.gizmo.BranchResult;
+import io.quarkus.gizmo.BytecodeCreator;
+import io.quarkus.gizmo.ResultHandle;
+
+public final class QueryImplementor {
+ /**
+ * Returns the name of the query or if it is not defined, then it will return a query built by the search parameters.
+ *
+ *
+ * {@code
+ * String query;
+ * if (namedQuery != null) {
+ * query = "#" + namedQuery;
+ * } else {
+ * query = String.join(" AND ", queryList);
+ * }
+ * }
+ *
+ *
+ * @param creator a bytecode creator to be used for code generation.
+ * @param namedQuery HQL query to list entities.
+ * @param fieldValues fields query params.
+ * @return query.
+ */
+ public AssignableResultHandle getQuery(BytecodeCreator creator, ResultHandle namedQuery,
+ Map fieldValues) {
+ ResultHandle queryList = creator.newInstance(ofConstructor(ArrayList.class));
+
+ for (Map.Entry field : fieldValues.entrySet()) {
+ String fieldName = field.getKey();
+ String paramName = fieldName.replace(".", "__");
+ ResultHandle fieldValueFromQuery = field.getValue();
+ BytecodeCreator fieldValueFromQueryIsSet = creator.ifNotNull(fieldValueFromQuery).trueBranch();
+ fieldValueFromQueryIsSet.invokeInterfaceMethod(ofMethod(List.class, "add", boolean.class, Object.class),
+ queryList, fieldValueFromQueryIsSet.load(fieldName + "=:" + paramName));
+ }
+
+ AssignableResultHandle query = creator.createVariable(String.class);
+ BranchResult checkIfNamedQueryIsNull = creator.ifNull(namedQuery);
+ BytecodeCreator whenNamedQueryIsNull = checkIfNamedQueryIsNull.trueBranch();
+ BytecodeCreator whenNamedQueryIsNotNull = checkIfNamedQueryIsNull.falseBranch();
+ whenNamedQueryIsNotNull.assign(query, whenNamedQueryIsNotNull.invokeVirtualMethod(
+ ofMethod(String.class, "concat", String.class, String.class),
+ whenNamedQueryIsNotNull.load("#"), namedQuery));
+ whenNamedQueryIsNull.assign(query, whenNamedQueryIsNull.invokeStaticMethod(
+ ofMethod(String.class, "join", String.class, CharSequence.class, Iterable.class),
+ creator.load(" AND "), queryList));
+
+ return query;
+ }
+
+ public ResultHandle getDataParams(BytecodeCreator creator, Map fieldValues) {
+ ResultHandle dataParams = creator.newInstance(ofConstructor(HashMap.class));
+
+ for (Map.Entry field : fieldValues.entrySet()) {
+ String fieldName = field.getKey();
+ String paramName = fieldName.replace(".", "__");
+ ResultHandle fieldValueFromQuery = field.getValue();
+ BytecodeCreator fieldValueFromQueryIsSet = creator.ifNotNull(fieldValueFromQuery).trueBranch();
+ fieldValueFromQueryIsSet.invokeInterfaceMethod(
+ ofMethod(Map.class, "put", Object.class, Object.class, Object.class),
+ dataParams, fieldValueFromQueryIsSet.load(paramName), fieldValueFromQuery);
+ }
+
+ return dataParams;
+ }
+}
diff --git a/extensions/reactive-datasource/runtime/src/main/java/io/quarkus/reactive/datasource/runtime/ReactiveDatasourceHealthCheck.java b/extensions/reactive-datasource/runtime/src/main/java/io/quarkus/reactive/datasource/runtime/ReactiveDatasourceHealthCheck.java
index b0d804266c96b..840dec97bd7e7 100644
--- a/extensions/reactive-datasource/runtime/src/main/java/io/quarkus/reactive/datasource/runtime/ReactiveDatasourceHealthCheck.java
+++ b/extensions/reactive-datasource/runtime/src/main/java/io/quarkus/reactive/datasource/runtime/ReactiveDatasourceHealthCheck.java
@@ -76,7 +76,6 @@ public HealthCheckResponse call() {
//20 seconds is rather high, but using just 10 is often not enough on slow CI
//systems, especially if the connections have to be established for the first time.
databaseConnectionAttempt.get(20, TimeUnit.SECONDS);
- builder.withData(dataSourceName, "UP");
} catch (RuntimeException | ExecutionException exception) {
operationsError(dataSourceName, exception);
builder.down();
@@ -105,6 +104,8 @@ private void checkFailure(AsyncResult> ar, HealthCheckResponseBuilde
operationsError(dataSourceName, ar.cause());
builder.down();
builder.withData(dataSourceName, "down - connection failed: " + ar.cause().getMessage());
+ } else {
+ builder.withData(dataSourceName, "UP");
}
}
diff --git a/extensions/reactive-mssql-client/deployment/src/test/java/io/quarkus/reactive/mssql/client/DataSourceHealthCheckPayloadTest.java b/extensions/reactive-mssql-client/deployment/src/test/java/io/quarkus/reactive/mssql/client/DataSourceHealthCheckPayloadTest.java
new file mode 100644
index 0000000000000..11f13aafbb78b
--- /dev/null
+++ b/extensions/reactive-mssql-client/deployment/src/test/java/io/quarkus/reactive/mssql/client/DataSourceHealthCheckPayloadTest.java
@@ -0,0 +1,28 @@
+package io.quarkus.reactive.mssql.client;
+
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.Matchers;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import io.quarkus.test.QuarkusUnitTest;
+import io.restassured.RestAssured;
+
+public class DataSourceHealthCheckPayloadTest {
+
+ @RegisterExtension
+ static final QuarkusUnitTest config = new QuarkusUnitTest()
+ .withEmptyApplication()
+ .overrideConfigKey("quarkus.datasource.health.enabled", "true")
+ .overrideConfigKey("quarkus.devservices.enabled", "false");
+
+ @Test
+ public void testDataSourceHealthCheckPayload() {
+ RestAssured.when().get("/q/health/ready")
+ .then()
+ .body("status", CoreMatchers.equalTo("DOWN"))
+ .body("checks.data", CoreMatchers
+ .hasItem(Matchers.hasValue(CoreMatchers.containsString("down - connection failed"))));
+ }
+
+}
diff --git a/extensions/reactive-mysql-client/deployment/src/test/java/io/quarkus/reactive/mysql/client/DataSourceHealthCheckPayloadTest.java b/extensions/reactive-mysql-client/deployment/src/test/java/io/quarkus/reactive/mysql/client/DataSourceHealthCheckPayloadTest.java
new file mode 100644
index 0000000000000..c219c54b0afbd
--- /dev/null
+++ b/extensions/reactive-mysql-client/deployment/src/test/java/io/quarkus/reactive/mysql/client/DataSourceHealthCheckPayloadTest.java
@@ -0,0 +1,28 @@
+package io.quarkus.reactive.mysql.client;
+
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.Matchers;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import io.quarkus.test.QuarkusUnitTest;
+import io.restassured.RestAssured;
+
+public class DataSourceHealthCheckPayloadTest {
+
+ @RegisterExtension
+ static final QuarkusUnitTest config = new QuarkusUnitTest()
+ .withEmptyApplication()
+ .overrideConfigKey("quarkus.datasource.health.enabled", "true")
+ .overrideConfigKey("quarkus.devservices.enabled", "false");
+
+ @Test
+ public void testDataSourceHealthCheckPayload() {
+ RestAssured.when().get("/q/health/ready")
+ .then()
+ .body("status", CoreMatchers.equalTo("DOWN"))
+ .body("checks.data", CoreMatchers
+ .hasItem(Matchers.hasValue(CoreMatchers.containsString("down - connection failed"))));
+ }
+
+}
diff --git a/extensions/reactive-oracle-client/deployment/src/test/java/io/quarkus/reactive/oracle/client/DataSourceHealthCheckPayloadTest.java b/extensions/reactive-oracle-client/deployment/src/test/java/io/quarkus/reactive/oracle/client/DataSourceHealthCheckPayloadTest.java
new file mode 100644
index 0000000000000..22daf2732285b
--- /dev/null
+++ b/extensions/reactive-oracle-client/deployment/src/test/java/io/quarkus/reactive/oracle/client/DataSourceHealthCheckPayloadTest.java
@@ -0,0 +1,28 @@
+package io.quarkus.reactive.oracle.client;
+
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.Matchers;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import io.quarkus.test.QuarkusUnitTest;
+import io.restassured.RestAssured;
+
+public class DataSourceHealthCheckPayloadTest {
+
+ @RegisterExtension
+ static final QuarkusUnitTest config = new QuarkusUnitTest()
+ .withEmptyApplication()
+ .overrideConfigKey("quarkus.datasource.health.enabled", "true")
+ .overrideConfigKey("quarkus.devservices.enabled", "false");
+
+ @Test
+ public void testDataSourceHealthCheckPayload() {
+ RestAssured.when().get("/q/health/ready")
+ .then()
+ .body("status", CoreMatchers.equalTo("DOWN"))
+ .body("checks.data", CoreMatchers
+ .hasItem(Matchers.hasValue(CoreMatchers.containsString("down - connection failed"))));
+ }
+
+}
diff --git a/extensions/reactive-pg-client/deployment/src/test/java/io/quarkus/reactive/pg/client/DataSourceHealthCheckPayloadTest.java b/extensions/reactive-pg-client/deployment/src/test/java/io/quarkus/reactive/pg/client/DataSourceHealthCheckPayloadTest.java
new file mode 100644
index 0000000000000..77e65102d0634
--- /dev/null
+++ b/extensions/reactive-pg-client/deployment/src/test/java/io/quarkus/reactive/pg/client/DataSourceHealthCheckPayloadTest.java
@@ -0,0 +1,28 @@
+package io.quarkus.reactive.pg.client;
+
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.Matchers;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import io.quarkus.test.QuarkusUnitTest;
+import io.restassured.RestAssured;
+
+public class DataSourceHealthCheckPayloadTest {
+
+ @RegisterExtension
+ static final QuarkusUnitTest config = new QuarkusUnitTest()
+ .withEmptyApplication()
+ .overrideConfigKey("quarkus.datasource.health.enabled", "true")
+ .overrideConfigKey("quarkus.devservices.enabled", "false");
+
+ @Test
+ public void testDataSourceHealthCheckPayload() {
+ RestAssured.when().get("/q/health/ready")
+ .then()
+ .body("status", CoreMatchers.equalTo("DOWN"))
+ .body("checks.data", CoreMatchers
+ .hasItem(Matchers.hasValue(CoreMatchers.containsString("down - connection failed"))));
+ }
+
+}
diff --git a/extensions/spring-data-rest/deployment/src/main/java/io/quarkus/spring/data/rest/deployment/RepositoryMethodsImplementor.java b/extensions/spring-data-rest/deployment/src/main/java/io/quarkus/spring/data/rest/deployment/RepositoryMethodsImplementor.java
index 22b936f891448..33a1f25fe1218 100644
--- a/extensions/spring-data-rest/deployment/src/main/java/io/quarkus/spring/data/rest/deployment/RepositoryMethodsImplementor.java
+++ b/extensions/spring-data-rest/deployment/src/main/java/io/quarkus/spring/data/rest/deployment/RepositoryMethodsImplementor.java
@@ -131,7 +131,7 @@ public void implementPagedList(ClassCreator classCreator, String repositoryInter
//PagingAndSortingRepository Page findAll(Pageable pageable);
public void implementListPageCount(ClassCreator classCreator, String repositoryInterfaceName) {
MethodCreator methodCreator = classCreator.getMethodCreator(Constants.PAGE_COUNT_METHOD_PREFIX + "list",
- int.class, Page.class);
+ int.class, Page.class, String.class, Map.class);
if (entityClassHelper.isPagingAndSortingRepository(repositoryInterfaceName)) {
ResultHandle page = methodCreator.getMethodParam(0);
ResultHandle pageable = toPageable(methodCreator, page);
diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/RequireSocketHttpBuildItem.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/RequireSocketHttpBuildItem.java
new file mode 100644
index 0000000000000..18f4debbea48d
--- /dev/null
+++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/RequireSocketHttpBuildItem.java
@@ -0,0 +1,13 @@
+package io.quarkus.vertx.http.deployment;
+
+import io.quarkus.builder.item.SimpleBuildItem;
+
+/**
+ * Marker class that can be used to force the socket to open even when using virtual HTTP.
+ *
+ * There are some use cases that may want to handle both real and virtual HTTP requests, such as mapping incoming
+ * gRPC requests onto JAX-RS handlers.
+ */
+public final class RequireSocketHttpBuildItem extends SimpleBuildItem {
+ public static final RequireSocketHttpBuildItem MARKER = new RequireSocketHttpBuildItem();
+}
diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java
index 495e331d6257a..d66390edf7334 100644
--- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java
+++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/VertxHttpProcessor.java
@@ -420,6 +420,7 @@ void openSocket(ApplicationStartBuildItem start,
BuildProducer reflectiveClass,
HttpBuildTimeConfig httpBuildTimeConfig,
Optional requireVirtual,
+ Optional requireSocket,
EventLoopCountBuildItem eventLoopCount,
List websocketSubProtocols,
Capabilities capabilities,
@@ -430,8 +431,9 @@ void openSocket(ApplicationStartBuildItem start,
.produce(ReflectiveClassBuildItem.builder(VirtualServerChannel.class)
.build());
}
- boolean startSocket = (!startVirtual || launchMode.getLaunchMode() != LaunchMode.NORMAL)
- && (requireVirtual.isEmpty() || !requireVirtual.get().isAlwaysVirtual());
+ boolean startSocket = requireSocket.isPresent() ||
+ ((!startVirtual || launchMode.getLaunchMode() != LaunchMode.NORMAL)
+ && (requireVirtual.isEmpty() || !requireVirtual.get().isAlwaysVirtual()));
recorder.startServer(vertx.getVertx(), shutdown,
launchMode.getLaunchMode(), startVirtual, startSocket,
eventLoopCount.getEventLoopCount(),
diff --git a/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-header.js b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-header.js
index b46e5f26a74d6..20805111c7ea1 100644
--- a/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-header.js
+++ b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-header.js
@@ -1,22 +1,18 @@
import { LitElement, html, css } from 'lit';
import { RouterController } from 'router-controller';
-import { StorageController } from 'storage-controller';
import { notifier } from 'notifier';
import { observeState } from 'lit-element-state';
import { themeState } from 'theme-state';
import { devuiState } from 'devui-state';
-import '@vaadin/menu-bar';
import '@vaadin/tabs';
-import '@vaadin/button';
import 'qwc/qwc-extension-link.js';
-
+import './qwc-theme-switch.js';
/**
* This component represent the Dev UI Header
*/
export class QwcHeader extends observeState(LitElement) {
routerController = new RouterController(this);
- storageControl = new StorageController(this);
static styles = css`
@@ -31,7 +27,7 @@ export class QwcHeader extends observeState(LitElement) {
display: flex;
justify-content: space-around;
align-items: center;
- padding-right: 60px;
+ padding-right: 10px;
}
.logo-title {
@@ -88,13 +84,6 @@ export class QwcHeader extends observeState(LitElement) {
align-items: center;
}
- .themeDropdown {
- position: absolute;
- right: 0px;
- top: 10px;
- z-index: 3;
- }
-
.hidden {
display:none;
}
@@ -103,10 +92,7 @@ export class QwcHeader extends observeState(LitElement) {
static properties = {
_title: {state: true},
_subTitle: {state: true},
- _rightSideNav: {state: true},
- _selectedTheme: {state: true},
- _themeOptions: {state: true},
- _desktopTheme: {state: true}
+ _rightSideNav: {state: true}
};
constructor() {
@@ -115,10 +101,6 @@ export class QwcHeader extends observeState(LitElement) {
this._subTitle = null;
this._rightSideNav = "";
- this._createThemeItems();
- this._restoreThemePreference();
- this._createThemeOptions();
-
window.addEventListener('vaadin-router-location-changed', (event) => {
this._updateHeader(event);
});
@@ -126,34 +108,6 @@ export class QwcHeader extends observeState(LitElement) {
connectedCallback() {
super.connectedCallback();
- // Get desktop theme setting
- this._desktopTheme = "dark";
- if(window.matchMedia){
- if(window.matchMedia('(prefers-color-scheme: light)').matches){
- this._desktopTheme = "light";
- }
-
- // Change theme setting when OS theme change
- window.matchMedia('(prefers-color-scheme: light)').addEventListener('change', e => {
- if(e.matches){
- this._desktopTheme = "light";
- }else{
- this._desktopTheme = "dark";
- }
- this._changeToSelectedTheme();
- });
- }
-
- this._changeToSelectedTheme();
- }
-
- _restoreThemePreference() {
- const storedValue = this.storageControl.get("theme-preference");
- if(storedValue){
- this._selectedTheme = storedValue;
- }else {
- this._selectedTheme = "desktop";
- }
}
render() {
@@ -197,71 +151,7 @@ export class QwcHeader extends observeState(LitElement) {
}
_renderThemeOptions(){
- return html` this._changeThemeOption(e)}">
- `;
- }
-
- _changeThemeOption(e){
- this._selectedTheme = e.detail.value.name;
- this._createThemeOptions();
- this._changeToSelectedTheme();
- this.storageControl.set('theme-preference', this._selectedTheme);
- }
-
- _changeToSelectedTheme(){
- if(this._selectedTheme === "desktop"){
- themeState.changeTo(this._desktopTheme);
- }else {
- themeState.changeTo(this._selectedTheme);
- }
- }
-
- _createThemeOptions(){
-
- let selectedComponent = this._desktopThemeItem;
- if(this._selectedTheme === "dark"){
- selectedComponent = this._darkThemeItem;
- }else if(this._selectedTheme === "light"){
- selectedComponent = this._lightThemeItem;
- }
-
- this._themeOptions = [
- {
- component: selectedComponent,
- children: [
- {
- component: this._darkThemeItem,
- name: "dark"
- },
- {
- component: this._lightThemeItem,
- name: "light"
- },
- {
- component: this._desktopThemeItem,
- name: "desktop"
- }
- ]
- }
-
- ];
- }
-
- _createThemeItems() {
- this._darkThemeItem = this._createThemeItem("moon", "dark");
- this._lightThemeItem = this._createThemeItem("sun", "light");
- this._desktopThemeItem = this._createThemeItem("desktop", "desktop");
- }
-
- _createThemeItem(iconName, ariaLabel) {
- const item = document.createElement('vaadin-context-menu-item');
- const icon = document.createElement('vaadin-icon');
- item.setAttribute('aria-label', ariaLabel);
- icon.setAttribute('icon', `font-awesome-solid:${iconName}`);
- item.appendChild(icon);
- return item;
+ return html``;
}
_updateHeader(event){
diff --git a/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-theme-switch.js b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-theme-switch.js
new file mode 100644
index 0000000000000..8acb1fde66334
--- /dev/null
+++ b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-theme-switch.js
@@ -0,0 +1,98 @@
+import { LitElement, html, css } from 'lit';
+import { themeState } from 'theme-state';
+import { StorageController } from 'storage-controller';
+import '@vaadin/button';
+
+/**
+ * Basic theme switch
+ */
+export class QwcThemeSwitch extends LitElement {
+ storageControl = new StorageController(this);
+
+ themes = [
+ { id: 0, name: 'Desktop', icon: 'font-awesome-solid:desktop' },
+ { id: 1, name: 'Light', icon: 'font-awesome-solid:sun' },
+ { id: 2, name: 'Dark', icon: 'font-awesome-solid:moon' }
+ ];
+
+ static styles = css`
+ .themeButton {
+ padding-left: 10px;
+ }
+ .button {
+ --vaadin-button-background: var(--lumo-base-color);
+ }
+ `;
+
+ static properties = {
+ _selectedThemeIndex: {state: true},
+ };
+
+ constructor() {
+ super();
+ this._restoreThemePreference();
+ }
+
+ connectedCallback() {
+ super.connectedCallback();
+ this._desktopTheme = "dark"; // default
+ if(window.matchMedia){
+ if(window.matchMedia('(prefers-color-scheme: light)').matches){
+ this._desktopTheme = "light";
+ }
+
+ // Change theme setting when OS theme change
+ window.matchMedia('(prefers-color-scheme: light)').addEventListener('change', e => {
+ if(e.matches){
+ this._desktopTheme = "light";
+ }else{
+ this._desktopTheme = "dark";
+ }
+ if(this._selectedThemeIndex===0){
+ this._changeToSelectedThemeIndex();
+ }
+ });
+ }
+
+ this._changeToSelectedThemeIndex();
+ }
+
+ render() {
+ let theme = this.themes[this._selectedThemeIndex];
+
+ return html`
+
+
+
+
`;
+ }
+
+ _nextTheme(e){
+ this._selectedThemeIndex = (this._selectedThemeIndex + 1) % this.themes.length;
+ this._changeToSelectedThemeIndex();
+ }
+
+ _changeToSelectedThemeIndex(){
+ let theme = this.themes[this._selectedThemeIndex];
+ this.storageControl.set('theme-preference', theme.id);
+
+ if(theme.id === 0){ // Desktop
+ themeState.changeTo(this._desktopTheme);
+ }else {
+ themeState.changeTo(theme.name.toLowerCase());
+ }
+
+ }
+
+ _restoreThemePreference() {
+ const storedValue = this.storageControl.get("theme-preference");
+ if(storedValue){
+ this._selectedThemeIndex = storedValue;
+ } else {
+ this._selectedThemeIndex = 0;
+ }
+ }
+
+
+}
+customElements.define('qwc-theme-switch', QwcThemeSwitch);
\ No newline at end of file
diff --git a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/CloseReason.java b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/CloseReason.java
index 108c2d150b55b..009155eb67e41 100644
--- a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/CloseReason.java
+++ b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/CloseReason.java
@@ -50,4 +50,9 @@ public String getMessage() {
return message;
}
+ @Override
+ public String toString() {
+ return "CloseReason [code=" + code + ", " + (message != null ? "message=" + message : "") + "]";
+ }
+
}
diff --git a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectionBase.java b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectionBase.java
index 3b5694e9ac8c6..4febc7792d813 100644
--- a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectionBase.java
+++ b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectionBase.java
@@ -131,7 +131,12 @@ public BroadcastSender broadcast() {
public CloseReason closeReason() {
WebSocketBase ws = webSocket();
if (ws.isClosed()) {
- return new CloseReason(ws.closeStatusCode(), ws.closeReason());
+ Short code = ws.closeStatusCode();
+ if (code == null) {
+ // This could happen if the connection is terminated abruptly
+ return CloseReason.INTERNAL_SERVER_ERROR;
+ }
+ return new CloseReason(code, ws.closeReason());
}
return null;
}
diff --git a/independent-projects/resteasy-reactive/pom.xml b/independent-projects/resteasy-reactive/pom.xml
index 6beec95db70b0..c305e3fd84091 100644
--- a/independent-projects/resteasy-reactive/pom.xml
+++ b/independent-projects/resteasy-reactive/pom.xml
@@ -64,7 +64,7 @@
2.17.2
2.6.0
3.0.2
- 3.0.3
+ 3.0.4
3.0.1
4.2.1
3.13.2