mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Reformat
This commit is contained in:
parent
dacd24a8e5
commit
06a7ef27b5
19 changed files with 143 additions and 109 deletions
|
@ -163,16 +163,20 @@ public class AppBeaconServer {
|
||||||
if (notFoundHtml == null) {
|
if (notFoundHtml == null) {
|
||||||
AppResources.with(AppResources.XPIPE_MODULE, "misc/api.md", file -> {
|
AppResources.with(AppResources.XPIPE_MODULE, "misc/api.md", file -> {
|
||||||
var md = Files.readString(file);
|
var md = Files.readString(file);
|
||||||
md = md.replaceAll(Pattern.quote( """
|
md = md.replaceAll(
|
||||||
|
Pattern.quote(
|
||||||
|
"""
|
||||||
> 400 Response
|
> 400 Response
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"message": "string"
|
"message": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
"""), "");
|
"""),
|
||||||
notFoundHtml = MarkdownHelper.toHtml(md,
|
"");
|
||||||
|
notFoundHtml = MarkdownHelper.toHtml(
|
||||||
|
md,
|
||||||
head -> {
|
head -> {
|
||||||
return head + "\n" + "<link rel=\"stylesheet\" href=\"markdown.css\">"
|
return head + "\n" + "<link rel=\"stylesheet\" href=\"markdown.css\">"
|
||||||
+ "\n" + "<link rel=\"stylesheet\" href=\"github-dark.min.css\">"
|
+ "\n" + "<link rel=\"stylesheet\" href=\"github-dark.min.css\">"
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
package io.xpipe.app.beacon.impl;
|
package io.xpipe.app.beacon.impl;
|
||||||
|
|
||||||
import com.sun.net.httpserver.HttpExchange;
|
|
||||||
import io.xpipe.app.storage.DataStorage;
|
import io.xpipe.app.storage.DataStorage;
|
||||||
import io.xpipe.beacon.BeaconClientException;
|
import io.xpipe.beacon.BeaconClientException;
|
||||||
import io.xpipe.beacon.api.ConnectionInfoExchange;
|
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 java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -15,7 +16,9 @@ public class ConnectionInfoExchangeImpl extends ConnectionInfoExchange {
|
||||||
public Object handle(HttpExchange exchange, Request msg) throws BeaconClientException {
|
public Object handle(HttpExchange exchange, Request msg) throws BeaconClientException {
|
||||||
var list = new ArrayList<InfoResponse>();
|
var list = new ArrayList<InfoResponse>();
|
||||||
for (UUID uuid : msg.getConnections()) {
|
for (UUID uuid : msg.getConnections()) {
|
||||||
var e = DataStorage.get().getStoreEntryIfPresent(uuid).orElseThrow(() -> new BeaconClientException("Unknown connection: " + uuid));
|
var e = DataStorage.get()
|
||||||
|
.getStoreEntryIfPresent(uuid)
|
||||||
|
.orElseThrow(() -> new BeaconClientException("Unknown connection: " + uuid));
|
||||||
|
|
||||||
var names = DataStorage.get()
|
var names = DataStorage.get()
|
||||||
.getStorePath(DataStorage.get()
|
.getStorePath(DataStorage.get()
|
||||||
|
@ -24,9 +27,17 @@ public class ConnectionInfoExchangeImpl extends ConnectionInfoExchange {
|
||||||
.getNames();
|
.getNames();
|
||||||
var cat = new StorePath(names.subList(1, names.size()));
|
var cat = new StorePath(names.subList(1, names.size()));
|
||||||
|
|
||||||
var apply = InfoResponse.builder().lastModified(e.getLastModified()).lastUsed(e.getLastUsed()).connection(e.getCategoryUuid()).category(cat).name(
|
var apply = InfoResponse.builder()
|
||||||
DataStorage.get().getStorePath(e)).rawData(e.getStore()).usageCategory(e.getProvider().getUsageCategory()).type(
|
.lastModified(e.getLastModified())
|
||||||
e.getProvider().getId()).state(e.getStorePersistentState()).build();
|
.lastUsed(e.getLastUsed())
|
||||||
|
.connection(e.getCategoryUuid())
|
||||||
|
.category(cat)
|
||||||
|
.name(DataStorage.get().getStorePath(e))
|
||||||
|
.rawData(e.getStore())
|
||||||
|
.usageCategory(e.getProvider().getUsageCategory())
|
||||||
|
.type(e.getProvider().getId())
|
||||||
|
.state(e.getStorePersistentState())
|
||||||
|
.build();
|
||||||
list.add(apply);
|
list.add(apply);
|
||||||
}
|
}
|
||||||
return Response.builder().infos(list).build();
|
return Response.builder().infos(list).build();
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
package io.xpipe.app.beacon.impl;
|
package io.xpipe.app.beacon.impl;
|
||||||
|
|
||||||
import com.sun.net.httpserver.HttpExchange;
|
|
||||||
import io.xpipe.app.storage.DataStorage;
|
import io.xpipe.app.storage.DataStorage;
|
||||||
import io.xpipe.app.storage.DataStoreEntry;
|
import io.xpipe.app.storage.DataStoreEntry;
|
||||||
import io.xpipe.beacon.api.ConnectionQueryExchange;
|
import io.xpipe.beacon.api.ConnectionQueryExchange;
|
||||||
|
|
||||||
|
import com.sun.net.httpserver.HttpExchange;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -13,7 +14,8 @@ public class ConnectionQueryExchangeImpl extends ConnectionQueryExchange {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object handle(HttpExchange exchange, Request msg) {
|
public Object handle(HttpExchange exchange, Request msg) {
|
||||||
var catMatcher = Pattern.compile(toRegex("all connections/" + msg.getCategoryFilter().toLowerCase()));
|
var catMatcher = Pattern.compile(
|
||||||
|
toRegex("all connections/" + msg.getCategoryFilter().toLowerCase()));
|
||||||
var conMatcher = Pattern.compile(toRegex(msg.getConnectionFilter().toLowerCase()));
|
var conMatcher = Pattern.compile(toRegex(msg.getConnectionFilter().toLowerCase()));
|
||||||
var typeMatcher = Pattern.compile(toRegex(msg.getTypeFilter().toLowerCase()));
|
var typeMatcher = Pattern.compile(toRegex(msg.getTypeFilter().toLowerCase()));
|
||||||
|
|
||||||
|
@ -49,7 +51,9 @@ public class ConnectionQueryExchangeImpl extends ConnectionQueryExchange {
|
||||||
found.add(storeEntry);
|
found.add(storeEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response.builder().found(found.stream().map(entry -> entry.getUuid()).toList()).build();
|
return Response.builder()
|
||||||
|
.found(found.stream().map(entry -> entry.getUuid()).toList())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String toRegex(String pattern) {
|
private String toRegex(String pattern) {
|
||||||
|
|
|
@ -31,7 +31,8 @@ public class FsReadExchangeImpl extends FsReadExchange {
|
||||||
var file = BlobManager.get().newBlobFile();
|
var file = BlobManager.get().newBlobFile();
|
||||||
try (var in = fs.openInput(msg.getPath().toString())) {
|
try (var in = fs.openInput(msg.getPath().toString())) {
|
||||||
var fixedIn = new FixedSizeInputStream(new BufferedInputStream(in), size);
|
var fixedIn = new FixedSizeInputStream(new BufferedInputStream(in), size);
|
||||||
try (var fileOut = Files.newOutputStream(file.resolve(msg.getPath().getFileName()))) {
|
try (var fileOut =
|
||||||
|
Files.newOutputStream(file.resolve(msg.getPath().getFileName()))) {
|
||||||
fixedIn.transferTo(fileOut);
|
fixedIn.transferTo(fileOut);
|
||||||
}
|
}
|
||||||
in.transferTo(OutputStream.nullOutputStream());
|
in.transferTo(OutputStream.nullOutputStream());
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package io.xpipe.app.browser;
|
package io.xpipe.app.browser;
|
||||||
|
|
||||||
import atlantafx.base.theme.Styles;
|
|
||||||
import io.xpipe.app.comp.store.StoreCategoryWrapper;
|
import io.xpipe.app.comp.store.StoreCategoryWrapper;
|
||||||
import io.xpipe.app.comp.store.StoreViewState;
|
import io.xpipe.app.comp.store.StoreViewState;
|
||||||
import io.xpipe.app.fxcomps.SimpleComp;
|
import io.xpipe.app.fxcomps.SimpleComp;
|
||||||
import io.xpipe.app.fxcomps.impl.FilterComp;
|
import io.xpipe.app.fxcomps.impl.FilterComp;
|
||||||
import io.xpipe.app.fxcomps.impl.HorizontalComp;
|
import io.xpipe.app.fxcomps.impl.HorizontalComp;
|
||||||
import io.xpipe.app.util.DataStoreCategoryChoiceComp;
|
import io.xpipe.app.util.DataStoreCategoryChoiceComp;
|
||||||
|
|
||||||
import javafx.beans.property.Property;
|
import javafx.beans.property.Property;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.scene.layout.Region;
|
import javafx.scene.layout.Region;
|
||||||
|
|
||||||
|
import atlantafx.base.theme.Styles;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -29,9 +31,7 @@ public final class BrowserBookmarkHeaderComp extends SimpleComp {
|
||||||
StoreViewState.get().getActiveCategory(),
|
StoreViewState.get().getActiveCategory(),
|
||||||
this.category)
|
this.category)
|
||||||
.styleClass(Styles.LEFT_PILL);
|
.styleClass(Styles.LEFT_PILL);
|
||||||
var filter = new FilterComp(this.filter)
|
var filter = new FilterComp(this.filter).styleClass(Styles.RIGHT_PILL).hgrow();
|
||||||
.styleClass(Styles.RIGHT_PILL)
|
|
||||||
.hgrow();
|
|
||||||
|
|
||||||
var top = new HorizontalComp(List.of(category, filter))
|
var top = new HorizontalComp(List.of(category, filter))
|
||||||
.apply(struc -> struc.get().setFillHeight(true))
|
.apply(struc -> struc.get().setFillHeight(true))
|
||||||
|
|
|
@ -50,17 +50,20 @@ public class BrowserSelectionListComp extends SimpleComp {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Region createSimple() {
|
protected Region createSimple() {
|
||||||
var c = new ListBoxViewComp<>(list, list, entry -> {
|
var c = new ListBoxViewComp<>(
|
||||||
return Comp.of(() -> {
|
list,
|
||||||
var image = PrettyImageHelper.ofFixedSizeSquare(entry.getIcon(), 24)
|
list,
|
||||||
.createRegion();
|
entry -> {
|
||||||
var l = new Label(null, image);
|
return Comp.of(() -> {
|
||||||
l.setTextOverrun(OverrunStyle.CENTER_ELLIPSIS);
|
var image = PrettyImageHelper.ofFixedSizeSquare(entry.getIcon(), 24)
|
||||||
l.textProperty().bind(PlatformThread.sync(nameTransformation.apply(entry)));
|
.createRegion();
|
||||||
return l;
|
var l = new Label(null, image);
|
||||||
});
|
l.setTextOverrun(OverrunStyle.CENTER_ELLIPSIS);
|
||||||
},
|
l.textProperty().bind(PlatformThread.sync(nameTransformation.apply(entry)));
|
||||||
false)
|
return l;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
false)
|
||||||
.styleClass("selected-file-list");
|
.styleClass("selected-file-list");
|
||||||
return c.createRegion();
|
return c.createRegion();
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,19 +97,23 @@ public class BrowserWelcomeComp extends SimpleComp {
|
||||||
var storeList = new VBox();
|
var storeList = new VBox();
|
||||||
storeList.setSpacing(8);
|
storeList.setSpacing(8);
|
||||||
|
|
||||||
var listBox = new ListBoxViewComp<>(list, list, e -> {
|
var listBox = new ListBoxViewComp<>(
|
||||||
var disable = new SimpleBooleanProperty();
|
list,
|
||||||
var entryButton = entryButton(e, disable);
|
list,
|
||||||
var dirButton = dirButton(e, disable);
|
e -> {
|
||||||
return new HorizontalComp(List.of(entryButton, dirButton)).apply(struc -> {
|
var disable = new SimpleBooleanProperty();
|
||||||
((Region) struc.get().getChildren().get(0))
|
var entryButton = entryButton(e, disable);
|
||||||
.prefHeightProperty()
|
var dirButton = dirButton(e, disable);
|
||||||
.bind(struc.get().heightProperty());
|
return new HorizontalComp(List.of(entryButton, dirButton)).apply(struc -> {
|
||||||
((Region) struc.get().getChildren().get(1))
|
((Region) struc.get().getChildren().get(0))
|
||||||
.prefHeightProperty()
|
.prefHeightProperty()
|
||||||
.bind(struc.get().heightProperty());
|
.bind(struc.get().heightProperty());
|
||||||
});
|
((Region) struc.get().getChildren().get(1))
|
||||||
}, true)
|
.prefHeightProperty()
|
||||||
|
.bind(struc.get().heightProperty());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
true)
|
||||||
.apply(struc -> {
|
.apply(struc -> {
|
||||||
VBox vBox = (VBox) struc.get().getContent();
|
VBox vBox = (VBox) struc.get().getContent();
|
||||||
vBox.setSpacing(10);
|
vBox.setSpacing(10);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import io.xpipe.app.fxcomps.CompStructure;
|
||||||
import io.xpipe.app.fxcomps.SimpleCompStructure;
|
import io.xpipe.app.fxcomps.SimpleCompStructure;
|
||||||
import io.xpipe.app.fxcomps.util.DerivedObservableList;
|
import io.xpipe.app.fxcomps.util.DerivedObservableList;
|
||||||
import io.xpipe.app.fxcomps.util.PlatformThread;
|
import io.xpipe.app.fxcomps.util.PlatformThread;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.collections.ListChangeListener;
|
import javafx.collections.ListChangeListener;
|
||||||
|
@ -32,7 +33,8 @@ public class ListBoxViewComp<T> extends Comp<CompStructure<ScrollPane>> {
|
||||||
private final int limit = Integer.MAX_VALUE;
|
private final int limit = Integer.MAX_VALUE;
|
||||||
private final boolean scrollBar;
|
private final boolean scrollBar;
|
||||||
|
|
||||||
public ListBoxViewComp(ObservableList<T> shown, ObservableList<T> all, Function<T, Comp<?>> compFunction, boolean scrollBar) {
|
public ListBoxViewComp(
|
||||||
|
ObservableList<T> shown, ObservableList<T> all, Function<T, Comp<?>> compFunction, boolean scrollBar) {
|
||||||
this.shown = PlatformThread.sync(shown);
|
this.shown = PlatformThread.sync(shown);
|
||||||
this.all = PlatformThread.sync(all);
|
this.all = PlatformThread.sync(all);
|
||||||
this.compFunction = compFunction;
|
this.compFunction = compFunction;
|
||||||
|
@ -64,10 +66,13 @@ public class ListBoxViewComp<T> extends Comp<CompStructure<ScrollPane>> {
|
||||||
scroll.skinProperty().subscribe(newValue -> {
|
scroll.skinProperty().subscribe(newValue -> {
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
ScrollBar bar = (ScrollBar) scroll.lookup(".scroll-bar:vertical");
|
ScrollBar bar = (ScrollBar) scroll.lookup(".scroll-bar:vertical");
|
||||||
bar.opacityProperty().bind(Bindings.createDoubleBinding(() -> {
|
bar.opacityProperty()
|
||||||
var v = bar.getVisibleAmount();
|
.bind(Bindings.createDoubleBinding(
|
||||||
return v < 1.0 ? 1.0 : 0.0;
|
() -> {
|
||||||
}, bar.visibleAmountProperty()));
|
var v = bar.getVisibleAmount();
|
||||||
|
return v < 1.0 ? 1.0 : 0.0;
|
||||||
|
},
|
||||||
|
bar.visibleAmountProperty()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -28,29 +28,22 @@ public class StoreCreationMenu {
|
||||||
|
|
||||||
menu.getItems().add(category("addHost", "mdi2h-home-plus", DataStoreCreationCategory.HOST, "ssh"));
|
menu.getItems().add(category("addHost", "mdi2h-home-plus", DataStoreCreationCategory.HOST, "ssh"));
|
||||||
|
|
||||||
menu.getItems()
|
menu.getItems().add(category("addDesktop", "mdi2c-camera-plus", DataStoreCreationCategory.DESKTOP, null));
|
||||||
.add(category("addDesktop", "mdi2c-camera-plus", DataStoreCreationCategory.DESKTOP, null));
|
|
||||||
|
menu.getItems().add(category("addShell", "mdi2t-text-box-multiple", DataStoreCreationCategory.SHELL, null));
|
||||||
|
|
||||||
menu.getItems()
|
menu.getItems()
|
||||||
.add(category("addShell", "mdi2t-text-box-multiple", DataStoreCreationCategory.SHELL, null));
|
.add(category("addScript", "mdi2s-script-text-outline", DataStoreCreationCategory.SCRIPT, "script"));
|
||||||
|
|
||||||
|
menu.getItems().add(category("addService", "mdi2c-cloud-braces", DataStoreCreationCategory.SERVICE, null));
|
||||||
|
|
||||||
menu.getItems()
|
menu.getItems()
|
||||||
.add(category(
|
.add(category("addTunnel", "mdi2v-vector-polyline-plus", DataStoreCreationCategory.TUNNEL, null));
|
||||||
"addScript", "mdi2s-script-text-outline", DataStoreCreationCategory.SCRIPT, "script"));
|
|
||||||
|
|
||||||
menu.getItems()
|
menu.getItems()
|
||||||
.add(category("addService", "mdi2c-cloud-braces", DataStoreCreationCategory.SERVICE, null));
|
.add(category("addCommand", "mdi2c-code-greater-than", DataStoreCreationCategory.COMMAND, "cmd"));
|
||||||
|
|
||||||
menu.getItems()
|
menu.getItems().add(category("addDatabase", "mdi2d-database-plus", DataStoreCreationCategory.DATABASE, null));
|
||||||
.add(category(
|
|
||||||
"addTunnel", "mdi2v-vector-polyline-plus", DataStoreCreationCategory.TUNNEL, null));
|
|
||||||
|
|
||||||
menu.getItems()
|
|
||||||
.add(category(
|
|
||||||
"addCommand", "mdi2c-code-greater-than", DataStoreCreationCategory.COMMAND, "cmd"));
|
|
||||||
|
|
||||||
menu.getItems()
|
|
||||||
.add(category("addDatabase", "mdi2d-database-plus", DataStoreCreationCategory.DATABASE, null));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static MenuItem category(
|
private static MenuItem category(
|
||||||
|
|
|
@ -4,6 +4,7 @@ import io.xpipe.app.comp.base.ListBoxViewComp;
|
||||||
import io.xpipe.app.comp.base.MultiContentComp;
|
import io.xpipe.app.comp.base.MultiContentComp;
|
||||||
import io.xpipe.app.fxcomps.Comp;
|
import io.xpipe.app.fxcomps.Comp;
|
||||||
import io.xpipe.app.fxcomps.SimpleComp;
|
import io.xpipe.app.fxcomps.SimpleComp;
|
||||||
|
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.value.ObservableValue;
|
import javafx.beans.value.ObservableValue;
|
||||||
import javafx.scene.layout.Region;
|
import javafx.scene.layout.Region;
|
||||||
|
@ -14,18 +15,18 @@ public class StoreEntryListComp extends SimpleComp {
|
||||||
|
|
||||||
private Comp<?> createList() {
|
private Comp<?> createList() {
|
||||||
var content = new ListBoxViewComp<>(
|
var content = new ListBoxViewComp<>(
|
||||||
StoreViewState.get()
|
StoreViewState.get()
|
||||||
.getCurrentTopLevelSection()
|
.getCurrentTopLevelSection()
|
||||||
.getShownChildren()
|
.getShownChildren()
|
||||||
.getList(),
|
.getList(),
|
||||||
StoreViewState.get()
|
StoreViewState.get()
|
||||||
.getCurrentTopLevelSection()
|
.getCurrentTopLevelSection()
|
||||||
.getAllChildren()
|
.getAllChildren()
|
||||||
.getList(),
|
.getList(),
|
||||||
(StoreSection e) -> {
|
(StoreSection e) -> {
|
||||||
var custom = StoreSection.customSection(e, true).hgrow();
|
var custom = StoreSection.customSection(e, true).hgrow();
|
||||||
return custom;
|
return custom;
|
||||||
},
|
},
|
||||||
true);
|
true);
|
||||||
return content.styleClass("store-list-comp");
|
return content.styleClass("store-list-comp");
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,10 +134,12 @@ public class StoreSectionComp extends Comp<CompStructure<VBox>> {
|
||||||
section.getWrapper().getExpanded(),
|
section.getWrapper().getExpanded(),
|
||||||
section.getAllChildren().getList());
|
section.getAllChildren().getList());
|
||||||
var content = new ListBoxViewComp<>(
|
var content = new ListBoxViewComp<>(
|
||||||
listSections.getList(), section.getAllChildren().getList(), (StoreSection e) -> {
|
listSections.getList(),
|
||||||
|
section.getAllChildren().getList(),
|
||||||
|
(StoreSection e) -> {
|
||||||
return StoreSection.customSection(e, false).apply(GrowAugment.create(true, false));
|
return StoreSection.customSection(e, false).apply(GrowAugment.create(true, false));
|
||||||
},
|
},
|
||||||
false)
|
false)
|
||||||
.minHeight(0)
|
.minHeight(0)
|
||||||
.hgrow();
|
.hgrow();
|
||||||
|
|
||||||
|
@ -151,8 +153,7 @@ public class StoreSectionComp extends Comp<CompStructure<VBox>> {
|
||||||
var full = new VerticalComp(List.of(
|
var full = new VerticalComp(List.of(
|
||||||
topEntryList,
|
topEntryList,
|
||||||
Comp.separator().hide(expanded.not()),
|
Comp.separator().hide(expanded.not()),
|
||||||
content
|
content.styleClass("children-content")
|
||||||
.styleClass("children-content")
|
|
||||||
.hide(Bindings.or(
|
.hide(Bindings.or(
|
||||||
Bindings.not(section.getWrapper().getExpanded()),
|
Bindings.not(section.getWrapper().getExpanded()),
|
||||||
Bindings.size(section.getShownChildren().getList())
|
Bindings.size(section.getShownChildren().getList())
|
||||||
|
|
|
@ -9,6 +9,7 @@ import io.xpipe.app.fxcomps.impl.IconButtonComp;
|
||||||
import io.xpipe.app.fxcomps.impl.PrettyImageHelper;
|
import io.xpipe.app.fxcomps.impl.PrettyImageHelper;
|
||||||
import io.xpipe.app.fxcomps.impl.VerticalComp;
|
import io.xpipe.app.fxcomps.impl.VerticalComp;
|
||||||
import io.xpipe.app.storage.DataStoreColor;
|
import io.xpipe.app.storage.DataStoreColor;
|
||||||
|
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
@ -133,15 +134,16 @@ public class StoreSectionMiniComp extends Comp<CompStructure<VBox>> {
|
||||||
section.getAllChildren().getList())
|
section.getAllChildren().getList())
|
||||||
: section.getShownChildren();
|
: section.getShownChildren();
|
||||||
var content = new ListBoxViewComp<>(
|
var content = new ListBoxViewComp<>(
|
||||||
listSections.getList(), section.getAllChildren().getList(), (StoreSection e) -> {
|
listSections.getList(),
|
||||||
|
section.getAllChildren().getList(),
|
||||||
|
(StoreSection e) -> {
|
||||||
return new StoreSectionMiniComp(e, this.augment, this.action);
|
return new StoreSectionMiniComp(e, this.augment, this.action);
|
||||||
},
|
},
|
||||||
section.getWrapper() == null)
|
section.getWrapper() == null)
|
||||||
.minHeight(0)
|
.minHeight(0)
|
||||||
.hgrow();
|
.hgrow();
|
||||||
|
|
||||||
list.add(content
|
list.add(content.styleClass("children-content")
|
||||||
.styleClass("children-content")
|
|
||||||
.hide(Bindings.or(
|
.hide(Bindings.or(
|
||||||
Bindings.not(expanded),
|
Bindings.not(expanded),
|
||||||
Bindings.size(section.getAllChildren().getList()).isEqualTo(0))));
|
Bindings.size(section.getAllChildren().getList()).isEqualTo(0))));
|
||||||
|
|
|
@ -2,6 +2,7 @@ package io.xpipe.app.core.window;
|
||||||
|
|
||||||
import io.xpipe.app.core.App;
|
import io.xpipe.app.core.App;
|
||||||
import io.xpipe.core.process.OsType;
|
import io.xpipe.core.process.OsType;
|
||||||
|
|
||||||
import javafx.geometry.Rectangle2D;
|
import javafx.geometry.Rectangle2D;
|
||||||
import javafx.stage.Screen;
|
import javafx.stage.Screen;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
|
@ -136,7 +136,7 @@ public interface DataStoreProvider {
|
||||||
|
|
||||||
default DataStoreUsageCategory getUsageCategory() {
|
default DataStoreUsageCategory getUsageCategory() {
|
||||||
var cc = getCreationCategory();
|
var cc = getCreationCategory();
|
||||||
if (cc == DataStoreCreationCategory.SHELL || cc == DataStoreCreationCategory.HOST) {
|
if (cc == DataStoreCreationCategory.SHELL || cc == DataStoreCreationCategory.HOST) {
|
||||||
return DataStoreUsageCategory.SHELL;
|
return DataStoreUsageCategory.SHELL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,5 +233,4 @@ public interface DataStoreProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Class<?>> getStoreClasses();
|
List<Class<?>> getStoreClasses();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,21 +36,24 @@ public class DataStoreListChoiceComp<T extends DataStore> extends SimpleComp {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Region createSimple() {
|
protected Region createSimple() {
|
||||||
var list = new ListBoxViewComp<>(selectedList, selectedList, t -> {
|
var list = new ListBoxViewComp<>(
|
||||||
if (t == null) {
|
selectedList,
|
||||||
return null;
|
selectedList,
|
||||||
}
|
t -> {
|
||||||
|
if (t == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var label = new LabelComp(t.get().getName()).apply(struc -> struc.get()
|
var label = new LabelComp(t.get().getName()).apply(struc -> struc.get()
|
||||||
.setGraphic(PrettyImageHelper.ofFixedSizeSquare(
|
.setGraphic(PrettyImageHelper.ofFixedSizeSquare(
|
||||||
t.get().getProvider().getDisplayIconFileName(t.getStore()), 16)
|
t.get().getProvider().getDisplayIconFileName(t.getStore()), 16)
|
||||||
.createRegion()));
|
.createRegion()));
|
||||||
var delete = new IconButtonComp("mdal-delete_outline", () -> {
|
var delete = new IconButtonComp("mdal-delete_outline", () -> {
|
||||||
selectedList.remove(t);
|
selectedList.remove(t);
|
||||||
});
|
});
|
||||||
return new HorizontalComp(List.of(label, Comp.hspacer(), delete)).styleClass("entry");
|
return new HorizontalComp(List.of(label, Comp.hspacer(), delete)).styleClass("entry");
|
||||||
},
|
},
|
||||||
true)
|
true)
|
||||||
.padding(new Insets(0))
|
.padding(new Insets(0))
|
||||||
.apply(struc -> struc.get().setMinHeight(0))
|
.apply(struc -> struc.get().setMinHeight(0))
|
||||||
.apply(struc -> ((VBox) struc.get().getContent()).setSpacing(5));
|
.apply(struc -> ((VBox) struc.get().getContent()).setSpacing(5));
|
||||||
|
|
|
@ -113,7 +113,8 @@ public class StoreCategoryComp extends SimpleComp {
|
||||||
var l = category.getChildren()
|
var l = category.getChildren()
|
||||||
.sorted(Comparator.comparing(storeCategoryWrapper ->
|
.sorted(Comparator.comparing(storeCategoryWrapper ->
|
||||||
storeCategoryWrapper.nameProperty().getValue().toLowerCase(Locale.ROOT)));
|
storeCategoryWrapper.nameProperty().getValue().toLowerCase(Locale.ROOT)));
|
||||||
var children = new ListBoxViewComp<>(l, l, storeCategoryWrapper -> new StoreCategoryComp(storeCategoryWrapper), false);
|
var children =
|
||||||
|
new ListBoxViewComp<>(l, l, storeCategoryWrapper -> new StoreCategoryComp(storeCategoryWrapper), false);
|
||||||
|
|
||||||
var emptyBinding = Bindings.isEmpty(category.getChildren());
|
var emptyBinding = Bindings.isEmpty(category.getChildren());
|
||||||
var v = new VerticalComp(List.of(categoryButton, children.hide(emptyBinding)));
|
var v = new VerticalComp(List.of(categoryButton, children.hide(emptyBinding)));
|
||||||
|
|
|
@ -2,6 +2,7 @@ package io.xpipe.beacon.api;
|
||||||
|
|
||||||
import io.xpipe.beacon.BeaconInterface;
|
import io.xpipe.beacon.BeaconInterface;
|
||||||
import io.xpipe.core.store.StorePath;
|
import io.xpipe.core.store.StorePath;
|
||||||
|
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
|
@ -34,7 +35,6 @@ public class ConnectionInfoExchange extends BeaconInterface<ConnectionInfoExchan
|
||||||
List<@NonNull InfoResponse> infos;
|
List<@NonNull InfoResponse> infos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Jacksonized
|
@Jacksonized
|
||||||
@Builder
|
@Builder
|
||||||
@Value
|
@Value
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package io.xpipe.beacon.api;
|
package io.xpipe.beacon.api;
|
||||||
|
|
||||||
import io.xpipe.beacon.BeaconInterface;
|
import io.xpipe.beacon.BeaconInterface;
|
||||||
|
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
|
|
18
openapi.yaml
18
openapi.yaml
|
@ -6,7 +6,7 @@ info:
|
||||||
You can get started by either using this page as an API reference or alternatively import the OpenAPI definition file into your API client of choice:
|
You can get started by either using this page as an API reference or alternatively import the OpenAPI definition file into your API client of choice:
|
||||||
|
|
||||||
<a download href="/openapi.yaml" style="font-size: 20px">OpenAPI .yaml specification</a>
|
<a download href="/openapi.yaml" style="font-size: 20px">OpenAPI .yaml specification</a>
|
||||||
|
|
||||||
The XPipe application will start up an HTTP server that can be used to send requests.
|
The XPipe application will start up an HTTP server that can be used to send requests.
|
||||||
Note that this server is HTTP-only for now as it runs only on localhost. HTTPS requests are not accepted.
|
Note that this server is HTTP-only for now as it runs only on localhost. HTTPS requests are not accepted.
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ paths:
|
||||||
|
|
||||||
Note that for development you can also turn off the required authentication in the XPipe settings menu, allowing you to send unauthenticated requests.
|
Note that for development you can also turn off the required authentication in the XPipe settings menu, allowing you to send unauthenticated requests.
|
||||||
operationId: handshake
|
operationId: handshake
|
||||||
security: []
|
security: [ ]
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
|
@ -104,7 +104,7 @@ paths:
|
||||||
examples:
|
examples:
|
||||||
standard:
|
standard:
|
||||||
summary: Matched connections
|
summary: Matched connections
|
||||||
value: { "found": [ "f0ec68aa-63f5-405c-b178-9a4454556d6b"] }
|
value: { "found": [ "f0ec68aa-63f5-405c-b178-9a4454556d6b" ] }
|
||||||
'400':
|
'400':
|
||||||
$ref: '#/components/responses/BadRequest'
|
$ref: '#/components/responses/BadRequest'
|
||||||
'401':
|
'401':
|
||||||
|
@ -130,7 +130,7 @@ paths:
|
||||||
examples:
|
examples:
|
||||||
simple:
|
simple:
|
||||||
summary: Standard
|
summary: Standard
|
||||||
value: { "connections": ["f0ec68aa-63f5-405c-b178-9a4454556d6b"] }
|
value: { "connections": [ "f0ec68aa-63f5-405c-b178-9a4454556d6b" ] }
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: The query was successful. The body contains the detailed connection information.
|
description: The query was successful. The body contains the detailed connection information.
|
||||||
|
@ -141,10 +141,10 @@ paths:
|
||||||
examples:
|
examples:
|
||||||
standard:
|
standard:
|
||||||
summary: Connection information
|
summary: Connection information
|
||||||
value: { "infos": [ { "connection": "f0ec68aa-63f5-405c-b178-9a4454556d6b", "category": ["default"] ,
|
value: { "infos": [ { "connection": "f0ec68aa-63f5-405c-b178-9a4454556d6b", "category": [ "default" ] ,
|
||||||
"name": ["local machine"], "type": "local", "rawData" : {}, "usageCategory" : "shell",
|
"name": [ "local machine" ], "type": "local", "rawData": { }, "usageCategory": "shell",
|
||||||
"lastUsed" : "2024-05-31T11:53:02.408504600Z", "lastModified" : "2024-06-23T21:15:25.608097Z",
|
"lastUsed": "2024-05-31T11:53:02.408504600Z", "lastModified": "2024-06-23T21:15:25.608097Z",
|
||||||
"state": {} } ] }
|
"state": { } } ] }
|
||||||
'400':
|
'400':
|
||||||
$ref: '#/components/responses/BadRequest'
|
$ref: '#/components/responses/BadRequest'
|
||||||
'401':
|
'401':
|
||||||
|
@ -738,4 +738,4 @@ components:
|
||||||
scheme: bearer
|
scheme: bearer
|
||||||
description: The bearer token used is the session token that you receive from the handshake exchange.
|
description: The bearer token used is the session token that you receive from the handshake exchange.
|
||||||
security:
|
security:
|
||||||
- bearerAuth: []
|
- bearerAuth: [ ]
|
||||||
|
|
Loading…
Reference in a new issue