Skip to content

Commit

Permalink
Merge pull request #1592 from slntopp/dev-fixes
Browse files Browse the repository at this point in the history
Dev fixes
  • Loading branch information
SazukinPavel authored Mar 22, 2024
2 parents 63f6379 + 4166e4e commit b8fb099
Show file tree
Hide file tree
Showing 26 changed files with 194 additions and 132 deletions.
29 changes: 12 additions & 17 deletions admin-ui/src/components/account/info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
<v-card elevation="0" color="background-light" class="pa-4">
<div style="z-index: 0; position: relative; top: -25px; right: 40px">
<div class="d-flex justify-end mt-1 align-center flex-wrap">
<hint-btn hint="Create transaction/invoice">
<v-btn
class="ma-1"
:disabled="isLocked"
:to="{
name: 'Transactions create',
params: { account: account.uuid },
}"
>
<v-icon>mdi-invoice-text-outline</v-icon>
</v-btn>
</hint-btn>

<hint-btn hint="Create instance">
<v-btn
class="ma-1"
Expand Down Expand Up @@ -75,10 +62,12 @@
</v-btn>
</confirm-dialog>
</hint-btn>
<v-chip class="ma-1" color="primary" outlined
>Balance: {{ account.balance?.toFixed(2) || 0 }}
{{ account.currency }}</v-chip
>
<hint-btn hint="Create transaction/invoice">
<v-chip @click="openTransaction" class="ma-1" color="primary" outlined
>Balance: {{ account.balance?.toFixed(2) || 0 }}
{{ account.currency }}</v-chip
>
</hint-btn>
</div>
</div>

Expand Down Expand Up @@ -406,6 +395,12 @@ export default {
this.isChangeRegularPaymentLoading = false;
}
},
openTransaction() {
this.$router.push({
name: "Transactions create",
params: { account: this.account.uuid },
});
},
},
mounted() {
this.title = this.account.title;
Expand Down
4 changes: 3 additions & 1 deletion admin-ui/src/components/accounts_table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const headers = ref([
{ text: "Address", value: "address" },
{ text: "Client currency", value: "currency" },
{ text: "Access level", value: "access.level" },
{ text: "WHMCS ID", value: "data.whmcs_id" },
{ text: "Invoice based", value: "data.regular_payment" },
]);
const levelColorMap = ref({
Expand Down Expand Up @@ -205,7 +206,7 @@ const requestOptions = computed(() => ({
from: filter.value?.balance.from && +filter.value?.balance.from,
to: filter.value?.balance.to && +filter.value?.balance.to,
},
search_param: searchParam.value || undefined,
search_param: searchParam.value || filter.value.search_param || undefined,
},
page: options.value.page,
limit: options.value.itemsPerPage,
Expand Down Expand Up @@ -236,6 +237,7 @@ const searchFields = computed(() => [
{ title: "Created date", key: "data.date_create", type: "date" },
{ title: "Country", key: "data.country", type: "input" },
{ title: "Address", key: "data.address", type: "input" },
{ title: "WHMCS ID", key: "data.whmcs_id", type: "input" },
{
title: "Client currency",
key: "currency",
Expand Down
14 changes: 5 additions & 9 deletions admin-ui/src/components/instance/info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<v-col>
<v-text-field
readonly
label="email"
label="Email"
:value="account?.data?.email"
append-icon="mdi-content-copy"
@click:append="addToClipboard(account?.data?.email)"
Expand All @@ -47,7 +47,7 @@
<v-col>
<v-text-field
readonly
label="balance"
label="Balance"
:value="account?.balance?.toFixed(2) || 0"
/>
</v-col>
Expand All @@ -65,7 +65,7 @@
<v-text-field
v-model="copyInstance.title"
ref="instance-title"
label="Instance title"
label="Instance name"
>
<template v-slot:append>
<v-icon class="mr-2" @click="$refs['instance-title'].focus()"
Expand Down Expand Up @@ -103,11 +103,7 @@
/>
</v-col>
<v-col>
<route-text-field
:to="{ name: 'Plan', params: { planId: plan?.uuid } }"
:value="plan?.title"
label="Billing plan"
/>
<v-text-field label="Location" readonly />
</v-col>
<v-col>
<v-text-field readonly :value="type" label="Type" />
Expand Down Expand Up @@ -218,7 +214,7 @@ export default {
methods: {
addToClipboard,
refreshInstance() {
this.$store.dispatch('reloadBtn/onclick')
this.$store.dispatch("reloadBtn/onclick");
},
updateCopy({ key, value }) {
const keys = key.split(".");
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/src/components/instances_table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export default {
if (this.headers) return this.headers;
const headers = [
{ text: "ID", value: "id" },
{ text: "Title", value: "title" },
{ text: "Name", value: "title" },
{ text: "Service", value: "service" },
{ text: "Account", value: "access" },
{ text: "Due date", value: "dueDate" },
Expand Down
19 changes: 15 additions & 4 deletions admin-ui/src/components/modules/cpanel/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@
<v-col>
<v-text-field
readonly
label="price model"
label="Price model"
:value="template.billingPlan.title"
append-icon="mdi-pencil"
@click:append="priceModelDialog = true"
/>
>
<template v-slot:append>
<v-icon @click="priceModelDialog = true">mdi-pencil</v-icon>
<v-icon
@click="
$router.push({
name: 'Plan',
params: { planId: template.billingPlan.uuid },
})
"
>mdi-login</v-icon
>
</template>
</v-text-field>
</v-col>
<v-col>
<v-text-field
Expand Down
12 changes: 6 additions & 6 deletions admin-ui/src/components/modules/cpanel/instanceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<v-row>
<v-col cols="6">
<v-text-field
label="title"
label="Name"
:value="instance.title"
:rules="rules.req"
@change="setValue('title', $event)"
Expand All @@ -22,14 +22,14 @@
@change="setValue('billingPlan', $event)"
item-text="title"
return-object
label="price model"
label="Price model"
:rules="planRules"
item-value="uuid"
></v-select>
</v-col>
<v-col cols="6">
<v-autocomplete
label="product"
label="Product"
:items="products"
item-text="title"
item-value="key"
Expand All @@ -40,23 +40,23 @@
</v-col>
<v-col cols="6">
<v-text-field
label="domain"
label="Domain"
:rules="rules.req"
:value="instance.config.domain"
@change="setValue('config.domain', $event)"
/>
</v-col>
<v-col cols="6">
<v-text-field
label="email"
label="Email"
:rules="rules.req"
:value="instance.config.email"
@change="setValue('config.email', $event)"
/>
</v-col>
<v-col cols="6">
<v-text-field
label="password"
label="Password"
:rules="rules.req"
:value="instance.config.password"
@change="setValue('config.password', $event)"
Expand Down
8 changes: 4 additions & 4 deletions admin-ui/src/components/modules/custom/instanceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<v-col cols="6">
<v-text-field
@change="(newVal) => setValue('title', newVal)"
label="title"
label="Name"
:value="instance.title"
>
</v-text-field>
Expand All @@ -21,7 +21,7 @@
<v-col><h3>Config:</h3></v-col>
<v-col cols="12">
<json-editor
label="config"
label="Config"
:json="instance.config"
@changeValue="(newVal) => setValue('config', newVal)"
/>
Expand All @@ -30,7 +30,7 @@
<v-col><h3>Resources:</h3></v-col>
<v-col cols="12">
<json-editor
label="resources"
label="Resources"
:json="instance.resources"
@changeValue="(newVal) => setValue('resources', newVal)"
/>
Expand All @@ -40,7 +40,7 @@
<v-row>
<v-col lg="6" cols="12">
<v-autocomplete
label="price model"
label="Price model"
item-text="title"
item-value="uuid"
:value="instance.plan"
Expand Down
23 changes: 17 additions & 6 deletions admin-ui/src/components/modules/empty/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@
<v-col>
<v-text-field
readonly
label="price model"
label="Price model"
:value="template.billingPlan.title"
@click:append="priceModelDialog = true"
append-icon="mdi-pencil"
/>
>
<template v-slot:append>
<v-icon @click="priceModelDialog = true">mdi-pencil</v-icon>
<v-icon
@click="
$router.push({
name: 'Plan',
params: { planId: template.billingPlan.uuid },
})
"
>mdi-login</v-icon
>
</template>
</v-text-field>
</v-col>
<v-col>
<v-text-field
Expand All @@ -23,7 +34,7 @@
<v-text-field
readonly
label="Date (create)"
:value="formatSecondsToDate(template.created,true)"
:value="formatSecondsToDate(template.created, true)"
/>
</v-col>

Expand Down Expand Up @@ -247,7 +258,7 @@ const addonsHeaders = ref([
const billingItems = ref([]);
const dueDate = computed(() =>
formatSecondsToDate(template.value?.data?.next_payment_date,true)
formatSecondsToDate(template.value?.data?.next_payment_date, true)
);
const isMonitoringsEmpty = computed(() => dueDate.value === "-");
Expand Down
8 changes: 4 additions & 4 deletions admin-ui/src/components/modules/empty/instanceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<v-col cols="6">
<v-text-field
@change="(newVal) => setValue('title', newVal)"
label="title"
label="Name"
:value="instance.title"
>
</v-text-field>
Expand All @@ -19,7 +19,7 @@
<v-row>
<v-col cols="6">
<v-autocomplete
label="price model"
label="Price model"
item-text="title"
item-value="uuid"
:value="instance.billing_plan"
Expand All @@ -30,7 +30,7 @@
</v-col>
<v-col cols="6">
<v-autocomplete
label="product"
label="Product"
:rules="requiredRule"
:value="instance.product"
v-if="products.length > 0"
Expand All @@ -53,7 +53,7 @@

<v-col cols="6" v-if="addons.length">
<v-autocomplete
label="addons"
label="Addons"
:value="instance.config.addons"
:items="addons"
multiple
Expand Down
19 changes: 15 additions & 4 deletions admin-ui/src/components/modules/ione/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@
<v-col>
<v-text-field
readonly
label="price model"
label="Price model"
:value="template.billingPlan.title"
@click:append="priceModelDialog = true"
append-icon="mdi-pencil"
/>
>
<template v-slot:append>
<v-icon @click="priceModelDialog = true">mdi-pencil</v-icon>
<v-icon
@click="
$router.push({
name: 'Plan',
params: { planId: template.billingPlan.uuid },
})
"
>mdi-login</v-icon
>
</template>
</v-text-field>
</v-col>
<v-col>
<v-text-field
Expand Down
Loading

0 comments on commit b8fb099

Please sign in to comment.