mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-29 03:45:43 +00:00
Rework network ports
This commit is contained in:
@@ -93,7 +93,7 @@ public class StoreSectionConfig {
|
||||
&& (selector.excludeNonShown() || !matchesSelector)) {
|
||||
var showProvider = true;
|
||||
try {
|
||||
showProvider = section.getEntry().getProvider().shouldShow(section.getWrapper());
|
||||
showProvider = section.getEntry().getProvider().shouldShow(section);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (!showProvider) {
|
||||
|
||||
@@ -97,7 +97,7 @@ public interface DataStoreProvider {
|
||||
return true;
|
||||
}
|
||||
|
||||
default boolean shouldShow(StoreEntryWrapper w) {
|
||||
default boolean shouldShow(StoreSection section) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public interface ShellStore extends DataStore, FileSystemStore, ValidatableStore
|
||||
stopSessionIfNeeded();
|
||||
} else {
|
||||
existingSession.getShellControl().waitForSubShellExit();
|
||||
return new StubShellControl(existingSession.getShellControl());
|
||||
return existingSession.getShellControl();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,13 +32,13 @@ public interface ShellStore extends DataStore, FileSystemStore, ValidatableStore
|
||||
// Then, the cache returns null
|
||||
// getSession()
|
||||
|
||||
return new StubShellControl(session.getShellControl());
|
||||
return session.getShellControl();
|
||||
}
|
||||
|
||||
@Override
|
||||
default ShellSession newSession() {
|
||||
var func = shellFunction();
|
||||
var session = new ShellSession(() -> func.control());
|
||||
var session = new ShellSession(() -> new StubShellControl(func.control()));
|
||||
session.addListener(this);
|
||||
return session;
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ public class IncusContainerStoreProvider implements ShellStoreProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldShow(StoreEntryWrapper w) {
|
||||
IncusContainerStore s = w.getEntry().getStore().asNeeded();
|
||||
public boolean shouldShow(StoreSection section) {
|
||||
IncusContainerStore s = section.getEntry().getStore().asNeeded();
|
||||
var state = s.getState();
|
||||
return Boolean.TRUE.equals(state.getRunning())
|
||||
|| s.getInstall().getStore().getState().isShowNonRunning();
|
||||
|
||||
@@ -37,8 +37,8 @@ public class LxdContainerStoreProvider implements ShellStoreProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldShow(StoreEntryWrapper w) {
|
||||
LxdContainerStore s = w.getEntry().getStore().asNeeded();
|
||||
public boolean shouldShow(StoreSection section) {
|
||||
LxdContainerStore s = section.getEntry().getStore().asNeeded();
|
||||
var state = s.getState();
|
||||
return Boolean.TRUE.equals(state.getRunning())
|
||||
|| s.getCmd().getStore().getState().isShowNonRunning();
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ public class PodmanContainerStoreProvider implements ShellStoreProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldShow(StoreEntryWrapper w) {
|
||||
PodmanContainerStore s = w.getEntry().getStore().asNeeded();
|
||||
public boolean shouldShow(StoreSection section) {
|
||||
PodmanContainerStore s = section.getEntry().getStore().asNeeded();
|
||||
var state = s.getState();
|
||||
return Boolean.TRUE.equals(state.getRunning())
|
||||
|| s.getCmd() == null
|
||||
|
||||
Reference in New Issue
Block a user