mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Various fixes
This commit is contained in:
parent
235f90ad86
commit
9b20a5019f
4 changed files with 36 additions and 11 deletions
|
@ -6,9 +6,11 @@ import io.xpipe.beacon.api.ConnectionInfoExchange;
|
|||
import io.xpipe.core.store.StorePath;
|
||||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import org.apache.commons.lang3.ClassUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ConnectionInfoExchangeImpl extends ConnectionInfoExchange {
|
||||
|
||||
|
@ -26,6 +28,9 @@ public class ConnectionInfoExchangeImpl extends ConnectionInfoExchange {
|
|||
.orElseThrow())
|
||||
.getNames();
|
||||
var cat = new StorePath(names.subList(1, names.size()));
|
||||
var cache = e.getStoreCache().entrySet().stream().filter(stringObjectEntry -> {
|
||||
return stringObjectEntry.getValue() != null && (ClassUtils.isPrimitiveOrWrapper(stringObjectEntry.getValue().getClass()) || stringObjectEntry.getValue() instanceof String);
|
||||
}).collect(Collectors.toMap(stringObjectEntry -> stringObjectEntry.getKey(),stringObjectEntry -> stringObjectEntry.getValue()));
|
||||
|
||||
var apply = InfoResponse.builder()
|
||||
.lastModified(e.getLastModified())
|
||||
|
@ -37,10 +42,36 @@ public class ConnectionInfoExchangeImpl extends ConnectionInfoExchange {
|
|||
.usageCategory(e.getProvider().getUsageCategory())
|
||||
.type(e.getProvider().getId())
|
||||
.state(e.getStorePersistentState() != null ? e.getStorePersistentState() : new Object())
|
||||
.cache(e.getStoreCache())
|
||||
.cache(cache)
|
||||
.build();
|
||||
list.add(apply);
|
||||
}
|
||||
return Response.builder().infos(list).build();
|
||||
}
|
||||
|
||||
private Class<?> toWrapper(Class<?> clazz) {
|
||||
if (!clazz.isPrimitive())
|
||||
return clazz;
|
||||
|
||||
if (clazz == Integer.TYPE)
|
||||
return Integer.class;
|
||||
if (clazz == Long.TYPE)
|
||||
return Long.class;
|
||||
if (clazz == Boolean.TYPE)
|
||||
return Boolean.class;
|
||||
if (clazz == Byte.TYPE)
|
||||
return Byte.class;
|
||||
if (clazz == Character.TYPE)
|
||||
return Character.class;
|
||||
if (clazz == Float.TYPE)
|
||||
return Float.class;
|
||||
if (clazz == Double.TYPE)
|
||||
return Double.class;
|
||||
if (clazz == Short.TYPE)
|
||||
return Short.class;
|
||||
if (clazz == Void.TYPE)
|
||||
return Void.class;
|
||||
|
||||
return clazz;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,8 +30,7 @@ public final class BrowserBookmarkHeaderComp extends SimpleComp {
|
|||
StoreViewState.get().getAllConnectionsCategory(),
|
||||
StoreViewState.get().getActiveCategory(),
|
||||
this.category)
|
||||
.styleClass(Styles.LEFT_PILL)
|
||||
.minWidth(Region.USE_PREF_SIZE);
|
||||
.styleClass(Styles.LEFT_PILL);
|
||||
var filter = new FilterComp(this.filter).styleClass(Styles.RIGHT_PILL).minWidth(0).hgrow();
|
||||
|
||||
var top = new HorizontalComp(List.of(category, filter))
|
||||
|
@ -40,6 +39,9 @@ public final class BrowserBookmarkHeaderComp extends SimpleComp {
|
|||
((Region) struc.get().getChildren().get(0))
|
||||
.prefHeightProperty()
|
||||
.bind(((Region) struc.get().getChildren().get(1)).heightProperty());
|
||||
((Region) struc.get().getChildren().get(0))
|
||||
.minWidthProperty()
|
||||
.bind(struc.get().widthProperty().divide(2.0));
|
||||
})
|
||||
.styleClass("bookmarks-header")
|
||||
.createRegion();
|
||||
|
|
|
@ -19,7 +19,3 @@
|
|||
-fx-background-color: -color-bg-subtle;
|
||||
-fx-border-width: 1 0 0 0;
|
||||
}
|
||||
|
||||
.root:seamless-frame .dialog-comp .buttons {
|
||||
-fx-background-color: transparent;
|
||||
}
|
|
@ -3,10 +3,6 @@
|
|||
-fx-padding: 0.8em 1.0em 0.8em 1.0em;
|
||||
}
|
||||
|
||||
.root:pretty .bar {
|
||||
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 3, 0.5, 1, 1);
|
||||
}
|
||||
|
||||
.store-header-bar {
|
||||
-fx-background-radius: 0 0 4px 0;
|
||||
-fx-border-radius: 0 0 4px 0;
|
||||
|
|
Loading…
Reference in a new issue