diff --git a/packages/frontend/src/components/SendFilesModal.vue b/packages/frontend/src/components/SendFilesModal.vue
index ce037ff..602320f 100644
--- a/packages/frontend/src/components/SendFilesModal.vue
+++ b/packages/frontend/src/components/SendFilesModal.vue
@@ -56,7 +56,7 @@
-
@@ -222,6 +230,9 @@ const groupedConnections = computed(() => {
const untaggedConnections: ConnectionInfo[] = [];
allConnections.value.forEach(conn => {
+ if (conn.type?.toLowerCase() !== 'ssh') { // 首先过滤掉非 SSH 连接
+ return;
+ }
const connTagIds = conn.tag_ids || [];
if (connTagIds.length === 0) {
untaggedConnections.push(conn);
@@ -265,11 +276,12 @@ const filteredGroupedConnections = computed(() => {
return groupedConnections.value
.map(group => {
const filteredConns = group.connections.filter(conn =>
+ conn.type?.toLowerCase() === 'ssh' && // 只包括 SSH 连接
conn.name.toLowerCase().includes(lowerSearchTerm)
);
return { ...group, connections: filteredConns };
})
- .filter(group => group.connections.length > 0);
+ .filter(group => group.connections.length > 0); // 只包括仍有连接的分组
});
const isTagGroupSelected = (group: GroupedConnection): boolean => {
@@ -359,5 +371,29 @@ const handleCancel = () => {
emit('update:visible', false);
};
+const toggleIndividualConnectionSelection = (connectionId: number) => {
+ const index = selectedConnectionIds.value.indexOf(connectionId);
+ if (index > -1) {
+ selectedConnectionIds.value.splice(index, 1);
+ } else {
+ selectedConnectionIds.value.push(connectionId);
+ }
+};
+
+const getConnectionIconClass = (connectionType?: string): string => {
+ // Ensure connectionType is treated as optional and provide a default if undefined
+ const type = connectionType?.toLowerCase();
+ switch (type) {
+ case 'rdp': return 'fas fa-desktop';
+ case 'vnc': return 'fas fa-plug';
+ case 'ssh': return 'fas fa-server';
+ case 'telnet': return 'fas fa-keyboard';
+ case 'local': return 'fas fa-laptop';
+ case 'serial': return 'fas fa-microchip';
+ case 'docker': return 'fab fa-docker';
+ default: return 'fas fa-server'; // Default icon for unknown or undefined types
+ }
+};
+
// Fallback i18n messages are now removed as they are expected to be in the locale JSON files.