Skip to content

Commit

Permalink
frontend: Wizard: Allow return before apply
Browse files Browse the repository at this point in the history
* Add a return button that allows user to return before applying
  configuration in Wizard
  • Loading branch information
JoaoMario109 authored and patrickelectric committed Feb 28, 2024
1 parent ff2bc65 commit e7e512f
Showing 1 changed file with 37 additions and 32 deletions.
69 changes: 37 additions & 32 deletions core/frontend/src/components/wizard/Wizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@
/>
</div>
<v-row class="pa-5 pt-10 flex-row justify-space-around align-center grow">
<v-btn
color="warning"
:disabled="apply_in_progress || apply_done"
@click="step_number = Math.max(step_number - 1, 1)"
>
Return
</v-btn>
<v-btn
:color="retry_count == 0 ? 'success' : 'error'"
:loading="apply_in_progress"
Expand Down Expand Up @@ -418,38 +425,36 @@ export default Vue.extend({
this.configuration_page_index += 1
},
async finalConfigurations() {
if (this.configurations.isEmpty()) {
this.configurations = [
{
title: 'Set custom vehicle name',
summary: `Set vehicle name for the user: ${this.vehicle_name}`,
promise: () => this.setHostname(),
message: undefined,
done: false,
skip: false,
started: false,
},
{
title: 'Set vehicle hostname',
summary: `Set hostname to be used for mDNS address: ${this.mdns_name}.local`,
promise: () => this.setVehicleName(),
message: undefined,
done: false,
skip: false,
started: false,
},
{
title: 'Set vehicle image',
summary: 'Set image to be used for vehicle thumbnail',
promise: () => this.setVehicleImage(),
message: undefined,
done: false,
skip: false,
started: false,
},
...this.setup_configurations,
]
}
this.configurations = [
{
title: 'Set custom vehicle name',
summary: `Set vehicle name for the user: ${this.vehicle_name}`,
promise: () => this.setHostname(),
message: undefined,
done: false,
skip: false,
started: false,
},
{
title: 'Set vehicle hostname',
summary: `Set hostname to be used for mDNS address: ${this.mdns_name}.local`,
promise: () => this.setVehicleName(),
message: undefined,
done: false,
skip: false,
started: false,
},
{
title: 'Set vehicle image',
summary: 'Set image to be used for vehicle thumbnail',
promise: () => this.setVehicleImage(),
message: undefined,
done: false,
skip: false,
started: false,
},
...this.setup_configurations,
]
},
async applyConfigurations() {
this.apply_status = ApplyStatus.InProgress
Expand Down

0 comments on commit e7e512f

Please sign in to comment.