-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(admin(vue,js)): add tenants to configuration ui, implements #…
- Loading branch information
Showing
12 changed files
with
864 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
html/pfappserver/root/src/views/Configuration/tenants/_api.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}) | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
html/pfappserver/root/src/views/Configuration/tenants/_components/TheForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.