feat: implement comprehensive SSH credentials management system
- Add complete SSH credentials CRUD operations with AES-256 encryption - Implement database migration system for schema versioning - Create modern UI with Zinc theme for credentials management - Add credential viewer and editor with responsive design - Support password and SSH key authentication methods - Include usage tracking and folder organization - Enhance sidebar width and improve page spacing - Add comprehensive i18n support (EN/ZH) - Integrate with existing SSH host management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+77
-1
@@ -1024,7 +1024,7 @@ export async function getReleasesRSS(perPage: number = 100): Promise<any> {
|
||||
|
||||
export async function getVersionInfo(): Promise<any> {
|
||||
try {
|
||||
const response = await authApi.get('/version/');
|
||||
const response = await authApi.get('/version');
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, 'fetch version info');
|
||||
@@ -1042,4 +1042,80 @@ export async function getDatabaseHealth(): Promise<any> {
|
||||
} catch (error) {
|
||||
handleApiError(error, 'check database health');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// SSH CREDENTIALS MANAGEMENT
|
||||
// ============================================================================
|
||||
|
||||
export async function getCredentials(): Promise<any> {
|
||||
try {
|
||||
const response = await authApi.get('/credentials');
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, 'fetch credentials');
|
||||
}
|
||||
}
|
||||
|
||||
export async function getCredentialDetails(credentialId: number): Promise<any> {
|
||||
try {
|
||||
const response = await authApi.get(`/credentials/${credentialId}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, 'fetch credential details');
|
||||
}
|
||||
}
|
||||
|
||||
export async function createCredential(credentialData: any): Promise<any> {
|
||||
try {
|
||||
const response = await authApi.post('/credentials', credentialData);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, 'create credential');
|
||||
}
|
||||
}
|
||||
|
||||
export async function updateCredential(credentialId: number, credentialData: any): Promise<any> {
|
||||
try {
|
||||
const response = await authApi.put(`/credentials/${credentialId}`, credentialData);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, 'update credential');
|
||||
}
|
||||
}
|
||||
|
||||
export async function deleteCredential(credentialId: number): Promise<any> {
|
||||
try {
|
||||
const response = await authApi.delete(`/credentials/${credentialId}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, 'delete credential');
|
||||
}
|
||||
}
|
||||
|
||||
export async function getCredentialHosts(credentialId: number): Promise<any> {
|
||||
try {
|
||||
const response = await authApi.get(`/credentials/${credentialId}/hosts`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, 'fetch credential hosts');
|
||||
}
|
||||
}
|
||||
|
||||
export async function getCredentialFolders(): Promise<any> {
|
||||
try {
|
||||
const response = await authApi.get('/credentials/folders');
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, 'fetch credential folders');
|
||||
}
|
||||
}
|
||||
|
||||
export async function applyCredentialToHost(credentialId: number, hostId: number): Promise<any> {
|
||||
try {
|
||||
const response = await authApi.post(`/credentials/${credentialId}/apply-to-host/${hostId}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, 'apply credential to host');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user