Skip to content

Commit

Permalink
fix: minor improvements to nat helpers ui (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
andre8244 authored Sep 12, 2024
1 parent e63c8e5 commit 7c6fbf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/components/standalone/firewall/nat/NatHelpers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import {
NeHeading,
NeInlineNotification,
NeTextInput,
getAxiosErrorMessage,
sortByProperty
getAxiosErrorMessage
} from '@nethesis/vue-components'
import { computed, onMounted, ref } from 'vue'
import { type NatHelper } from '@/stores/standalone/firewall'
Expand Down Expand Up @@ -63,9 +62,7 @@ async function listNatHelpers() {

try {
const res = await ubusCall('ns.nathelpers', 'list-nat-helpers')
const natHelpersList = res.data.values
// sort by status
natHelpers.value = natHelpersList.sort(sortByProperty('enabled')).reverse()
natHelpers.value = res.data.values
} catch (err: any) {
console.error(err)
error.value.listNatHelpers = t(getAxiosErrorMessage(err))
Expand Down
2 changes: 1 addition & 1 deletion src/components/standalone/firewall/nat/NatHelpersTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const { currentPage, paginatedItems } = useItemPagination(() => props.filteredNa
<div class="flex items-center gap-2">
<font-awesome-icon
:icon="['fas', item.enabled ? 'circle-check' : 'circle-xmark']"
class="h-4 w-4"
:class="['h-4 w-4', { 'text-green-600 dark:text-green-400': item.enabled }]"
aria-hidden="true"
/>
{{ item.enabled ? t('common.enabled') : t('common.disabled') }}
Expand Down

0 comments on commit 7c6fbf4

Please sign in to comment.