fix: auto-switch sidebar to SFTP on SSH connect + credential debug logging
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m4s
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 1m4s
Sidebar automatically switches from Connections to SFTP tab when an SSH session becomes active. Added slog debug output to ConnectSSH showing credentialID, vault state, and loaded credential details to diagnose pubkey auth failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
999f8f0539
commit
9338fef0c2
@ -211,7 +211,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted } from "vue";
|
||||
import { ref, watch, onMounted, onUnmounted } from "vue";
|
||||
import { Call, Application } from "@wailsio/runtime";
|
||||
import { useAppStore } from "@/stores/app.store";
|
||||
import { useConnectionStore } from "@/stores/connection.store";
|
||||
@ -247,6 +247,13 @@ const sidebarWidth = ref(240);
|
||||
const sidebarTab = ref<SidebarTab>("connections");
|
||||
const quickConnectInput = ref("");
|
||||
|
||||
// Auto-switch to SFTP tab when an SSH session becomes active
|
||||
watch(() => sessionStore.activeSession, (session) => {
|
||||
if (session && session.protocol === "ssh") {
|
||||
sidebarTab.value = "sftp";
|
||||
}
|
||||
});
|
||||
|
||||
/** Currently open file in the editor panel (null = no file open). */
|
||||
const editorFile = ref<{ content: string; path: string; sessionId: string } | null>(null);
|
||||
|
||||
|
||||
@ -261,11 +261,19 @@ func (a *WraithApp) ConnectSSH(connectionID int64, cols, rows int) (string, erro
|
||||
var authMethods []gossh.AuthMethod
|
||||
username := "root" // default
|
||||
|
||||
slog.Info("ConnectSSH resolving auth",
|
||||
"connectionID", connectionID,
|
||||
"host", conn.Hostname,
|
||||
"credentialID", conn.CredentialID,
|
||||
"vaultUnlocked", a.Credentials != nil,
|
||||
)
|
||||
|
||||
if conn.CredentialID != nil && a.Credentials != nil {
|
||||
cred, err := a.Credentials.GetCredential(*conn.CredentialID)
|
||||
if err != nil {
|
||||
slog.Warn("failed to load credential", "id", *conn.CredentialID, "error", err)
|
||||
} else {
|
||||
slog.Info("credential loaded", "name", cred.Name, "type", cred.Type, "username", cred.Username, "sshKeyID", cred.SSHKeyID)
|
||||
if cred.Username != "" {
|
||||
username = cred.Username
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user