Skip to content

Commit

Permalink
fix vpn instance card
Browse files Browse the repository at this point in the history
  • Loading branch information
SazukinPavel committed Jan 30, 2025
1 parent c866511 commit 8d88eaf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 30 deletions.
54 changes: 25 additions & 29 deletions admin-ui/src/components/instance/controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@
>
Close
</v-btn>
<v-btn
class="mr-2"
:loading="isSaveLoading"
@click="save(true)"
>
<v-btn class="mr-2" :loading="isSaveLoading" @click="save(true)">
Create
</v-btn>
<v-btn :loading="isSaveLoading" @click="save(false)">
Expand Down Expand Up @@ -279,7 +275,7 @@ export default {
const data = await api.plans.create(billingPlan);
await api.servicesProviders.bindPlan(this.sp.uuid, [data.uuid]);
return data;
} else {
} else {
const title = this.getPlanTitle(this.template);
const ogPlan = this.$store.getters["plans/one"];
const updatedPlan = {
Expand Down Expand Up @@ -357,8 +353,8 @@ export default {
this.showSnackbarSuccess({
message: "Instance saved successfully",
});
console.log('refresh');
console.log("refresh");
this.$emit("refresh");
} catch (err) {
this.showSnackbarError({ message: err.message });
Expand Down Expand Up @@ -742,31 +738,31 @@ export default {
}
return {
poweroff:
this.template.state.meta.state === 5 ||
(this.template.state.meta.state !== 3 &&
[0, 18, 20].includes(this.template.state.meta.lcm_state)),
this.template.state.meta?.state === 5 ||
(this.template.state.meta?.state !== 3 &&
[0, 18, 20].includes(this.template.state.meta?.lcm_state)),
reboot:
this.template.state.meta.lcm_state === 6 ||
this.template.state.meta.lcm_state === 21 ||
this.template.state.meta.state === 5 ||
(this.template.state.meta.state !== 3 &&
(this.template.state.meta.lcm_state === 18 ||
this.template.state.meta.lcm_state === 20)) ||
(this.template.state.meta.lcm_state === 0 &&
this.template.state.meta.state === 8),
this.template.state.meta?.lcm_state === 6 ||
this.template.state.meta?.lcm_state === 21 ||
this.template.state.meta?.state === 5 ||
(this.template.state.meta?.state !== 3 &&
(this.template.state.meta?.lcm_state === 18 ||
this.template.state.meta?.lcm_state === 20)) ||
(this.template.state.meta?.lcm_state === 0 &&
this.template.state.meta?.state === 8),
resume:
this.template.state.meta.lcm_state === 21 ||
this.template.state.meta.lcm_state === 6 ||
(this.template.state.meta.state === 3 &&
![18, 20].includes(this.template.state.meta.lcm_state)),
this.template.state.meta?.lcm_state === 21 ||
this.template.state.meta?.lcm_state === 6 ||
(this.template.state.meta?.state === 3 &&
![18, 20].includes(this.template.state.meta?.lcm_state)),
suspend:
this.template.state.meta.state === 5 ||
this.template.state.meta.lcm_state === 21 ||
this.template.state.meta.lcm_state === 6,
this.template.state.meta?.state === 5 ||
this.template.state.meta?.lcm_state === 21 ||
this.template.state.meta?.lcm_state === 6,
vnc:
this.template.state.meta.state === 5 ||
this.template.state.meta.lcm_state === 21 ||
this.template.state.meta.lcm_state === 6,
this.template.state.meta?.state === 5 ||
this.template.state.meta?.lcm_state === 21 ||
this.template.state.meta?.lcm_state === 6,
start: true,
};
},
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/src/components/modules/empty/billingLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const emit = defineEmits(["update"]);
const { template, addons } = toRefs(props);
const dueDate = computed(() => {
return formatSecondsToDate(+props.template?.data?.next_payment_date);
return formatSecondsToDate(+props.template?.data?.next_payment_date) || "-";
});
const instancePrice = ref(0);
Expand Down

0 comments on commit 8d88eaf

Please sign in to comment.