Skip to content

Commit

Permalink
Add empty table to all tables
Browse files Browse the repository at this point in the history
  • Loading branch information
NHAS committed Nov 23, 2024
1 parent e035cee commit 314331e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions adminui/frontend/src/pages/Devices.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useDevicesStore } from '@/stores/devices'
import { Icons } from '@/util/icons'
import { deleteDevices, editDevice, DeviceEditActions, type EditDevicesDTO, type DeviceDTO } from '@/api'
import EmptyTable from '@/components/EmptyTable.vue'
const devicesStore = useDevicesStore()
devicesStore.load(false)
Expand Down Expand Up @@ -190,6 +191,7 @@ function sortDevices(by: keyof DeviceDTO) {
</tr>
</tbody>
</table>
<EmptyTable v-if="currentDevices.length == 0" text="No matching devices" />

<div class="mt-2 w-full text-center">
<PaginationControls @next="() => nextPage()" @prev="() => prevPage()" :current-page="activePage"
Expand Down
2 changes: 2 additions & 0 deletions adminui/frontend/src/pages/Groups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ async function tryDeleteGroups(groups: string[]) {
</tr>
</tbody>
</table>
<EmptyTable v-if="currentGroups.length == 0" text="No groups" />


<div class="mt-2 w-full text-center">
<PaginationControls @next="() => nextPage()" @prev="() => prevPage()" :current-page="activePage" :total-pages="totalPages" />
Expand Down
2 changes: 2 additions & 0 deletions adminui/frontend/src/pages/RegistrationTokens.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useTokensStore } from '@/stores/registration_tokens'
import { Icons } from '@/util/icons'
import type { RegistrationTokenRequestDTO } from '@/api'
import EmptyTable from '@/components/EmptyTable.vue'
const tokensStore = useTokensStore()
tokensStore.load(true)
Expand Down Expand Up @@ -130,6 +131,7 @@ async function deleteToken(token: RegistrationTokenRequestDTO) {
</tr>
</tbody>
</table>
<EmptyTable v-if="currentTokens.length == 0" text="No registration tokens" />

<div class="mt-2 w-full text-center">
<PaginationControls @next="() => nextPage()" @prev="() => prevPage()" :current-page="activePage" :total-pages="totalPages" />
Expand Down
2 changes: 2 additions & 0 deletions adminui/frontend/src/pages/Rules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useTextareaInput } from '@/composables/useTextareaInput'
import { Icons } from '@/util/icons'
import { getAllRules, type RuleDTO, editRule, createRule, deleteRules } from '@/api'
import EmptyTable from '@/components/EmptyTable.vue'
const { data: rulesData, isLoading: isLoadingRules, silentlyRefresh: refreshRules } = useApi(() => getAllRules())
Expand Down Expand Up @@ -235,6 +236,7 @@ async function tryDeleteRules(rules: string[]) {
</tr>
</tbody>
</table>
<EmptyTable v-if="currentRules.length == 0" text="No rules" />

<div class="mt-2 w-full text-center">
<PaginationControls @next="() => nextPage()" @prev="() => prevPage()" :current-page="activePage" :total-pages="totalPages" />
Expand Down
2 changes: 2 additions & 0 deletions adminui/frontend/src/pages/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Icons } from '@/util/icons'
import { deleteUsers, editUser, UserEditActions, type EditUsersDTO, type UserDTO } from '@/api'
import { useRoute } from 'vue-router'
import EmptyTable from '@/components/EmptyTable.vue'
const usersStore = useUsersStore()
usersStore.load(false)
Expand Down Expand Up @@ -193,6 +194,7 @@ function sortUsers(by: keyof UserDTO) {
</tr>
</tbody>
</table>
<EmptyTable v-if="currentUsers.length == 0" text="No matching users" />

<div class="mt-2 w-full text-center">
<PaginationControls @next="() => nextPage()" @prev="() => prevPage()" :current-page="activePage" :total-pages="totalPages" />
Expand Down

0 comments on commit 314331e

Please sign in to comment.