diff --git a/dashboard/src/components/ApiTokens.vue b/dashboard/src/components/ApiTokens.vue index ed4aa3aa9..33c6f9bbd 100644 --- a/dashboard/src/components/ApiTokens.vue +++ b/dashboard/src/components/ApiTokens.vue @@ -43,35 +43,23 @@

- - - - - - - - - - - - - - - - - - - - -
{{ $t('profile.apiTokens.name') }}{{ $t('profile.apiTokens.lastUsed') }}{{ $t('profile.apiTokens.scope') }}{{ $t('main.actions') }}
{{ $t('profile.apiTokens.noTokensPlaceholder') }}
{{ token.name || 'unnamed' }} - {{ prettyLongDate(token.lastUsedTime) }} - {{ $t('profile.apiTokens.neverUsed') }} - - {{ $t('profile.apiTokens.readwrite') }} - {{ $t('profile.apiTokens.readonly') }} - -
+
+ + + + + + @@ -84,8 +72,9 @@ import { useI18n } from 'vue-i18n'; const i18n = useI18n(); const t = i18n.t; +import moment from 'moment'; import { ref, onMounted, computed, useTemplateRef } from 'vue'; -import { Button, Dialog, InputDialog, FormGroup, Radiobutton, TextInput } from 'pankow'; +import { Button, Dialog, InputDialog, FormGroup, Radiobutton, TableView, TextInput } from 'pankow'; import { copyToClipboard, prettyLongDate } from 'pankow/utils'; import { TOKEN_TYPES } from '../constants.js'; import Section from './Section.vue'; @@ -99,6 +88,25 @@ const newDialog = useTemplateRef('newDialog'); const addedToken = ref(''); const tokenName = ref(''); const tokenScope = ref('r'); +const columns = { + name: { + label: t('profile.apiTokens.name'), + sort: true + }, + lastUsedTime: { + label: t('profile.apiTokens.lastUsed'), + sort(a, b) { + if (!a) return 1; + if (!b) return -1; + return moment(a).isBefore(b) ? 1 : -1; + } + }, + scope: { + label: t('profile.apiTokens.scope'), + sort: true + }, + actions: {} +}; const isValid = computed(() => { if (!tokenName.value) return false; diff --git a/dashboard/src/components/AppPasswords.vue b/dashboard/src/components/AppPasswords.vue index fc06480f7..6aadee49b 100644 --- a/dashboard/src/components/AppPasswords.vue +++ b/dashboard/src/components/AppPasswords.vue @@ -42,29 +42,16 @@

{{ $t('profile.appPasswords.description') }}

- - - - - - - - - - - - - - - - - - - - -
{{ $t('profile.appPasswords.name') }}{{ $t('profile.appPasswords.app') }}{{ $t('main.table.date') }}{{ $t('main.actions') }}
{{ $t('profile.appPasswords.noPasswordsPlaceholder') }}
{{ password.name }}{{ password.label }}{{ prettyLongDate(password.creationTime) }} -
+
+ + + + + @@ -77,8 +64,9 @@ import { useI18n } from 'vue-i18n'; const i18n = useI18n(); const t = i18n.t; +import moment from 'moment'; import { ref, onMounted, useTemplateRef, computed } from 'vue'; -import { Button, Dialog, Dropdown, FormGroup, TextInput, InputDialog } from 'pankow'; +import { Button, Dialog, Dropdown, FormGroup, TextInput, TableView, InputDialog } from 'pankow'; import { prettyLongDate, copyToClipboard } from 'pankow/utils'; import Section from './Section.vue'; import AppPasswordsModel from '../models/AppPasswordsModel.js'; @@ -90,6 +78,25 @@ const appsModel = AppsModel.create(API_ORIGIN, localStorage.token); const newDialog = useTemplateRef('newDialog'); const inputDialog = useTemplateRef('inputDialog'); const passwords = ref([]); +const columns = { + name: { + label: t('profile.appPasswords.name'), + sort: true + }, + label: { + label: t('profile.appPasswords.app'), + sort: true + }, + creationTime: { + label: t('main.table.date'), + sort(a, b) { + if (!a) return 1; + if (!b) return -1; + return moment(a).isBefore(b) ? 1 : -1; + } + }, + actions: {} +}; // new dialog props const addedPassword = ref(''); @@ -152,7 +159,7 @@ function onCopyToClipboard(password) { async function onRemove(id) { const yes = await inputDialog.value.confirm({ - message: 'Really remove this token?', // TODO translate + message: 'Really remove this password?', // TODO translate modal: true, confirmStyle: 'danger', confirmLabel: t('main.dialog.yes'), diff --git a/dashboard/src/components/VolumesView.vue b/dashboard/src/components/VolumesView.vue index b4c9bd3e0..474ff78fa 100644 --- a/dashboard/src/components/VolumesView.vue +++ b/dashboard/src/components/VolumesView.vue @@ -96,7 +96,7 @@