diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index 673d3f2912b..70f43f73c14 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -30,7 +30,7 @@

- {{ resource.displayname || resource.displaytext || resource.name || resource.hostname || resource.username || resource.ipaddress || resource.virtualmachinename }} + {{ resource.displayname || resource.displaytext || resource.name || resource.hostname || resource.username || resource.ipaddress || resource.virtualmachinename || resource.templatetype }}

diff --git a/ui/src/components/view/ListView.vue b/ui/src/components/view/ListView.vue index e5ec25ef77e..a396a26ff6f 100644 --- a/ui/src/components/view/ListView.vue +++ b/ui/src/components/view/ListView.vue @@ -21,7 +21,7 @@ :loading="loading" :columns="fetchColumns()" :dataSource="items" - :rowKey="record => record.id || record.name" + :rowKey="record => record.id || record.name || record.usageType" :pagination="false" :rowSelection="['vm', 'event', 'alert'].includes($route.name) ? {selectedRowKeys: selectedRowKeys, onChange: onSelectChange} : null" :rowClassName="getRowClassName" @@ -75,6 +75,9 @@ + + {{ text }} + {{ text }} @@ -147,11 +150,14 @@ {{ text }} - {{ text }} + {{ text }} + {{ text }} {{ text }} - {{ text }} + {{ text }} {{ text }} @@ -235,6 +241,15 @@ + @@ -267,7 +282,7 @@ export default { default: false } }, - inject: ['parentFetchData', 'parentToggleLoading'], + inject: ['parentFetchData', 'parentToggleLoading', 'parentEditTariffAction'], data () { return { selectedRowKeys: [], @@ -329,10 +344,9 @@ export default { }).catch(error => { console.error(error) this.$message.error('There was an error saving this setting.') + }).finally(() => { + this.$emit('refresh') }) - .finally(() => { - this.$emit('refresh') - }) }, editValue (record) { this.editableValueKey = record.key @@ -428,6 +442,9 @@ export default { data.forEach((item, index) => { this.handleUpdateOrder(item.id, index + 1) }) + }, + editTariffValue (record) { + this.parentEditTariffAction(true, record) } } } diff --git a/ui/src/config/section/plugin/quota.js b/ui/src/config/section/plugin/quota.js index 4fef501aef6..34deb64c5ef 100644 --- a/ui/src/config/section/plugin/quota.js +++ b/ui/src/config/section/plugin/quota.js @@ -28,7 +28,39 @@ export default { icon: 'bars', permission: ['quotaSummary'], columns: ['account', 'domain', 'state', 'currency', 'balance', 'quota'], - details: ['account', 'domain', 'state', 'currency', 'balance', 'quota', 'startdate', 'enddate'] + details: ['account', 'domain', 'state', 'currency', 'balance', 'quota', 'startdate', 'enddate'], + component: () => import('@/views/plugins/quota/QuotaSummary.vue'), + tabs: [ + { + name: 'details', + component: () => import('@/components/view/DetailsTab.vue') + }, + { + name: 'quota.statement.quota', + component: () => import('@/views/plugins/quota/QuotaUsage.vue') + }, + { + name: 'quota.statement.balance', + component: () => import('@/views/plugins/quota/QuotaBalance.vue') + } + ], + actions: [ + { + api: 'quotaCredits', + icon: 'plus', + label: 'label.quota.add.credits', + dataView: true, + args: ['value', 'min_balance', 'quota_enforce'], + mapping: { + account: { + value: (record) => { return record.account } + }, + domainid: { + value: (record) => { return record.domainid } + } + } + } + ] }, { name: 'quotatariff', @@ -36,8 +68,9 @@ export default { icon: 'credit-card', docHelp: 'plugins/quota.html#quota-tariff', permission: ['quotaTariffList'], - columns: ['usageName', 'description', 'usageUnit', 'tariffValue'], - details: ['usageName', 'description', 'usageUnit', 'tariffValue'] + columns: ['usageName', 'description', 'usageUnit', 'tariffValue', 'tariffActions'], + details: ['usageName', 'description', 'usageUnit', 'tariffValue'], + component: () => import('@/views/plugins/quota/QuotaTariff.vue') }, { name: 'quotaemailtemplate', @@ -45,7 +78,11 @@ export default { icon: 'mail', permission: ['quotaEmailTemplateList'], columns: ['templatetype', 'templatesubject', 'templatebody'], - details: ['templatetype', 'templatesubject', 'templatebody'] + details: ['templatetype', 'templatesubject', 'templatebody'], + tabs: [{ + name: 'details', + component: () => import('@/views/plugins/quota/EmailTemplateDetails.vue') + }] } ] } diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index 78ad666fd57..1f2b7cb016d 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -1260,6 +1260,7 @@ "label.minmemory": "Min Memory (in MB)", "label.minute.past.hour": "minute(s) past the hour", "label.minutes.past.hour": "minutes(s) past the hour", +"label.min_balance": "Min Balance", "label.monday": "Monday", "label.monitor": "Monitor", "label.monthly": "Monthly", @@ -1530,12 +1531,14 @@ "label.quiescevm": "Quiesce VM", "label.quiettime": "Quiet Time (in sec)", "label.quota": "Quota", +"label.quota_enforce": "Enforce Quota", "label.quota.add.credits": "Add Credits", "label.quota.configuration": "Quota Configuration", "label.quota.configure": "Configure Quota", "label.quota.credits": "Credits", "label.quota.dates": "Update Dates", "label.quota.description": "Quota Description", +"label.quota.email.edit": "Edit Email Template", "label.quota.enddate": "End Date", "label.quota.endquota": "End Quota", "label.quota.enforce": "Enforce Quota", @@ -1552,6 +1555,9 @@ "label.quota.tariff.edit": "Edit Tariff", "label.quota.tariff.effectivedate": "Effective Date", "label.quota.totalusage": "Total Usage", +"label.quota.total":"Total", +"label.quota.type.name":"Usage Type", +"label.quota.type.unit":"Usage Unit", "label.quota.usage": "Quota Consumption", "label.quota.value": "Quota Value", "label.rados.monitor": "RADOS Monitor", @@ -1904,6 +1910,7 @@ "label.tagged": "Tagged", "label.tags": "Tags", "label.target.iqn": "Target IQN", +"label.tariffactions": "Actions", "label.tariffvalue": "Tariff Value", "label.task.completed": "Task completed", "label.tcp": "TCP", diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 920194f9ba5..7b587fce6f3 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -283,7 +283,9 @@
+ @@ -342,6 +344,7 @@ export default { parentToggleLoading: this.toggleLoading, parentStartLoading: this.startLoading, parentFinishLoading: this.finishLoading, + parentChangeResource: this.changeResource, parentPollActionCompletion: this.pollActionCompletion } }, @@ -446,6 +449,7 @@ export default { if (this.$route && this.$route.params && this.$route.params.id) { this.resource = {} this.dataView = true + this.$emit('change-resource', this.resource) } else { this.dataView = false } @@ -597,6 +601,7 @@ export default { } if (this.items.length > 0) { this.resource = this.items[0] + this.$emit('change-resource', this.resource) } }).catch(error => { this.$notifyError(error) diff --git a/ui/src/views/plugins/quota/EditTariffValueWizard.vue b/ui/src/views/plugins/quota/EditTariffValueWizard.vue new file mode 100644 index 00000000000..8855088a03e --- /dev/null +++ b/ui/src/views/plugins/quota/EditTariffValueWizard.vue @@ -0,0 +1,136 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + diff --git a/ui/src/views/plugins/quota/EmailTemplateDetails.vue b/ui/src/views/plugins/quota/EmailTemplateDetails.vue new file mode 100644 index 00000000000..1d05ccd336c --- /dev/null +++ b/ui/src/views/plugins/quota/EmailTemplateDetails.vue @@ -0,0 +1,121 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + diff --git a/ui/src/views/plugins/quota/QuotaBalance.vue b/ui/src/views/plugins/quota/QuotaBalance.vue new file mode 100644 index 00000000000..10a4621a0aa --- /dev/null +++ b/ui/src/views/plugins/quota/QuotaBalance.vue @@ -0,0 +1,172 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + diff --git a/ui/src/views/plugins/quota/QuotaSummary.vue b/ui/src/views/plugins/quota/QuotaSummary.vue new file mode 100644 index 00000000000..df16c52d23d --- /dev/null +++ b/ui/src/views/plugins/quota/QuotaSummary.vue @@ -0,0 +1,66 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + diff --git a/ui/src/views/plugins/quota/QuotaSummaryResource.vue b/ui/src/views/plugins/quota/QuotaSummaryResource.vue new file mode 100644 index 00000000000..1a41780f007 --- /dev/null +++ b/ui/src/views/plugins/quota/QuotaSummaryResource.vue @@ -0,0 +1,92 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + diff --git a/ui/src/views/plugins/quota/QuotaTariff.vue b/ui/src/views/plugins/quota/QuotaTariff.vue new file mode 100644 index 00000000000..786d74ec918 --- /dev/null +++ b/ui/src/views/plugins/quota/QuotaTariff.vue @@ -0,0 +1,60 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + diff --git a/ui/src/views/plugins/quota/QuotaUsage.vue b/ui/src/views/plugins/quota/QuotaUsage.vue new file mode 100644 index 00000000000..a42bc8cdfc7 --- /dev/null +++ b/ui/src/views/plugins/quota/QuotaUsage.vue @@ -0,0 +1,157 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + +