mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +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 io.xpipe.core.store.StorePath;
|
||||||
|
|
||||||
import com.sun.net.httpserver.HttpExchange;
|
import com.sun.net.httpserver.HttpExchange;
|
||||||
|
import org.apache.commons.lang3.ClassUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class ConnectionInfoExchangeImpl extends ConnectionInfoExchange {
|
public class ConnectionInfoExchangeImpl extends ConnectionInfoExchange {
|
||||||
|
|
||||||
|
@ -26,6 +28,9 @@ public class ConnectionInfoExchangeImpl extends ConnectionInfoExchange {
|
||||||
.orElseThrow())
|
.orElseThrow())
|
||||||
.getNames();
|
.getNames();
|
||||||
var cat = new StorePath(names.subList(1, names.size()));
|
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()
|
var apply = InfoResponse.builder()
|
||||||
.lastModified(e.getLastModified())
|
.lastModified(e.getLastModified())
|
||||||
|
@ -37,10 +42,36 @@ public class ConnectionInfoExchangeImpl extends ConnectionInfoExchange {
|
||||||
.usageCategory(e.getProvider().getUsageCategory())
|
.usageCategory(e.getProvider().getUsageCategory())
|
||||||
.type(e.getProvider().getId())
|
.type(e.getProvider().getId())
|
||||||
.state(e.getStorePersistentState() != null ? e.getStorePersistentState() : new Object())
|
.state(e.getStorePersistentState() != null ? e.getStorePersistentState() : new Object())
|
||||||
.cache(e.getStoreCache())
|
.cache(cache)
|
||||||
.build();
|
.build();
|
||||||
list.add(apply);
|
list.add(apply);
|
||||||
}
|
}
|
||||||
return Response.builder().infos(list).build();
|
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().getAllConnectionsCategory(),
|
||||||
StoreViewState.get().getActiveCategory(),
|
StoreViewState.get().getActiveCategory(),
|
||||||
this.category)
|
this.category)
|
||||||
.styleClass(Styles.LEFT_PILL)
|
.styleClass(Styles.LEFT_PILL);
|
||||||
.minWidth(Region.USE_PREF_SIZE);
|
|
||||||
var filter = new FilterComp(this.filter).styleClass(Styles.RIGHT_PILL).minWidth(0).hgrow();
|
var filter = new FilterComp(this.filter).styleClass(Styles.RIGHT_PILL).minWidth(0).hgrow();
|
||||||
|
|
||||||
var top = new HorizontalComp(List.of(category, filter))
|
var top = new HorizontalComp(List.of(category, filter))
|
||||||
|
@ -40,6 +39,9 @@ public final class BrowserBookmarkHeaderComp extends SimpleComp {
|
||||||
((Region) struc.get().getChildren().get(0))
|
((Region) struc.get().getChildren().get(0))
|
||||||
.prefHeightProperty()
|
.prefHeightProperty()
|
||||||
.bind(((Region) struc.get().getChildren().get(1)).heightProperty());
|
.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")
|
.styleClass("bookmarks-header")
|
||||||
.createRegion();
|
.createRegion();
|
||||||
|
|
|
@ -19,7 +19,3 @@
|
||||||
-fx-background-color: -color-bg-subtle;
|
-fx-background-color: -color-bg-subtle;
|
||||||
-fx-border-width: 1 0 0 0;
|
-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;
|
-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 {
|
.store-header-bar {
|
||||||
-fx-background-radius: 0 0 4px 0;
|
-fx-background-radius: 0 0 4px 0;
|
||||||
-fx-border-radius: 0 0 4px 0;
|
-fx-border-radius: 0 0 4px 0;
|
||||||
|
|
Loading…
Reference in a new issue