Small fixes [stage]

This commit is contained in:
crschnick 2024-08-18 11:24:14 +00:00
parent b5471e52d1
commit 7e3ac0cf2c
6 changed files with 13 additions and 10 deletions

View file

@ -136,7 +136,7 @@ public final class BrowserFileListComp extends SimpleComp {
table.setFixedCellSize(32.0); table.setFixedCellSize(32.0);
var os = fileList.getFileSystemModel().getFileSystem().getShell().orElseThrow().getOsType(); var os = fileList.getFileSystemModel().getFileSystem().getShell().orElseThrow().getOsType();
table.widthProperty().subscribe((newValue) -> { table.widthProperty().subscribe((newValue) -> {
if (os != OsType.WINDOWS) { if (os != OsType.WINDOWS && os != OsType.MACOS) {
ownerCol.setVisible(newValue.doubleValue() > 1000); ownerCol.setVisible(newValue.doubleValue() > 1000);
} }
var width = getFilenameWidth(table); var width = getFilenameWidth(table);
@ -441,7 +441,7 @@ public final class BrowserFileListComp extends SimpleComp {
if (fileList.getFileSystemModel().getFileSystem() != null) { if (fileList.getFileSystemModel().getFileSystem() != null) {
var shell = fileList.getFileSystemModel().getFileSystem().getShell().orElseThrow(); var shell = fileList.getFileSystemModel().getFileSystem().getShell().orElseThrow();
if (OsType.WINDOWS.equals(shell.getOsType())) { if (OsType.WINDOWS.equals(shell.getOsType()) || OsType.MACOS.equals(shell.getOsType())) {
modeCol.setVisible(false); modeCol.setVisible(false);
ownerCol.setVisible(false); ownerCol.setVisible(false);
} else { } else {

View file

@ -47,20 +47,20 @@ public class OpenFileSystemCache extends ShellControlCache {
var lines = sc.command(CommandBuilder.of().add("cat").addFile("/etc/passwd")).readStdoutOrThrow(); var lines = sc.command(CommandBuilder.of().add("cat").addFile("/etc/passwd")).readStdoutOrThrow();
lines.lines().forEach(s -> { lines.lines().forEach(s -> {
var split = s.split(":"); var split = s.split(":");
users.put(Integer.parseInt(split[2]), split[0]); users.putIfAbsent(Integer.parseInt(split[2]), split[0]);
}); });
} }
private void loadGroups() throws Exception { private void loadGroups() throws Exception {
var sc = model.getFileSystem().getShell().orElseThrow(); var sc = model.getFileSystem().getShell().orElseThrow();
if (sc.getOsType() == OsType.WINDOWS) { if (sc.getOsType() == OsType.WINDOWS || sc.getOsType() == OsType.MACOS) {
return; return;
} }
var lines = sc.command(CommandBuilder.of().add("cat").addFile("/etc/group")).readStdoutOrThrow(); var lines = sc.command(CommandBuilder.of().add("cat").addFile("/etc/group")).readStdoutOrThrow();
lines.lines().forEach(s -> { lines.lines().forEach(s -> {
var split = s.split(":"); var split = s.split(":");
groups.put(Integer.parseInt(split[2]), split[0]); groups.putIfAbsent(Integer.parseInt(split[2]), split[0]);
}); });
} }

View file

@ -42,6 +42,7 @@ Up until now, if you added a connection that always allocated pty, XPipe would c
- Fix script enabled status being wrong after editing an enabled script - Fix script enabled status being wrong after editing an enabled script
- Fix download move operation failing when moving a directory that already existed in the downloads folder - Fix download move operation failing when moving a directory that already existed in the downloads folder
- Fix some scrollbars are necessarily showing - Fix some scrollbars are necessarily showing
- There is now support to view and change users/groups in the file browser
- External git vault data files are now also encrypted by default - External git vault data files are now also encrypted by default
- Rework state information display for proxmox VMs - Rework state information display for proxmox VMs
- Automatically fill identity file for ssh config wildcard keys as well - Automatically fill identity file for ssh config wildcard keys as well

View file

@ -33,13 +33,14 @@ public class ChgrpAction implements BranchAction {
@Override @Override
public boolean isApplicable(OpenFileSystemModel model, List<BrowserEntry> entries) { public boolean isApplicable(OpenFileSystemModel model, List<BrowserEntry> entries) {
return model.getFileSystem().getShell().orElseThrow().getOsType() != OsType.WINDOWS; var os = model.getFileSystem().getShell().orElseThrow().getOsType();
return os != OsType.WINDOWS && os != OsType.MACOS;
} }
@Override @Override
public List<LeafAction> getBranchingActions(OpenFileSystemModel model, List<BrowserEntry> entries) { public List<LeafAction> getBranchingActions(OpenFileSystemModel model, List<BrowserEntry> entries) {
return model.getCache().getGroups().entrySet().stream() return model.getCache().getGroups().entrySet().stream()
.filter(e -> !e.getValue().equals("nogroup") && (e.getKey().equals(0) || e.getKey() >= 1000)) .filter(e -> !e.getValue().equals("nohome") && !e.getValue().equals("nogroup") && !e.getValue().equals("nobody") && (e.getKey().equals(0) || e.getKey() >= 1000))
.map(e -> e.getValue()).map(s -> (LeafAction) new Chgrp(s)).toList(); .map(e -> e.getValue()).map(s -> (LeafAction) new Chgrp(s)).toList();
} }

View file

@ -33,13 +33,14 @@ public class ChownAction implements BranchAction {
@Override @Override
public boolean isApplicable(OpenFileSystemModel model, List<BrowserEntry> entries) { public boolean isApplicable(OpenFileSystemModel model, List<BrowserEntry> entries) {
return model.getFileSystem().getShell().orElseThrow().getOsType() != OsType.WINDOWS; var os = model.getFileSystem().getShell().orElseThrow().getOsType();
return os != OsType.WINDOWS && os != OsType.MACOS;
} }
@Override @Override
public List<LeafAction> getBranchingActions(OpenFileSystemModel model, List<BrowserEntry> entries) { public List<LeafAction> getBranchingActions(OpenFileSystemModel model, List<BrowserEntry> entries) {
return model.getCache().getUsers().entrySet().stream() return model.getCache().getUsers().entrySet().stream()
.filter(e -> !e.getValue().equals("nobody") && (e.getKey().equals(0) || e.getKey() >= 1000)) .filter(e -> !e.getValue().equals("nohome") && !e.getValue().equals("nobody") && (e.getKey().equals(0) || e.getKey() >= 1000))
.map(e -> e.getValue()).map(s -> (LeafAction) new Chown(s)).toList(); .map(e -> e.getValue()).map(s -> (LeafAction) new Chown(s)).toList();
} }

View file

@ -1 +1 @@
11.0-11 11.0-12