Skip to content

Commit 51bd0b1

Browse files
committed
ui fixes
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent 6bb936e commit 51bd0b1

File tree

6 files changed

+35
-19
lines changed

6 files changed

+35
-19
lines changed

ui/public/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@
668668
"label.current.storage": "Current storage",
669669
"label.currentpassword": "Current password",
670670
"label.custom": "Custom",
671+
"label.customactionid": "Custom Action",
671672
"label.customactions": "Custom Actions",
672673
"label.custom.actions": "Custom Actions",
673674
"label.customconstrained": "Custom constrained",
@@ -2026,6 +2027,7 @@
20262027
"label.rules.file.import.description": "Click or drag rule definitions CSV file to import.",
20272028
"label.rules.file.to.import": "Rule definitions CSV file to import",
20282029
"label.run.proxy.locally": "Run proxy locally",
2030+
"label.run.custom.action": "Run Custom Action",
20292031
"label.running": "Running",
20302032
"label.running.vms": "Running Instances",
20312033
"label.s2scustomergatewayid": "Site to site customer gateway ID",
@@ -2275,7 +2277,7 @@
22752277
"label.subnet": "Subnet",
22762278
"label.succeeded": "Succeeded",
22772279
"label.success": "Success",
2278-
"label.successmessage": "Success messgae",
2280+
"label.successmessage": "Success message",
22792281
"label.success.migrations": "Successful migrations",
22802282
"label.success.set": "Successfully set",
22812283
"label.success.updated": "Successfully updated",

ui/src/config/section/compute.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export default {
432432
dataView: true,
433433
component: shallowRef(defineAsyncComponent(() => import('@/views/extension/RunCustomAction'))),
434434
popup: true,
435-
show: (record) => { return ['External', 'Simulator'].includes(record.hypervisor) }
435+
show: (record) => { return ['External'].includes(record.hypervisor) }
436436
},
437437
{
438438
api: 'unmanageVirtualMachine',

ui/src/views/extension/AddCustomAction.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@
103103
<details-input
104104
v-model:value="form.details" />
105105
</a-form-item>
106-
<a-form-item name="enabled" ref="enabled">
107-
<template #label>
108-
<tooltip-label :title="$t('label.enabled')" :tooltip="apiParams.enabled.description"/>
109-
</template>
110-
<a-switch v-model:checked="form.enabled" />
111-
</a-form-item>
106+
<a-form-item name="enabled" ref="enabled">
107+
<template #label>
108+
<tooltip-label :title="$t('label.enabled')" :tooltip="apiParams.enabled.description"/>
109+
</template>
110+
<a-switch v-model:checked="form.enabled" />
111+
</a-form-item>
112112
<div :span="24" class="action-button">
113113
<a-button @click="closeAction">{{ $t('label.cancel') }}</a-button>
114114
<a-button :loading="loading" ref="submit" type="primary" @click="handleSubmit">{{ $t('label.ok') }}</a-button>
@@ -185,7 +185,8 @@ export default {
185185
this.loading = true
186186
const params = {
187187
extensionid: values.extensionid || this.extension.id,
188-
name: values.name
188+
name: values.name,
189+
enabled: values.enabled
189190
}
190191
if (values.description) {
191192
params.description = values.description

ui/src/views/extension/ExtensionCustomActionsTab.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</router-link>
4040
</template>
4141
<template v-if="['enabled'].includes(column.key)">
42-
{{ !!text ? $type('label.yes') : $t('label.no') }}
42+
<status :text="text ? 'Enabled' : 'Disabled'" displayText />
4343
</template>
4444
<template v-if="['created'].includes(column.key)">
4545
{{ text && $toLocaleDate(text) }}
@@ -109,14 +109,16 @@ import ObjectListTable from '@/components/view/ObjectListTable.vue'
109109
import TooltipButton from '@/components/widgets/TooltipButton'
110110
import AddCustomAction from '@/views/extension/AddCustomAction.vue'
111111
import UpdateCustomAction from '@/views/extension/UpdateCustomAction.vue'
112+
import Status from '@/components/widgets/Status'
112113
113114
export default {
114115
name: 'ExtensionCustomActionsTab',
115116
components: {
116117
ObjectListTable,
117118
TooltipButton,
118119
AddCustomAction,
119-
UpdateCustomAction
120+
UpdateCustomAction,
121+
Status
120122
},
121123
props: {
122124
resource: {
@@ -133,15 +135,15 @@ export default {
133135
title: this.$t('label.name'),
134136
dataIndex: 'name'
135137
},
136-
{
137-
title: this.$t('label.resourcetype'),
138-
dataIndex: 'resourcetype'
139-
},
140138
{
141139
key: 'enabled',
142-
title: this.$t('label.enabled'),
140+
title: this.$t('label.state'),
143141
dataIndex: 'enabled'
144142
},
143+
{
144+
title: this.$t('label.resourcetype'),
145+
dataIndex: 'resourcetype'
146+
},
145147
{
146148
key: 'created',
147149
title: this.$t('label.created'),
@@ -197,6 +199,8 @@ export default {
197199
this.totalCount = json?.listcustomactionsresponse?.count || 0
198200
this.extensionCustomActions = json?.listcustomactionsresponse?.extensioncustomaction || []
199201
this.tabLoading = false
202+
}).catch(error => {
203+
this.$notifyError(error)
200204
})
201205
},
202206
showAddCustomActionModal () {

ui/src/views/extension/RunCustomAction.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ export default {
163163
this.customActions = []
164164
const params = {
165165
resourcetype: this.resourceType,
166-
resourceid: this.resource.id
166+
resourceid: this.resource.id,
167+
enabled: true
167168
}
168169
api('listCustomActions', params).then(json => {
169170
this.customActions = json?.listcustomactionsresponse?.extensioncustomaction || []

ui/src/views/extension/UpdateCustomAction.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@
8383
<details-input
8484
v-model:value="form.details" />
8585
</a-form-item>
86+
<a-form-item name="enabled" ref="enabled">
87+
<template #label>
88+
<tooltip-label :title="$t('label.enabled')" :tooltip="apiParams.enabled.description"/>
89+
</template>
90+
<a-switch v-model:checked="form.enabled" />
91+
</a-form-item>
8692
<div :span="24" class="action-button">
8793
<a-button @click="closeAction">{{ $t('label.cancel') }}</a-button>
8894
<a-button :loading="loading" ref="submit" type="primary" @click="handleSubmit">{{ $t('label.ok') }}</a-button>
@@ -146,7 +152,8 @@ export default {
146152
description: this.resource.description,
147153
roles: this.resource.roles,
148154
parameters: this.fixParamatersOptions(this.resource.parameters),
149-
detail: this.resource.details
155+
detail: this.resource.details,
156+
enabled: this.resource.enabled
150157
})
151158
this.rules = reactive({})
152159
},
@@ -167,7 +174,8 @@ export default {
167174
const values = toRaw(this.form)
168175
this.loading = true
169176
const params = {
170-
id: this.resource.id
177+
id: this.resource.id,
178+
enabled: values.enabled
171179
}
172180
if (values.description) {
173181
params.description = values.description

0 commit comments

Comments
 (0)