Skip to content

Commit

Permalink
feature(admin(vue,js)): add tenants to configuration ui, implements #…
Browse files Browse the repository at this point in the history
  • Loading branch information
satkunas committed Apr 21, 2021
1 parent b5fc76f commit 34fc882
Show file tree
Hide file tree
Showing 12 changed files with 864 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import ActiveActiveRoutes from '../activeActive/_router'
import RadiusRoutes from '../radius/_router'
import DnsRoutes from '../dns/_router'
import AdminRolesRoutes from '../adminRoles/_router'
import TenantsRoutes from '../tenants/_router'

import store from '@/store'
import BasesStoreModule from '../bases/_store'
Expand Down Expand Up @@ -168,7 +169,8 @@ const route = {
...RadiusRoutes,
...DnsRoutes,
...AdminRolesRoutes,
...SslCertificatesRoutes
...SslCertificatesRoutes,
...TenantsRoutes
]
}

Expand Down
3 changes: 2 additions & 1 deletion html/pfappserver/root/src/views/Configuration/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ export default {
},
{ name: this.$i18n.t('DNS Configuration'), path: '/configuration/dns' },
{ name: this.$i18n.t('Admin Access'), path: '/configuration/admin_roles' },
{ name: this.$i18n.t('SSL Certificates'), path: '/configuration/certificates' }
{ name: this.$i18n.t('SSL Certificates'), path: '/configuration/certificates' },
{ name: this.$i18n.t('Tenants'), path: '/configuration/tenants' }
]
}
]
Expand Down
45 changes: 45 additions & 0 deletions html/pfappserver/root/src/views/Configuration/tenants/_api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import apiCall from '@/utils/api'

export default {
list: params => {
return apiCall.get('tenants', { params }).then(response => {
return response.data
})
},
listOptions: () => {
return apiCall.options('tenants').then(response => {
return response.data
})
},
item: id => {
return apiCall.get(['tenant', id]).then(response => {
return response.data.item
})
},
itemOptions: id => {
return apiCall.options(['tenant', id]).then(response => {
return response.data
})
},
create: data => {
return apiCall.post('tenants', data).then(response => {
return response.data
})
},
update: data => {
return apiCall.patch(['tenant', data.id], data).then(response => {
return response.data
})
},
delete: id => {
return apiCall.delete(['tenant', id])
},
reassign: data => {
return apiCall.patch(['tenant', data.from, 'reassign'], { id: data.to })
},
search: data => {
return apiCall.post('tenants/search', data).then(response => {
return response.data
})
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<template>
<base-form
:form="form"
:meta="meta"
:schema="schema"
:isLoading="isLoading"
>
<form-group-identifier v-if="!isNew && !isClone"
namespace="id"
:column-label="$i18n.t('Indentifier')"
disabled
/>

<form-group-name namespace="name"
:column-label="$i18n.t('Name')"
/>

<form-group-domain-name namespace="domain_name"
:column-label="$i18n.t('Domain name')"
/>

<form-group-portal-domain-name namespace="portal_domain_name"
:column-label="$i18n.t('Portal domain name')"
/>
</base-form>
</template>
<script>
import { computed } from '@vue/composition-api'
import {
BaseForm
} from '@/components/new/'
import schemaFn from '../schema'
import {
FormGroupIdentifier,
FormGroupName,
FormGroupDomainName,
FormGroupPortalDomainName
} from './'
const components = {
BaseForm,
FormGroupIdentifier,
FormGroupName,
FormGroupDomainName,
FormGroupPortalDomainName
}
export const props = {
id: {
type: String
},
form: {
type: Object
},
meta: {
type: Object
},
isNew: {
type: Boolean,
default: false
},
isClone: {
type: Boolean,
default: false
},
isLoading: {
type: Boolean,
default: false
}
}
export const setup = (props) => {
const schema = computed(() => schemaFn(props))
return {
schema
}
}
// @vue/component
export default {
name: 'the-form',
inheritAttrs: false,
components,
props,
setup
}
</script>
Loading

0 comments on commit 34fc882

Please sign in to comment.