Skip to content

Commit

Permalink
Merge pull request #1938 from slntopp/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
SazukinPavel authored Dec 16, 2024
2 parents 57dfb7c + c54d9c4 commit bb3cb00
Show file tree
Hide file tree
Showing 35 changed files with 245 additions and 97 deletions.
4 changes: 2 additions & 2 deletions admin-ui/src/components/account/info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<hint-btn hint="Create transaction/invoice">
<v-chip @click="openTransaction" class="ma-1" color="primary" outlined
>Balance: {{ account.balance?.toFixed(2) || 0 }}
{{ account.currency?.title }}</v-chip
{{ account.currency?.code }}</v-chip
>
</hint-btn>
</div>
Expand Down Expand Up @@ -509,7 +509,7 @@ export default {
);
},
isCurrencyReadonly() {
return this.account.currency && this.account.currency.title !== "NCU";
return this.account.currency && this.account.currency.code !== "NCU";
},
isLocked() {
return this.account.status !== "ACTIVE";
Expand Down
4 changes: 2 additions & 2 deletions admin-ui/src/components/dialogs/editPriceModel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
</v-col>
<v-col v-if="accountRate">
<v-text-field
:suffix="accountCurrency?.title"
:suffix="accountCurrency?.code"
readonly
:value="isSelectedPlanAvailable ? accountPrice : null"
label="account price"
/>
</v-col>
<v-col>
<v-text-field
:suffix="defaultCurrency?.title"
:suffix="defaultCurrency?.code"
readonly
:value="isSelectedPlanAvailable ? fullProduct?.price : null"
label="price"
Expand Down
19 changes: 8 additions & 11 deletions admin-ui/src/components/instancesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@

<template v-slot:[`item.estimate`]="{ item }">
<template v-if="item.estimate">
{{ item.estimate }} {{ defaultCurrency?.title }}
{{ item.estimate }} {{ defaultCurrency?.code }}
</template>
<template v-else> - </template>
</template>
Expand All @@ -166,7 +166,7 @@
getAccount(item.account)?.currency
)
}}
{{ getAccount(item.account)?.currency?.title }}
{{ getAccount(item.account)?.currency?.code }}
</template>
<template v-else> - </template>
</span>
Expand All @@ -175,15 +175,11 @@
</template>

<template v-slot:[`item.balance`]="{ item }">
<span v-if="!isAccountsLoading">
{{
formatPrice(
getAccount(item.account)?.balance || 0,
getAccount(item.account)?.currency
)
}}
{{ getAccount(item.account)?.currency?.title }}
</span>
<balance
v-if="!isAccountsLoading"
:currency="getAccount(item.account)?.currency"
:value="getAccount(item.account)?.balance || 0"
/>

<v-skeleton-loader type="text" v-else />
</template>
Expand All @@ -209,6 +205,7 @@ import LoginInAccountIcon from "@/components/ui/loginInAccountIcon.vue";
import InstanceState from "@/components/ui/instanceState.vue";
import useCurrency from "@/hooks/useCurrency";
import AccountsAutocomplete from "@/components/ui/accountsAutocomplete.vue";
import Balance from "./balance.vue";
import useSearch from "@/hooks/useSearch";
import { UpdateRequest } from "nocloud-proto/proto/es/instances/instances_pb";
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/src/components/invoiceItemsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
type="number"
:rules="!readonly ? generalRule : []"
:readonly="readonly"
:suffix="accountCurrency?.title"
:suffix="accountCurrency?.code"
v-model.number="item.price"
/>
</template>
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/src/components/invoicesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<v-chip :color="getTotalColor(item)" abs>
{{
`${formatPrice(item.total, item.currency)} ${
item.currency?.title || defaultCurrency.title
item.currency?.code || defaultCurrency.code
}`
}}
</v-chip>
Expand Down
8 changes: 4 additions & 4 deletions admin-ui/src/components/modules/cpanel/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@
<v-text-field
class="mr-2"
v-model="item.price"
:suffix="defaultCurrency?.title"
:suffix="defaultCurrency?.code"
@input="updatePrice(item, false)"
append-icon="mdi-pencil"
/>
<v-text-field
class="ml-2"
:suffix="accountCurrency?.title"
:suffix="accountCurrency?.code"
style="color: var(--v-primary-base)"
v-model="item.accountPrice"
@input="updatePrice(item, true)"
Expand Down Expand Up @@ -136,14 +136,14 @@
{{
[
formatPrice(totalPrice, defaultCurrency),
defaultCurrency?.title,
defaultCurrency?.code,
].join(" ")
}}
/
{{
[
formatPrice(totalAccountPrice, accountCurrency),
accountCurrency?.title,
accountCurrency?.code,
].join(" ")
}}
</v-chip>
Expand Down
8 changes: 4 additions & 4 deletions admin-ui/src/components/modules/empty/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@
<v-text-field
class="mr-2"
v-model="item.price"
:suffix="defaultCurrency?.title"
:suffix="defaultCurrency?.code"
@input="updatePrice(item, false)"
append-icon="mdi-pencil"
/>
<v-text-field
class="ml-2"
:suffix="accountCurrency?.title"
:suffix="accountCurrency?.code"
style="color: var(--v-primary-base)"
v-model="item.accountPrice"
@input="updatePrice(item, true)"
Expand Down Expand Up @@ -161,14 +161,14 @@
{{
[
formatPrice(totalPrice, defaultCurrency),
defaultCurrency?.title,
defaultCurrency?.code,
].join(" ")
}}
/
{{
[
formatPrice(totalAccountPrice, accountCurrency),
accountCurrency?.title,
accountCurrency?.code,
].join(" ")
}}
</v-chip>
Expand Down
12 changes: 6 additions & 6 deletions admin-ui/src/components/modules/ione/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<div class="d-flex">
<v-text-field
class="mr-2"
:suffix="defaultCurrency?.title"
:suffix="defaultCurrency?.code"
v-model="item.price"
type="number"
@input="updatePrice(item, false)"
Expand All @@ -97,7 +97,7 @@
style="color: var(--v-primary-base)"
class="ml-2"
type="number"
:suffix="accountCurrency?.title"
:suffix="accountCurrency?.code"
v-model="item.accountPrice"
@input="updatePrice(item, true)"
append-icon="mdi-pencil"
Expand All @@ -109,9 +109,9 @@
</template>
<template v-slot:[`item.total`]="{ item }">
{{ formatPrice(totalPrices[item.name], defaultCurrency) }}
{{ defaultCurrency?.title }} /
{{ defaultCurrency?.code }} /
{{ formatPrice(totalAccountPrices[item.name], accountCurrency) }}
{{ accountCurrency?.title }}
{{ accountCurrency?.code }}
</template>
<template v-slot:body.append>
<tr>
Expand Down Expand Up @@ -146,8 +146,8 @@
<td>
<v-chip color="primary" outlined>
{{ totalPrice }}
{{ defaultCurrency?.title }} / {{ totalAccountPrice }}
{{ accountCurrency?.title }}
{{ defaultCurrency?.code }} / {{ totalAccountPrice }}
{{ accountCurrency?.code }}
</v-chip>
</td>
</tr>
Expand Down
8 changes: 4 additions & 4 deletions admin-ui/src/components/modules/keyweb/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@
<v-text-field
class="mr-2"
v-model="item.price"
:suffix="defaultCurrency?.title"
:suffix="defaultCurrency?.code"
@input="updatePrice(item, false)"
append-icon="mdi-pencil"
/>
<v-text-field
class="ml-2"
:suffix="accountCurrency?.title"
:suffix="accountCurrency?.code"
style="color: var(--v-primary-base)"
v-model="item.accountPrice"
@input="updatePrice(item, true)"
Expand Down Expand Up @@ -129,14 +129,14 @@
{{
[
formatPrice(totalPrice, defaultCurrency),
defaultCurrency?.title,
defaultCurrency?.code,
].join(" ")
}}
/
{{
[
formatPrice(totalAccountPrice, accountCurrency),
accountCurrency?.title,
accountCurrency?.code,
].join(" ")
}}
</v-chip>
Expand Down
4 changes: 2 additions & 2 deletions admin-ui/src/components/modules/openai/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
>
<template v-slot:[`item.price`]="{ item }">
<v-text-field
:suffix="defaultCurrency?.title"
:suffix="defaultCurrency?.code"
v-model="item.price"
@input="updatePrice(item, false)"
append-icon="mdi-pencil"
/>
</template>
<template v-slot:[`item.accountPrice`]="{ item }">
<v-text-field
:suffix="accountCurrency?.title"
:suffix="accountCurrency?.code"
style="color: var(--v-primary-base)"
v-model="item.accountPrice"
@input="updatePrice(item, true)"
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/src/components/modules/openai/billingLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
outlined
v-for="price in pricesPerToken"
:key="price.name"
>{{ price.name }} : {{ price.price }} {{ accountCurrency?.title }}</v-chip
>{{ price.name }} : {{ price.price }} {{ accountCurrency?.code }}</v-chip
>
</v-col>
</v-row>
Expand Down
12 changes: 6 additions & 6 deletions admin-ui/src/components/modules/opensrs/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<div class="d-flex">
<v-text-field
class="mr-2"
:suffix="defaultCurrency?.title"
:suffix="defaultCurrency?.code"
v-model="item.price"
type="number"
@input="updatePrice(item, false)"
Expand All @@ -83,7 +83,7 @@
style="color: var(--v-primary-base)"
class="ml-2"
type="number"
:suffix="accountCurrency?.title"
:suffix="accountCurrency?.code"
v-model="item.accountPrice"
@input="updatePrice(item, true)"
append-icon="mdi-pencil"
Expand All @@ -92,9 +92,9 @@
</template>
<template v-slot:[`item.total`]="{ item }">
{{ formatPrice(totalPrices[item.name], defaultCurrency) }}
{{ defaultCurrency?.title }} /
{{ defaultCurrency?.code }} /
{{ formatPrice(totalAccountPrices[item.name], accountCurrency) }}
{{ accountCurrency?.title }}
{{ accountCurrency?.code }}
</template>
<template v-slot:body.append>
<tr>
Expand All @@ -109,9 +109,9 @@
<div class="d-flex justify-end">
<v-chip color="primary" outlined>
{{ formatPrice(totalPrice, defaultCurrency) }}
{{ defaultCurrency?.title }} /
{{ defaultCurrency?.code }} /
{{ formatPrice(totalAccountPrice, accountCurrency) }}
{{ accountCurrency?.title }}
{{ accountCurrency?.code }}
</v-chip>
</div>
</td>
Expand Down
8 changes: 4 additions & 4 deletions admin-ui/src/components/modules/ovh/billingInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
class="mr-2"
v-model="item.price"
@change="onUpdatePrice(item, false)"
:suffix="defaultCurrency?.title"
:suffix="defaultCurrency?.code"
type="number"
append-icon="mdi-pencil"
></v-text-field>
Expand All @@ -93,7 +93,7 @@
style="color: var(--v-primary-base)"
v-model="item.accountPrice"
@change="onUpdatePrice(item, true)"
:suffix="accountCurrency?.title"
:suffix="accountCurrency?.code"
type="number"
append-icon="mdi-pencil"
></v-text-field>
Expand Down Expand Up @@ -140,14 +140,14 @@
{{
[
formatPrice(totalNewPrice, defaultCurrency),
defaultCurrency?.title,
defaultCurrency?.code,
].join(" ")
}}
/
{{
[
formatPrice(accountTotalNewPrice, accountCurrency),
accountCurrency?.title,
accountCurrency?.code,
].join(" ")
}}
</v-chip>
Expand Down
4 changes: 2 additions & 2 deletions admin-ui/src/components/plan/cloudTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
<template v-slot:[`item.endPrice`]="{ item }">
<v-text-field
style="width: 200px"
:suffix="defaultCurrency?.title"
:suffix="defaultCurrency?.code"
v-model.number="item.endPrice"
type="number"
/>
</template>
<template v-slot:[`item.price`]="{ value }">
{{ formatPrice(value, defaultCurrency) }}
{{ defaultCurrency?.title }}
{{ defaultCurrency?.code }}
</template>
<template v-slot:[`item.gpu.model`]="{ item }">
<template v-if="item.gpu.model !== ''">
Expand Down
Loading

0 comments on commit bb3cb00

Please sign in to comment.