Implement background worker to make search response faster and avoid hanging the UI when there are a lot of files. Implement better toast messages for transitional events that automatically disappear.

This commit is contained in:
Leo Vasanko
2026-01-31 21:02:16 +00:00
parent 1e74245721
commit 40fb7bf398
8 changed files with 305 additions and 41 deletions
@@ -93,7 +93,7 @@ const loadUsers = async () => {
users.value = data.users
} catch (e) {
const httpError = e as ISimpleError
store.error = httpError.message || 'Failed to load users'
store.showToast(httpError.message || 'Failed to load users')
} finally {
loading.value = false
}
@@ -111,7 +111,7 @@ const addUser = async () => {
}
} catch (e) {
const httpError = e as ISimpleError
store.error = httpError.message || 'Failed to add user'
store.showToast(httpError.message || 'Failed to add user')
}
}
@@ -122,7 +122,7 @@ const toggleAdmin = async (user: User, event: Event) => {
user.privileged = target.checked
} catch (e) {
const httpError = e as ISimpleError
store.error = httpError.message || 'Failed to update user'
store.showToast(httpError.message || 'Failed to update user')
target.checked = user.privileged // revert
}
}
@@ -142,7 +142,7 @@ const renameUser = async (user: User) => {
}
} catch (e) {
const httpError = e as ISimpleError
store.error = httpError.message || 'Failed to rename user'
store.showToast(httpError.message || 'Failed to rename user')
}
}
@@ -156,7 +156,7 @@ const resetPassword = async (user: User) => {
}
} catch (e) {
const httpError = e as ISimpleError
store.error = httpError.message || 'Failed to reset password'
store.showToast(httpError.message || 'Failed to reset password')
}
}
@@ -167,7 +167,7 @@ const deleteUserAction = async (username: string) => {
await loadUsers()
} catch (e) {
const httpError = e as ISimpleError
store.error = httpError.message || 'Failed to delete user'
store.showToast(httpError.message || 'Failed to delete user')
}
}
@@ -202,7 +202,7 @@ const updateServerSettings = async () => {
success.value = 'Server settings updated'
} catch (e) {
const httpError = e as ISimpleError
store.error = httpError.message || 'Failed to update settings'
store.showToast(httpError.message || 'Failed to update settings')
}
}