diff --git a/frontend/src/views/ConnectionsView.vue b/frontend/src/views/ConnectionsView.vue index b79b120..0db37ae 100644 --- a/frontend/src/views/ConnectionsView.vue +++ b/frontend/src/views/ConnectionsView.vue @@ -101,6 +101,16 @@ function openSftp(conn: Connection) { function clearSearch() { searchQuery.value = '' updateSearchParam('') +} + +function highlightMatch(text: string): string { + const q = keyword.value.trim() + if (!q) return text + + const escaped = q.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + const regex = new RegExp(escaped, 'gi') + + return text.replace(regex, (match) => `${match}`) } @@ -175,8 +185,8 @@ function clearSearch() {
{{ conn.username }}@{{ conn.host }}:{{ conn.port }}
+ +