Skip to content

Commit 03a0ed6

Browse files
committed
UI: Add missing tooltips to Register/Upload Templates/ISOs views
1 parent 1065e90 commit 03a0ed6

File tree

2 files changed

+94
-29
lines changed

2 files changed

+94
-29
lines changed

ui/src/views/image/RegisterOrUploadIso.vue

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
<a-form-item
3636
v-if="currentForm === 'Create'"
3737
ref="url"
38-
name="url"
39-
:label="$t('label.url')">
38+
name="url">
39+
<template #label>
40+
<tooltip-label :title="$t('label.url')" :tooltip="apiParams.url.description"/>
41+
</template>
4042
<a-input
4143
v-focus="currentForm === 'Create'"
4244
v-model:value="form.url"
@@ -61,23 +63,35 @@
6163
</p>
6264
</a-upload-dragger>
6365
</a-form-item>
64-
<a-form-item ref="name" name="name" :label="$t('label.name')">
66+
<a-form-item ref="name" name="name">
67+
<template #label>
68+
<tooltip-label :title="$t('label.name')" :tooltip="apiParams.name.description"/>
69+
</template>
6570
<a-input
6671
v-model:value="form.name"
6772
:placeholder="apiParams.name.description"
6873
v-focus="currentForm !== 'Create'" />
6974
</a-form-item>
70-
<a-form-item ref="displaytext" name="displaytext" :label="$t('label.displaytext')">
75+
<a-form-item ref="displaytext" name="displaytext">
76+
<template #label>
77+
<tooltip-label :title="$t('label.displaytext')" :tooltip="apiParams.displaytext.description"/>
78+
</template>
7179
<a-input
7280
v-model:value="form.displaytext"
7381
:placeholder="apiParams.displaytext.description" />
7482
</a-form-item>
7583

76-
<a-form-item ref="directdownload" name="directdownload" v-if="allowed && currentForm !== 'Upload'" :label="$t('label.directdownload')">
84+
<a-form-item ref="directdownload" name="directdownload" v-if="allowed && currentForm !== 'Upload'">
85+
<template #label>
86+
<tooltip-label :title="$t('label.directdownload')" :tooltip="apiParams.directdownload.description"/>
87+
</template>
7788
<a-switch v-model:checked="form.directdownload"/>
7889
</a-form-item>
7990

80-
<a-form-item ref="zoneid" name="zoneid" :label="$t('label.zoneid')">
91+
<a-form-item ref="zoneid" name="zoneid">
92+
<template #label>
93+
<tooltip-label :title="$t('label.zoneid')" :tooltip="apiParams.zoneid.description"/>
94+
</template>
8195
<a-select
8296
v-model:value="form.zoneid"
8397
showSearch
@@ -139,11 +153,17 @@
139153
</a-select>
140154
</a-form-item>
141155

142-
<a-form-item ref="bootable" name="bootable" :label="$t('label.bootable')">
156+
<a-form-item ref="bootable" name="bootable">
157+
<template #label>
158+
<tooltip-label :title="$t('label.bootable')" :tooltip="apiParams.bootable.description"/>
159+
</template>
143160
<a-switch v-model:checked="form.bootable" />
144161
</a-form-item>
145162

146-
<a-form-item ref="ostypeid" name="ostypeid" v-if="form.bootable" :label="$t('label.ostypeid')">
163+
<a-form-item ref="ostypeid" name="ostypeid" v-if="form.bootable">
164+
<template #label>
165+
<tooltip-label :title="$t('label.ostypeid')" :tooltip="apiParams.ostypeid.description"/>
166+
</template>
147167
<a-select
148168
v-model:value="form.ostypeid"
149169
showSearch
@@ -167,8 +187,10 @@
167187
<a-col :md="24" :lg="12">
168188
<a-form-item
169189
name="userdataid"
170-
ref="userdataid"
171-
:label="$t('label.userdata')">
190+
ref="userdataid">
191+
<template #label>
192+
<tooltip-label :title="$t('label.userdata')" :tooltip="linkUserDataParams.userdataid.description"/>
193+
</template>
172194
<a-select
173195
showSearch
174196
optionFilterProp="label"
@@ -187,7 +209,7 @@
187209
<a-col :md="24" :lg="12">
188210
<a-form-item ref="userdatapolicy" name="userdatapolicy">
189211
<template #label>
190-
<tooltip-label :title="$t('label.userdatapolicy')" :tooltip="$t('label.userdatapolicy.tooltip')"/>
212+
<tooltip-label :title="$t('label.userdatapolicy')" :tooltip="linkUserDataParams.userdatapolicy.description"/>
191213
</template>
192214
<a-select
193215
showSearch
@@ -205,19 +227,27 @@
205227
</a-col>
206228
</a-row>
207229

208-
<a-form-item ref="isextractable" name="isextractable" :label="$t('label.isextractable')">
230+
<a-form-item ref="isextractable" name="isextractable">
231+
<template #label>
232+
<tooltip-label :title="$t('label.isextractable')" :tooltip="apiParams.isextractable.description"/>
233+
</template>
209234
<a-switch v-model:checked="form.isextractable" />
210235
</a-form-item>
211236

212237
<a-form-item
213238
ref="ispublic"
214239
name="ispublic"
215-
:label="$t('label.ispublic')"
216240
v-if="$store.getters.userInfo.roletype === 'Admin' || $store.getters.features.userpublictemplateenabled" >
241+
<template #label>
242+
<tooltip-label :title="$t('label.ispublic')" :tooltip="apiParams.ispublic.description"/>
243+
</template>
217244
<a-switch v-model:checked="form.ispublic" />
218245
</a-form-item>
219246

220-
<a-form-item ref="isfeatured" name="isfeatured" :label="$t('label.isfeatured')" v-if="$store.getters.userInfo.roletype === 'Admin'">
247+
<a-form-item ref="isfeatured" name="isfeatured" v-if="$store.getters.userInfo.roletype === 'Admin'">
248+
<template #label>
249+
<tooltip-label :title="$t('label.isfeatured')" :tooltip="apiParams.isfeatured.description"/>
250+
</template>
221251
<a-switch v-model:checked="form.isfeatured" />
222252
</a-form-item>
223253

@@ -326,7 +356,7 @@ export default {
326356
params.showicon = true
327357
328358
this.zoneLoading = true
329-
if (store.getters.userInfo.roletype === this.rootAdmin) {
359+
if (store.getters.userInfo.roletype === 'Admin') {
330360
this.allowed = true
331361
}
332362
api('listZones', params).then(json => {

ui/src/views/image/RegisterOrUploadTemplate.vue

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
@finish="handleSubmit"
3333
layout="vertical">
3434
<div v-if="currentForm === 'Create'">
35-
<a-form-item :label="$t('label.url')" name="url" ref="url">
35+
<a-form-item name="url" ref="url">
36+
<template #label>
37+
<tooltip-label :title="$t('label.url')" :tooltip="apiParams.url.description"/>
38+
</template>
3639
<a-input
3740
v-focus="currentForm === 'Create'"
3841
v-model:value="form.url"
@@ -56,22 +59,30 @@
5659
</a-upload-dragger>
5760
</a-form-item>
5861
</div>
59-
<a-form-item :label="$t('label.name')" ref="name" name="name">
62+
<a-form-item ref="name" name="name">
63+
<template #label>
64+
<tooltip-label :title="$t('label.name')" :tooltip="apiParams.name.description"/>
65+
</template>
6066
<a-input
6167
v-model:value="form.name"
6268
:placeholder="apiParams.name.description"
6369
v-focus="currentForm !== 'Create'"/>
6470
</a-form-item>
65-
<a-form-item :label="$t('label.displaytext')" ref="displaytext" name="displaytext">
71+
<a-form-item ref="displaytext" name="displaytext">
72+
<template #label>
73+
<tooltip-label :title="$t('label.displaytext')" :tooltip="apiParams.displaytext.description"/>
74+
</template>
6675
<a-input
6776
v-model:value="form.displaytext"
6877
:placeholder="apiParams.displaytext.description" />
6978
</a-form-item>
7079
<div v-if="currentForm === 'Create'">
7180
<a-form-item
72-
:label="$t('label.zone')"
7381
name="zoneids"
7482
ref="zoneids">
83+
<template #label>
84+
<tooltip-label :title="$t('label.zone')" :tooltip="apiParams.zoneids.description"/>
85+
</template>
7586
<a-select
7687
v-model:value="form.zoneids"
7788
:loading="zones.loading"
@@ -94,9 +105,11 @@
94105
</div>
95106
<div v-else>
96107
<a-form-item
97-
:label="$t('label.zoneid')"
98108
ref="zoneid"
99109
name="zoneid">
110+
<template #label>
111+
<tooltip-label :title="$t('label.zoneid')" :tooltip="apiParams.zoneid.description"/>
112+
</template>
100113
<a-select
101114
v-model:value="form.zoneid"
102115
showSearch
@@ -160,7 +173,10 @@
160173
</a-form-item>
161174
<a-row :gutter="12">
162175
<a-col :md="24" :lg="12">
163-
<a-form-item ref="hypervisor" name="hypervisor" :label="$t('label.hypervisor')">
176+
<a-form-item ref="hypervisor" name="hypervisor">
177+
<template #label>
178+
<tooltip-label :title="$t('label.hypervisor')" :tooltip="apiParams.hypervisor.description"/>
179+
</template>
164180
<a-select
165181
v-model:value="form.hypervisor"
166182
:loading="hyperVisor.loading"
@@ -178,7 +194,10 @@
178194
</a-form-item>
179195
</a-col>
180196
<a-col :md="24" :lg="12">
181-
<a-form-item ref="format" name="format" :label="$t('label.format')">
197+
<a-form-item ref="format" name="format">
198+
<template #label>
199+
<tooltip-label :title="$t('label.format')" :tooltip="apiParams.format.description"/>
200+
</template>
182201
<a-select
183202
v-model:value="form.format"
184203
:placeholder="apiParams.format.description"
@@ -197,12 +216,18 @@
197216
</a-row>
198217
<a-row :gutter="12" v-if="allowed && (hyperKVMShow || hyperCustomShow) && currentForm !== 'Upload'">
199218
<a-col :md="24" :lg="12">
200-
<a-form-item ref="directdownload" name="directdownload" :label="$t('label.directdownload')">
219+
<a-form-item ref="directdownload" name="directdownload">
220+
<template #label>
221+
<tooltip-label :title="$t('label.directdownload')" :tooltip="apiParams.directdownload.description"/>
222+
</template>
201223
<a-switch v-model:checked="form.directdownload" @change="handleChangeDirect" />
202224
</a-form-item>
203225
</a-col>
204226
<a-col :md="24" :lg="12" v-if="allowDirectDownload">
205-
<a-form-item ref="checksum" name="checksum" :label="$t('label.checksum')">
227+
<a-form-item ref="checksum" name="checksum">
228+
<template #label>
229+
<tooltip-label :title="$t('label.checksum')" :tooltip="apiParams.checksum.description"/>
230+
</template>
206231
<a-input
207232
v-model:value="form.checksum"
208233
:placeholder="apiParams.checksum.description" />
@@ -215,7 +240,10 @@
215240
</a-form-item>
216241
</a-row>
217242

218-
<a-form-item ref="deployasis" name="deployasis" :label="$t('label.deployasis')" v-if="selectedFormat === 'OVA'">
243+
<a-form-item ref="deployasis" name="deployasis" v-if="selectedFormat === 'OVA'">
244+
<template #label>
245+
<tooltip-label :title="$t('label.deployasis')" :tooltip="apiParams.deployasis.description"/>
246+
</template>
219247
<a-switch
220248
v-model:checked="form.deployasis"
221249
:checked="deployasis"
@@ -278,8 +306,10 @@
278306
<a-form-item
279307
name="ostypeid"
280308
ref="ostypeid"
281-
:label="$t('label.ostypeid')"
282309
v-if="!hyperVMWShow || (hyperVMWShow && !deployasis)">
310+
<template #label>
311+
<tooltip-label :title="$t('label.ostypeid')" :tooltip="apiParams.ostypeid.description"/>
312+
</template>
283313
<a-select
284314
showSearch
285315
optionFilterProp="label"
@@ -298,8 +328,10 @@
298328
<a-col :md="24" :lg="12">
299329
<a-form-item
300330
name="userdataid"
301-
ref="userdataid"
302-
:label="$t('label.userdata')">
331+
ref="userdataid">
332+
<template #label>
333+
<tooltip-label :title="$t('label.userdata')" :tooltip="linkUserDataParams.userdataid.description"/>
334+
</template>
303335
<a-select
304336
showSearch
305337
optionFilterProp="label"
@@ -318,7 +350,7 @@
318350
<a-col :md="24" :lg="12">
319351
<a-form-item ref="userdatapolicy" name="userdatapolicy">
320352
<template #label>
321-
<tooltip-label :title="$t('label.userdatapolicy')" :tooltip="$t('label.userdatapolicy.tooltip')"/>
353+
<tooltip-label :title="$t('label.userdatapolicy')" :tooltip="linkUserDataParams.userdatapolicy.description"/>
322354
</template>
323355
<a-select
324356
showSearch
@@ -344,6 +376,9 @@
344376
>
345377
<a-row>
346378
<a-col :span="12">
379+
<template #label>
380+
<tooltip-label :title="$t('label.isextractable')" :tooltip="apiParams.isextractable.description"/>
381+
</template>
347382
<a-checkbox value="isextractable">
348383
{{ $t('label.isextractable') }}
349384
</a-checkbox>

0 commit comments

Comments
 (0)