Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 3 ui/src/components/view/ListResourceTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
style="width: 25vw;float: right;margin-bottom: 10px; z-index: 8"
:placeholder="$t('label.search')"
v-model="filter"
@search="handleSearch" />
@search="handleSearch"
autoFocus />

<a-table
size="small"
Expand Down
1 change: 1 addition & 0 deletions 1 ui/src/components/view/ResourceLimitTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
v-decorator="[item.resourcetype, {
initialValue: item.max
}]"
:autoFocus="index === 0"
/>
</a-form-item>
<div class="card-footer">
Expand Down
26 changes: 22 additions & 4 deletions 26 ui/src/views/AutogenView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
}]"
v-model="formModel[field.name]"
:placeholder="field.description"
:autoFocus="fieldIndex === 0"
:autoFocus="fieldIndex === firstIndex"
/>
</span>
<span v-else-if="currentAction.mapping && field.name in currentAction.mapping && currentAction.mapping[field.name].options">
Expand All @@ -183,6 +183,7 @@
rules: [{ required: field.required, message: `${$t('message.error.select')}` }]
}]"
:placeholder="field.description"
:autoFocus="fieldIndex === firstIndex"
>
<a-select-option key="" >{{ }}</a-select-option>
<a-select-option v-for="(opt, optIndex) in currentAction.mapping[field.name].options" :key="optIndex">
Expand All @@ -204,6 +205,7 @@
:filterOption="(input, option) => {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}"
:autoFocus="fieldIndex === firstIndex"
>
<a-select-option key="">{{ }}</a-select-option>
<a-select-option v-for="(opt, optIndex) in field.opts" :key="optIndex">
Expand All @@ -224,6 +226,7 @@
:filterOption="(input, option) => {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}"
:autoFocus="fieldIndex === firstIndex"
>
<a-select-option key="">{{ }}</a-select-option>
<a-select-option v-for="opt in field.opts" :key="opt.id">
Expand All @@ -239,6 +242,7 @@
rules: [{ required: field.required, message: `${$t('message.error.select')}` }]
}]"
:placeholder="field.description"
:autoFocus="fieldIndex === firstIndex"
>
<a-select-option v-for="(opt, optIndex) in field.opts" :key="optIndex">
{{ opt.name && opt.type ? opt.name + ' (' + opt.type + ')' : opt.name || opt.description }}
Expand All @@ -247,7 +251,7 @@
</span>
<span v-else-if="field.type==='long'">
<a-input-number
:autoFocus="fieldIndex === 0"
:autoFocus="fieldIndex === firstIndex"
style="width: 100%;"
v-decorator="[field.name, {
rules: [{ required: field.required, message: `${$t('message.validate.number')}` }]
Expand All @@ -270,6 +274,7 @@
}]"
:placeholder="field.description"
@blur="($event) => handleConfirmBlur($event, field.name)"
:autoFocus="fieldIndex === firstIndex"
/>
</span>
<span v-else-if="field.name==='certificate' || field.name==='privatekey' || field.name==='certchain'">
Expand All @@ -279,11 +284,12 @@
rules: [{ required: field.required, message: `${$t('message.error.required.input')}` }]
}]"
:placeholder="field.description"
:autoFocus="fieldIndex === firstIndex"
/>
</span>
<span v-else>
<a-input
:autoFocus="fieldIndex === 0"
:autoFocus="fieldIndex === firstIndex"
v-decorator="[field.name, {
rules: [{ required: field.required, message: `${$t('message.error.required.input')}` }]
}]"
Expand Down Expand Up @@ -394,7 +400,8 @@ export default {
searchParams: {},
actions: [],
formModel: {},
confirmDirty: false
confirmDirty: false,
firstIndex: 0
}
},
beforeCreate () {
Expand Down Expand Up @@ -755,6 +762,7 @@ export default {
})
}
}
this.getFirstIndexFocus()

this.showAction = true
for (const param of this.currentAction.paramFields) {
Expand All @@ -770,6 +778,16 @@ export default {
this.fillEditFormFieldValues()
}
},
getFirstIndexFocus () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidjumani What's wrong with this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good fix!

this.firstIndex = 0
for (let fieldIndex = 0; fieldIndex < this.currentAction.paramFields.length; fieldIndex++) {
const field = this.currentAction.paramFields[fieldIndex]
if (!(this.currentAction.mapping && field.name in this.currentAction.mapping && this.currentAction.mapping[field.name].value)) {
this.firstIndex = fieldIndex
break
}
}
},
listUuidOpts (param) {
if (this.currentAction.mapping && param.name in this.currentAction.mapping && !this.currentAction.mapping[param.name].api) {
return
Expand Down
2 changes: 1 addition & 1 deletion 2 ui/src/views/compute/AssignInstance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<div class="form__item">
<p class="form__label">{{ $t('label.accounttype') }}</p>
<a-select v-model="selectedAccountType" defaultValue="account">
<a-select v-model="selectedAccountType" defaultValue="account" autoFocus>
<a-select-option :value="$t('label.account')">{{ $t('label.account') }}</a-select-option>
<a-select-option :value="$t('label.project')">{{ $t('label.project') }}</a-select-option>
</a-select>
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/AttachIso.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
v-decorator="['id', {
initialValue: this.selectedIso,
rules: [{ required: true, message: `${this.$t('label.required')}`}]
}]" >
}]"
autoFocus>
<a-select-option v-for="iso in isos" :key="iso.id">
{{ iso.displaytext || iso.name }}
</a-select-option>
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/ChangeAffinity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
style="margin-bottom: 10px;"
:placeholder="$t('label.search')"
v-model="filter"
@search="handleSearch" />
@search="handleSearch"
autoFocus />
</div>

<div class="form__item">
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/CreateKubernetesCluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
v-decorator="['name', {
rules: [{ required: true, message: $t('message.error.kubecluster.name') }]
}]"
:placeholder="apiParams.name.description"/>
:placeholder="apiParams.name.description"
autoFocus />
</a-form-item>
<a-form-item>
<span slot="label">
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/CreateSSHKeyPair.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
v-decorator="['name', {
rules: [{ required: true, message: $t('message.error.name') }]
}]"
:placeholder="apiParams.name.description"/>
:placeholder="apiParams.name.description"
autoFocus />
</a-form-item>
<a-form-item :label="$t('label.publickey')">
<a-input
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/CreateSnapshotWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
rules: [{ required: true, message: $t('message.error.select') }]
}]"
@change="onChangeVolume"
:placeholder="apiParams.volumeid.description">
:placeholder="apiParams.volumeid.description"
autoFocus>
<a-select-option
v-for="volume in listVolumes"
:key="volume.id">
Expand Down
2 changes: 2 additions & 0 deletions 2 ui/src/views/compute/DeployVM.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
:options="zoneSelectOptions"
@change="onSelectZoneId"
:loading="loading.zones"
autoFocus
></a-select>
</a-form-item>
<a-form-item
Expand Down Expand Up @@ -477,6 +478,7 @@
v-if="vm.templateid && ['KVM', 'VMware'].includes(hypervisor) && !template.deployasis">
<a-form-item :label="$t('label.boottype')">
<a-select
:autoFocus="vm.templateid && ['KVM', 'VMware'].includes(hypervisor) && !template.deployasis"
v-decorator="['boottype']"
@change="fetchBootModes"
>
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/DestroyVM.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
v-decorator="['volumeids']"
:placeholder="$t('label.delete.volumes')"
mode="multiple"
:loading="loading">
:loading="loading"
:autoFocus="$store.getters.userInfo.roletype !== 'Admin' && !$store.getters.features.allowuserexpungerecovervm">
<a-select-option v-for="volume in volumes" :key="volume.id">
{{ volume.name }}
</a-select-option>
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/EditVM.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
</a-tooltip>
</span>
<a-input
v-decorator="['name', { initialValue: resource.name || '' }]" />
v-decorator="['name', { initialValue: resource.name || '' }]"
autoFocus />
</a-form-item>
<a-form-item>
<span slot="label">
Expand Down
10 changes: 6 additions & 4 deletions 10 ui/src/views/compute/InstanceTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
{{ $t('message.network.addvm.desc') }}
<div class="modal-form">
<p class="modal-form__label">{{ $t('label.network') }}:</p>
<a-select :defaultValue="addNetworkData.network" @change="e => addNetworkData.network = e">
<a-select :defaultValue="addNetworkData.network" @change="e => addNetworkData.network = e" autoFocus>
<a-select-option
v-for="network in addNetworkData.allNetworks"
:key="network.id"
Expand Down Expand Up @@ -195,14 +195,16 @@
showSearch
v-if="editNicResource.type==='Shared'"
v-model="editIpAddressValue"
:loading="listIps.loading">
:loading="listIps.loading"
:autoFocus="editNicResource.type==='Shared'">
<a-select-option v-for="ip in listIps.opts" :key="ip.ipaddress">
{{ ip.ipaddress }}
</a-select-option>
</a-select>
<a-input
v-else
v-model="editIpAddressValue"></a-input>
v-model="editIpAddressValue"
:autoFocus="editNicResource.type!=='Shared'"></a-input>
</div>
</a-modal>

Expand All @@ -218,7 +220,7 @@
{{ $t('message.network.secondaryip') }}
</p>
<a-divider />
<a-input :placeholder="$t('label.new.secondaryip.description')" v-model="newSecondaryIp"></a-input>
<a-input :placeholder="$t('label.new.secondaryip.description')" v-model="newSecondaryIp" autoFocus></a-input>
<div style="margin-top: 10px; display: flex; justify-content:flex-end;">
<a-button @click="submitSecondaryIP" type="primary" style="margin-right: 10px;">{{ $t('label.add.secondary.ip') }}</a-button>
<a-button @click="closeModals">{{ $t('label.close') }}</a-button>
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/MigrateWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
:placeholder="$t('label.search')"
v-model="searchQuery"
style="margin-bottom: 10px;"
@search="fetchData" />
@search="fetchData"
autoFocus />
<a-table
size="small"
style="overflow-y: auto"
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/ScaleKubernetesCluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
}
}]
}]"
:placeholder="apiParams.size.description"/>
:placeholder="apiParams.size.description"
autoFocus />
</a-form-item>
<a-form-item>
<span slot="label">
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/StartVirtualMachine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
}"
:loading="podsLoading"
:placeholder="apiParams.podid.description"
@change="handlePodChange">
@change="handlePodChange"
:autoFocus="this.$store.getters.userInfo.roletype === 'Admin'">
<a-select-option v-for="pod in this.pods" :key="pod.id">
{{ pod.name }}
</a-select-option>
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/UpgradeKubernetesCluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}"
:loading="kubernetesVersionLoading"
:placeholder="apiParams.kubernetesversionid.description">
:placeholder="apiParams.kubernetesversionid.description"
autoFocus >
<a-select-option v-for="(opt, optIndex) in this.kubernetesVersions" :key="optIndex">
{{ opt.name || opt.description }}
</a-select-option>
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/backup/FormSchedule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
rules: [{required: true, message: $t('message.error.required.input')}]
}]"
:min="1"
:max="59"/>
:max="59"
autoFocus />
</a-tooltip>
</a-form-item>
</a-col>
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/compute/wizard/ComputeOfferingSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
style="width: 25vw;float: right;margin-bottom: 10px; z-index: 8"
:placeholder="$t('label.search')"
v-model="filter"
@search="handleSearch" />
@search="handleSearch"
autoFocus />
<a-table
:columns="columns"
:dataSource="tableSource"
Expand Down
2 changes: 2 additions & 0 deletions 2 ui/src/views/compute/wizard/ComputeSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
</a-col>
<a-col :md="4" :lg="4">
<a-input-number
:autoFocus="isConstrained"
v-model="cpuNumberInputValue"
@change="($event) => updateComputeCpuNumber($event)"
/>
Expand All @@ -48,6 +49,7 @@
:validate-status="errors.cpuspeed.status"
:help="errors.cpuspeed.message">
<a-input-number
:autoFocus="!isConstrained"
v-model="cpuSpeedInputValue"
@change="($event) => updateComputeCpuSpeed($event)"
/>
Expand Down
1 change: 1 addition & 0 deletions 1 ui/src/views/compute/wizard/DiskSizeSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<a-col :md="4" :lg="4">
<span style="display: inline-flex">
<a-input-number
autoFocus
v-model="inputValue"
@change="($event) => updateDiskSize($event)"
/>
Expand Down
1 change: 1 addition & 0 deletions 1 ui/src/views/compute/wizard/MultiDiskSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

<span slot="offering" slot-scope="text, record">
<a-select
autoFocus
v-if="validOfferings[record.id] && validOfferings[record.id].length > 0"
@change="updateOffering($event, record.id)"
:defaultValue="validOfferings[record.id][0].id">
Expand Down
8 changes: 5 additions & 3 deletions 8 ui/src/views/compute/wizard/NetworkConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
<div>{{ text }}</div>
<small v-if="record.type!=='L2'">{{ $t('label.cidr') + ': ' + record.cidr }}</small>
</template>
<template slot="ipAddress" slot-scope="text, record">
<a-form-item v-if="record.type!=='L2'">
<template slot="ipAddress" slot-scope="text, record, index">
<a-form-item v-if="record.type!=='L2' && index === 0">
<a-input
:autoFocus="record.type!=='L2'"
style="width: 150px;"
v-decorator="['ipAddress' + record.id, {
rules: [{
Expand All @@ -49,9 +50,10 @@
</a-input>
</a-form-item>
</template>
<template slot="macAddress" slot-scope="text, record">
<template slot="macAddress" slot-scope="text, record, index">
<a-form-item>
<a-input
:autoFocus="record.type==='L2' && index === 0"
style="width: 150px;"
:placeholder="$t('label.macaddress')"
v-decorator="[`macAddress` + record.id, {
Expand Down
3 changes: 2 additions & 1 deletion 3 ui/src/views/iam/AddAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
initialValue: selectedRole,
rules: [{ required: true, message: $t('message.error.select') }] }]"
:loading="roleLoading"
:placeholder="apiParams.roleid.description">
:placeholder="apiParams.roleid.description"
autoFocus>
<a-select-option v-for="role in roles" :key="role.id">
{{ role.name + ' (' + role.type + ')' }}
</a-select-option>
Expand Down
2 changes: 1 addition & 1 deletion 2 ui/src/views/iam/AddLdapAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
@submit="handleSubmit"
layout="vertical" >
<a-form-item :label="$t('label.filterby')">
<a-select @change="fetchListLdapUsers" v-model="selectedFilter" >
<a-select @change="fetchListLdapUsers" v-model="selectedFilter" autoFocus >
<a-select-option v-for="opt in filters" :key="opt.id" >
{{ opt.name }}
</a-select-option>
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.