diff --git a/client/web/admin/src/components/Apigw/CRouteList.vue b/client/web/admin/src/components/Apigw/CRouteList.vue index ac97be58b8..43e1e24407 100644 --- a/client/web/admin/src/components/Apigw/CRouteList.vue +++ b/client/web/admin/src/components/Apigw/CRouteList.vue @@ -35,7 +35,9 @@ }" class="h-100" + clickable @search="filterList" + @row-clicked="handleRowClicked" > - diff --git a/client/web/admin/src/components/CTheMainNav.vue b/client/web/admin/src/components/CTheMainNav.vue index 23d651aecd..dd158e3a2b 100644 --- a/client/web/admin/src/components/CTheMainNav.vue +++ b/client/web/admin/src/components/CTheMainNav.vue @@ -22,6 +22,7 @@ + diff --git a/client/web/admin/src/components/faIcons.js b/client/web/admin/src/components/faIcons.js index 2fabce2cb1..9c37890424 100644 --- a/client/web/admin/src/components/faIcons.js +++ b/client/web/admin/src/components/faIcons.js @@ -47,6 +47,7 @@ import { faQuestion, faStamp, faInfoCircle, + faEllipsisV, } from '@fortawesome/free-solid-svg-icons' import { @@ -111,4 +112,5 @@ library.add( faQuestion, faStamp, faInfoCircle, + faEllipsisV, ) diff --git a/client/web/admin/src/mixins/listHelpers.js b/client/web/admin/src/mixins/listHelpers.js index f95609b566..cd449a7750 100644 --- a/client/web/admin/src/mixins/listHelpers.js +++ b/client/web/admin/src/mixins/listHelpers.js @@ -197,5 +197,39 @@ export default { genericRowClass (item) { return { 'text-secondary': item && !!item.deletedAt } }, + + handleRowClicked (item) { + this.$router.push({ name: this.editRoute, params: { [this.primaryKey]: item[this.primaryKey] } }) + }, + + handleItemDelete ({ resource, resourceName, locale, api = 'system' }) { + this.incLoader() + const { deletedAt = '' } = resource + const method = deletedAt ? `${resourceName}Undelete` : `${resourceName}Delete` + const event = deletedAt ? 'undelete' : 'delete' + const toastLocale = locale || resourceName + const API = api === 'system' ? this.$SystemAPI : this.$AutomationAPI + + API[method](resource) + .then(() => { + this.toastSuccess(this.$t(`notification:${toastLocale}.${event}.success`)) + this.filterList() + }) + .catch(this.toastErrorHandler(this.$t(`notification:${toastLocale}.${event}.error`))) + .finally(() => { + this.decLoader() + }) + }, + + areActionsVisible ({ resource, conditions = [] }) { + const condition = conditions.some(c => { + if (!resource[c]) { + return false + } + + return true + }) + return condition + }, }, } diff --git a/client/web/admin/src/views/Automation/Session/List.vue b/client/web/admin/src/views/Automation/Session/List.vue index d6fb4a386d..ffd186dafa 100644 --- a/client/web/admin/src/views/Automation/Session/List.vue +++ b/client/web/admin/src/views/Automation/Session/List.vue @@ -26,10 +26,12 @@ resourceSingle: $t('general:label.session.single'), resourcePlural: $t('general:label.session.plural') }" + clickable sticky-header hide-search hide-total class="custom-resource-list-height-no-buttons" + @row-clicked="handleRowClicked" >