mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-23 09:46:36 +00:00
Tailscale work
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package io.xpipe.app.ext;
|
||||
|
||||
import io.xpipe.app.core.AppI18n;
|
||||
import io.xpipe.app.issue.ErrorEvent;
|
||||
import io.xpipe.app.storage.DataStoreEntryRef;
|
||||
import io.xpipe.core.store.DataStore;
|
||||
import io.xpipe.core.util.FailableConsumer;
|
||||
import io.xpipe.core.util.ModuleLayerLoader;
|
||||
|
||||
import javafx.beans.value.ObservableValue;
|
||||
@@ -130,6 +132,49 @@ public interface ActionProvider {
|
||||
|
||||
interface LeafDataStoreCallSite<T extends DataStore> extends DataStoreCallSite<T> {
|
||||
|
||||
default ActionProvider provider() {
|
||||
return new ActionProvider() {
|
||||
@Override
|
||||
public LeafDataStoreCallSite<?> getLeafDataStoreCallSite() {
|
||||
return LeafDataStoreCallSite.this;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static <T extends DataStore> LeafDataStoreCallSite<T> simple(boolean major, String nameKey, String icon, Class<T> applicableClass, FailableConsumer<DataStoreEntryRef<T>, Exception> action) {
|
||||
return new LeafDataStoreCallSite<T>() {
|
||||
@Override
|
||||
public boolean isMajor(DataStoreEntryRef<T> o) {
|
||||
return major;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Action createAction(DataStoreEntryRef<T> store) {
|
||||
return new Action() {
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
action.accept(store);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObservableValue<String> getName(DataStoreEntryRef<T> store) {
|
||||
return AppI18n.observable(nameKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIcon(DataStoreEntryRef<T> store) {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getApplicableClass() {
|
||||
return applicableClass;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
default boolean canLinkTo() {
|
||||
return false;
|
||||
}
|
||||
@@ -149,6 +194,10 @@ public interface ActionProvider {
|
||||
.map(actionProviderProvider -> actionProviderProvider.get())
|
||||
.toList());
|
||||
|
||||
for (var p : DataStoreProviders.getAll()) {
|
||||
ALL.addAll(p.getActionProviders());
|
||||
}
|
||||
|
||||
var menuProviders = ALL.stream()
|
||||
.map(actionProvider -> actionProvider.getBranchDataStoreCallSite() != null
|
||||
&& !actionProvider
|
||||
|
||||
@@ -234,4 +234,8 @@ public interface DataStoreProvider {
|
||||
String getId();
|
||||
|
||||
List<Class<?>> getStoreClasses();
|
||||
|
||||
default List<ActionProvider> getActionProviders() {
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 27.7.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.2;enable-background:new ;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M65.6,127.7c35.3,0,63.9-28.6,63.9-63.9S100.9,0,65.6,0S1.8,28.6,1.8,63.9S30.4,127.7,65.6,127.7z"/>
|
||||
<path d="M65.6,318.1c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9S1.8,219,1.8,254.2S30.4,318.1,65.6,318.1z"/>
|
||||
<path class="st0" d="M65.6,512c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9S1.8,412.9,1.8,448.1S30.4,512,65.6,512z"/>
|
||||
<path d="M257.2,318.1c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9c-35.3,0-63.9,28.6-63.9,63.9S221.9,318.1,257.2,318.1z"/>
|
||||
<path d="M257.2,512c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9c-35.3,0-63.9,28.6-63.9,63.9S221.9,512,257.2,512z"/>
|
||||
<path class="st0" d="M257.2,127.7c35.3,0,63.9-28.6,63.9-63.9S292.5,0,257.2,0c-35.3,0-63.9,28.6-63.9,63.9
|
||||
S221.9,127.7,257.2,127.7z"/>
|
||||
<path class="st0" d="M446.4,127.7c35.3,0,63.9-28.6,63.9-63.9S481.6,0,446.4,0c-35.3,0-63.9,28.6-63.9,63.9
|
||||
S411.1,127.7,446.4,127.7z"/>
|
||||
<path d="M446.4,318.1c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9c-35.3,0-63.9,28.6-63.9,63.9S411.1,318.1,446.4,318.1z"/>
|
||||
<path class="st0" d="M446.4,512c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9c-35.3,0-63.9,28.6-63.9,63.9
|
||||
S411.1,512,446.4,512z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 27.7.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.2;fill:#CCCAC9;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M65.6,127.7c35.3,0,63.9-28.6,63.9-63.9S100.9,0,65.6,0S1.8,28.6,1.8,63.9S30.4,127.7,65.6,127.7z"/>
|
||||
<path class="st1" d="M65.6,318.1c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9S1.8,219,1.8,254.2S30.4,318.1,65.6,318.1z"/>
|
||||
<path class="st0" d="M65.6,512c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9S1.8,412.9,1.8,448.1S30.4,512,65.6,512z"/>
|
||||
<path class="st1" d="M257.2,318.1c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9s-63.9,28.6-63.9,63.9S221.9,318.1,257.2,318.1
|
||||
z"/>
|
||||
<path class="st1" d="M257.2,512c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9s-63.9,28.6-63.9,63.9S221.9,512,257.2,512z"/>
|
||||
<path class="st0" d="M257.2,127.7c35.3,0,63.9-28.6,63.9-63.9S292.5,0,257.2,0s-63.9,28.6-63.9,63.9S221.9,127.7,257.2,127.7z"/>
|
||||
<path class="st0" d="M446.4,127.7c35.3,0,63.9-28.6,63.9-63.9S481.6,0,446.4,0c-35.3,0-63.9,28.6-63.9,63.9
|
||||
S411.1,127.7,446.4,127.7z"/>
|
||||
<path class="st1" d="M446.4,318.1c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9s-63.9,28.6-63.9,63.9S411.1,318.1,446.4,318.1
|
||||
z"/>
|
||||
<path class="st0" d="M446.4,512c35.3,0,63.9-28.6,63.9-63.9s-28.6-63.9-63.9-63.9s-63.9,28.6-63.9,63.9S411.1,512,446.4,512z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -99,3 +99,4 @@ ghostty=Ghostty
|
||||
http=HTTP
|
||||
https=HTTPS
|
||||
servicePort=Port $PORT$
|
||||
tailscaleNodeScan=Tailscale
|
||||
|
||||
Reference in New Issue
Block a user