feat: unify moba workspace and persist session tree layout

This commit is contained in:
liumangmang
2026-04-10 11:04:21 +08:00
parent bba36a2e12
commit f606d20000
27 changed files with 1383 additions and 426 deletions

View File

@@ -100,15 +100,17 @@ public class ConnectionService {
return ConnectionDto.fromEntity(conn);
}
@Transactional
public void delete(Long id, Long userId) {
Connection conn = connectionRepository.findById(id).orElseThrow(
() -> new RuntimeException("Connection not found: " + id));
if (!conn.getUserId().equals(userId)) {
throw new RuntimeException("Access denied");
}
connectionRepository.delete(conn);
}
@Transactional
public void delete(Long id, Long userId) {
Connection conn = connectionRepository.findById(id).orElse(null);
if (conn == null) {
return;
}
if (!conn.getUserId().equals(userId)) {
throw new RuntimeException("Access denied");
}
connectionRepository.delete(conn);
}
public Connection getConnectionForSsh(Long id, Long userId) {
Connection conn = connectionRepository.findById(id).orElseThrow(