update doc - pg

This commit is contained in:
jingrow 2025-12-23 19:23:49 +08:00
parent e3fc0a705a
commit 913ca59f8c
733 changed files with 5419 additions and 5419 deletions

View File

@ -47,7 +47,7 @@ dpkg --list \
# delete docs packages # delete docs packages
dpkg --list \ dpkg --list \
| awk '{ print $2 }' \ | awk '{ print $2 }' \
| grep -- '-doc$' \ | grep -- '-pg$' \
| xargs apt-get -y purge | xargs apt-get -y purge
# Delete X11 libraries # Delete X11 libraries
@ -64,13 +64,13 @@ echo "==> Setup dpkg excludes for linux-firmware"
cat <<_EOF_ | cat >> /etc/dpkg/dpkg.cfg.d/excludes cat <<_EOF_ | cat >> /etc/dpkg/dpkg.cfg.d/excludes
#BENTO-BEGIN #BENTO-BEGIN
path-exclude=/lib/firmware/* path-exclude=/lib/firmware/*
path-exclude=/usr/share/doc/linux-firmware/* path-exclude=/usr/share/pg/linux-firmware/*
#BENTO-END #BENTO-END
_EOF_ _EOF_
# Delete the massive firmware packages # Delete the massive firmware packages
rm -rf /lib/firmware/* rm -rf /lib/firmware/*
rm -rf /usr/share/doc/linux-firmware/* rm -rf /usr/share/pg/linux-firmware/*
# Clean up orphaned packages with deborphan # Clean up orphaned packages with deborphan
apt-get -y install deborphan apt-get -y install deborphan
@ -85,7 +85,7 @@ apt-get -y autoclean
apt-get -y clean apt-get -y clean
# Remove docs # Remove docs
rm -rf /usr/share/doc/* rm -rf /usr/share/pg/*
# Remove man pages # Remove man pages
rm -rf /usr/share/man/* rm -rf /usr/share/man/*

View File

@ -68,7 +68,7 @@ const isHideSidebar = computed(() => {
return true; return true;
return ( return (
route.meta.hideSidebar && session.user && team?.doc?.hide_sidebar === true route.meta.hideSidebar && session.user && team?.pg?.hide_sidebar === true
); );
}); });

View File

@ -34,14 +34,14 @@ import AccessRequestStatusDialog from './AccessRequestStatusDialog.vue';
const props = defineProps<{ const props = defineProps<{
doctype: string; doctype: string;
docname: string; docname: string;
doc?: any; pg?: any;
error?: Error; error?: Error;
}>(); }>();
const team = getTeam(); const team = getTeam();
const buttonProps = computed(() => { const buttonProps = computed(() => {
if (props.doc) { if (props.pg) {
return { return {
label: '', label: '',
icon: 'unlock', icon: 'unlock',
@ -63,11 +63,11 @@ const isPermissionError = computed(() => {
}); });
const canRequestAccess = computed(() => { const canRequestAccess = computed(() => {
return Boolean(team.doc?.can_request_access); return Boolean(team.pg?.can_request_access);
}); });
const isOwner = computed(() => { const isOwner = computed(() => {
return props.doc?.team === team.doc?.name; return props.pg?.team === team.pg?.name;
}); });
const hasAccess = computed(() => { const hasAccess = computed(() => {
@ -75,7 +75,7 @@ const hasAccess = computed(() => {
}); });
const DialogComponent = computed(() => { const DialogComponent = computed(() => {
if (props.doc) { if (props.pg) {
return AccessRequestStatusDialog; return AccessRequestStatusDialog;
} else { } else {
return AccessRequestDialog; return AccessRequestDialog;

View File

@ -112,7 +112,7 @@ const request = createResource({
); );
return { return {
doc: { pg: {
doctype: 'Support Access', doctype: 'Support Access',
reason: reason.value, reason: reason.value,
resources: [ resources: [

View File

@ -68,9 +68,9 @@ export default {
methods: { methods: {
addNewTag(value) { addNewTag(value) {
if (!value) return; if (!value) return;
let $doc = getCachedDocumentResource(this.doctype, this.docname); let $pg = getCachedDocumentResource(this.doctype, this.docname);
if (!$doc) return; if (!$pg) return;
return $doc.addTag.submit({ tag: value }).then(() => { return $pg.addTag.submit({ tag: value }).then(() => {
this.$emit('added', value); this.$emit('added', value);
this.show = false; this.show = false;
}); });

View File

@ -68,7 +68,7 @@ export default {
url: 'press.api.account.country_list', url: 'press.api.account.country_list',
auto: true, auto: true,
onSuccess() { onSuccess() {
let userCountry = this.$team?.doc.country; let userCountry = this.$team?.pg.country;
if (userCountry) { if (userCountry) {
let country = this.countryList.find((d) => d.label === userCountry); let country = this.countryList.find((d) => d.label === userCountry);
if (country) { if (country) {

View File

@ -1,21 +1,21 @@
<template> <template>
<Dialog v-if="doc" v-model="show"> <Dialog v-if="pg" v-model="show">
<!-- Title --> <!-- Title -->
<template v-slot:body-title> <template v-slot:body-title>
<h1 class="font-semibold"> <h1 class="font-semibold">
{{ doc.title }} {{ pg.title }}
</h1> </h1>
</template> </template>
<!-- Message and Traceback --> <!-- Message and Traceback -->
<template v-slot:body-content> <template v-slot:body-content>
<div <div
:if="doc.message" :if="pg.message"
v-html="doc.message" v-html="pg.message"
class="flex flex-col gap-2 whitespace-pre-wrap text-p-base text-gray-700" class="flex flex-col gap-2 whitespace-pre-wrap text-p-base text-gray-700"
></div> ></div>
<div v-if="doc.traceback" class="relative mt-6"> <div v-if="pg.traceback" class="relative mt-6">
<button <button
class="absolute right-2 top-2 rounded-sm border border-gray-200 bg-white p-1 text-xs text-gray-600" class="absolute right-2 top-2 rounded-sm border border-gray-200 bg-white p-1 text-xs text-gray-600"
variant="outline" variant="outline"
@ -26,7 +26,7 @@
<div <div
class="max-h-48 w-full overflow-scroll rounded-sm border border-gray-200 bg-gray-100 p-3 text-xs text-gray-600" class="max-h-48 w-full overflow-scroll rounded-sm border border-gray-200 bg-gray-100 p-3 text-xs text-gray-600"
> >
<pre>{{ doc.traceback }}</pre> <pre>{{ pg.traceback }}</pre>
</div> </div>
</div> </div>
@ -36,12 +36,12 @@
<!-- Help and Done --> <!-- Help and Done -->
<template v-slot:actions> <template v-slot:actions>
<div class="flex justify-end gap-5"> <div class="flex justify-end gap-5">
<Link v-if="doc.assistance_url" class="cursor-pointer" @click="help"> <Link v-if="pg.assistance_url" class="cursor-pointer" @click="help">
Help Help
</Link> </Link>
<Button <Button
v-if="!doc.is_addressed" v-if="!pg.is_addressed"
variant="solid" variant="solid"
class="w-40" class="w-40"
@click="done" @click="done"
@ -86,18 +86,18 @@ export default {
}, },
}, },
computed: { computed: {
doc() { pg() {
return this.$resources.notification.doc ?? null; return this.$resources.notification.pg ?? null;
}, },
}, },
methods: { methods: {
async copyTraceback() { async copyTraceback() {
await navigator.clipboard.writeText(this.doc.traceback); await navigator.clipboard.writeText(this.pg.traceback);
this.copied = true; this.copied = true;
setTimeout(() => (this.copied = false), 4000); setTimeout(() => (this.copied = false), 4000);
}, },
async done() { async done() {
if (this.doc.assistance_url && !this.helpViewed) { if (this.pg.assistance_url && !this.helpViewed) {
this.error = this.error =
'Please follow the steps mentioned in <i>Help</i> before clicking Done'; 'Please follow the steps mentioned in <i>Help</i> before clicking Done';
return; return;
@ -110,7 +110,7 @@ export default {
help() { help() {
this.error = ''; this.error = '';
this.helpViewed = true; this.helpViewed = true;
window.open(this.doc.assistance_url, '_blank'); window.open(this.pg.assistance_url, '_blank');
}, },
}, },
}; };

View File

@ -9,7 +9,7 @@
label: 'Change Team', label: 'Change Team',
icon: 'command', icon: 'command',
condition: () => condition: () =>
$team?.doc?.valid_teams?.length > 1 || $team?.doc?.is_desk_user, $team?.pg?.valid_teams?.length > 1 || $team?.pg?.is_desk_user,
onClick: () => (showTeamSwitcher = true), onClick: () => (showTeamSwitcher = true),
}, },
{ {
@ -39,11 +39,11 @@
<div class="text-base font-medium leading-none text-gray-900"> <div class="text-base font-medium leading-none text-gray-900">
Frappe Cloud Frappe Cloud
</div> </div>
<Tooltip :text="$team?.doc?.user || null"> <Tooltip :text="$team?.pg?.user || null">
<div <div
class="mt-1 hidden overflow-hidden text-ellipsis whitespace-nowrap pb-1 text-sm leading-none text-gray-700 sm:inline" class="mt-1 hidden overflow-hidden text-ellipsis whitespace-nowrap pb-1 text-sm leading-none text-gray-700 sm:inline"
> >
{{ $team?.get.loading ? 'Loading...' : $team?.doc?.user }} {{ $team?.get.loading ? 'Loading...' : $team?.pg?.user }}
</div> </div>
</Tooltip> </Tooltip>
</div> </div>

View File

@ -11,14 +11,14 @@
> >
<template #prefix> <template #prefix>
<div class="grid w-4 place-items-center text-sm text-gray-700"> <div class="grid w-4 place-items-center text-sm text-gray-700">
{{ $team.doc.currency === 'INR' ? '₹' : '$' }} {{ $team.pg.currency === 'INR' ? '₹' : '$' }}
</div> </div>
</template> </template>
</FormControl> </FormControl>
<FormControl <FormControl
v-if="$team.doc.currency === 'INR'" v-if="$team.pg.currency === 'INR'"
:label="`Total Amount + GST (${ :label="`Total Amount + GST (${
$team.doc?.billing_info.gst_percentage * 100 $team.pg?.billing_info.gst_percentage * 100
}%)`" }%)`"
disabled disabled
:modelValue="totalAmount" :modelValue="totalAmount"
@ -28,7 +28,7 @@
> >
<template #prefix> <template #prefix>
<div class="grid w-4 place-items-center text-sm text-gray-700"> <div class="grid w-4 place-items-center text-sm text-gray-700">
{{ $team.doc.currency === 'INR' ? '₹' : '$' }} {{ $team.pg.currency === 'INR' ? '₹' : '$' }}
</div> </div>
</template> </template>
</FormControl> </FormControl>
@ -38,7 +38,7 @@
<div class="text-xs text-gray-600">Select Payment Gateway</div> <div class="text-xs text-gray-600">Select Payment Gateway</div>
<div class="mt-1.5 grid grid-cols-1 gap-2 sm:grid-cols-2"> <div class="mt-1.5 grid grid-cols-1 gap-2 sm:grid-cols-2">
<button <button
v-if="$team.doc.currency === 'INR' || $team.doc.razorpay_enabled" v-if="$team.pg.currency === 'INR' || $team.pg.razorpay_enabled"
@click="paymentGateway = 'Razorpay'" @click="paymentGateway = 'Razorpay'"
label="Razorpay" label="Razorpay"
class="flex h-10 items-center justify-center rounded border" class="flex h-10 items-center justify-center rounded border"
@ -105,7 +105,7 @@ export default {
}; };
}, },
mounted() { mounted() {
if (this.$team.doc.currency === 'USD' && !this.$team.doc.razorpay_enabled) { if (this.$team.pg.currency === 'USD' && !this.$team.pg.razorpay_enabled) {
this.paymentGateway = 'Stripe'; this.paymentGateway = 'Stripe';
} }
}, },
@ -131,10 +131,10 @@ export default {
computed: { computed: {
totalAmount() { totalAmount() {
let creditsToBuy = this.creditsToBuy || 0; let creditsToBuy = this.creditsToBuy || 0;
if (this.$team.doc.currency === 'INR') { if (this.$team.pg.currency === 'INR') {
return ( return (
creditsToBuy + creditsToBuy +
creditsToBuy * (this.$team.doc.billing_info.gst_percentage || 0) creditsToBuy * (this.$team.pg.billing_info.gst_percentage || 0)
).toFixed(2); ).toFixed(2);
} else { } else {
return creditsToBuy; return creditsToBuy;

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<p v-if="$team.doc.currency === 'INR'" class="mt-3 text-p-sm"> <p v-if="$team.pg.currency === 'INR'" class="mt-3 text-p-sm">
If you select Razorpay, you can pay using Credit Card, Debit Card, Net If you select Razorpay, you can pay using Credit Card, Debit Card, Net
Banking, UPI, Wallets, etc. If you are using Net Banking, it may take upto Banking, UPI, Wallets, etc. If you are using Net Banking, it may take upto
5 days for balance to reflect. 5 days for balance to reflect.
@ -101,7 +101,7 @@ export default {
name: 'Frappe Cloud', name: 'Frappe Cloud',
image: '/assets/press/images/frappe-cloud-logo.png', image: '/assets/press/images/frappe-cloud-logo.png',
prefill: { prefill: {
email: this.$team.doc.user, email: this.$team.pg.user,
}, },
handler: this.handlePaymentSuccess, handler: this.handlePaymentSuccess,
theme: { color: '#171717' }, theme: { color: '#171717' },
@ -132,7 +132,7 @@ export default {
async checkForOnboardingPaymentCompletion() { async checkForOnboardingPaymentCompletion() {
this.isVerifyingPayment = true; this.isVerifyingPayment = true;
await this.$team.reload(); await this.$team.reload();
if (!this.$team.doc.payment_mode) { if (!this.$team.pg.payment_mode) {
setTimeout(this.checkForOnboardingPaymentCompletion, 2000); setTimeout(this.checkForOnboardingPaymentCompletion, 2000);
} else { } else {
this.isVerifyingPayment = false; this.isVerifyingPayment = false;

View File

@ -83,7 +83,7 @@ export default {
validate() { validate() {
if ( if (
this.amount < this.minimumAmount && this.amount < this.minimumAmount &&
!this.$team.doc.erpnext_partner !this.$team.pg.erpnext_partner
) { ) {
throw new DashboardError( throw new DashboardError(
`Amount must be greater than or equal to ${this.minimumAmount}`, `Amount must be greater than or equal to ${this.minimumAmount}`,
@ -165,7 +165,7 @@ export default {
totalAmount() { totalAmount() {
let { currency, billing_info } = this.$account let { currency, billing_info } = this.$account
? this.$account.team ? this.$account.team
: this.$team.doc; : this.$team.pg;
if (currency === 'INR') { if (currency === 'INR') {
return Number( return Number(
( (

View File

@ -111,7 +111,7 @@ export default {
resources: { resources: {
getCommunicationInfos() { getCommunicationInfos() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: this.referenceDoctype, dt: this.referenceDoctype,
@ -127,7 +127,7 @@ export default {
}, },
updateCommunicationInfos() { updateCommunicationInfos() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: this.referenceDoctype, dt: this.referenceDoctype,

View File

@ -109,7 +109,7 @@ export default {
banners() { banners() {
return { return {
url: 'press.api.account.get_user_banners', url: 'press.api.account.get_user_banners',
auto: !!this.$team?.doc, auto: !!this.$team?.pg,
onSuccess: (data) => { onSuccess: (data) => {
try { try {
const parsed = JSON.parse( const parsed = JSON.parse(

View File

@ -33,14 +33,14 @@ export default {
name: 'HomeSummary', name: 'HomeSummary',
resources: { resources: {
home() { home() {
if (!this.$team.doc?.name) return; if (!this.$team.pg?.name) return;
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
cache: ['home_data', this.$team.doc.name], cache: ['home_data', this.$team.pg.name],
makeParams() { makeParams() {
return { return {
dt: 'Team', dt: 'Team',
dn: this.$team.doc.name, dn: this.$team.pg.name,
method: 'get_home_data', method: 'get_home_data',
}; };
}, },

View File

@ -9,7 +9,7 @@
<span class="text-sm">Download as CSV</span> <span class="text-sm">Download as CSV</span>
</Button> </Button>
</div> </div>
<div v-if="doc" class="overflow-x-auto"> <div v-if="pg" class="overflow-x-auto">
<table <table
class="text w-full border-separate border-spacing-y-2 text-base font-normal text-gray-900" class="text w-full border-separate border-spacing-y-2 text-base font-normal text-gray-900"
> >
@ -61,17 +61,17 @@
</template> </template>
</tbody> </tbody>
<tfoot> <tfoot>
<tr v-if="doc.total_discount_amount > 0"> <tr v-if="pg.total_discount_amount > 0">
<td></td> <td></td>
<td></td> <td></td>
<td class="pb-2 pr-2 pt-4 text-right font-medium"> <td class="pb-2 pr-2 pt-4 text-right font-medium">
Total Without Discount Total Without Discount
</td> </td>
<td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium"> <td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium">
{{ formatCurrency(doc.total_before_discount) }} {{ formatCurrency(pg.total_before_discount) }}
</td> </td>
</tr> </tr>
<tr v-if="doc.total_discount_amount > 0"> <tr v-if="pg.total_discount_amount > 0">
<td></td> <td></td>
<td></td> <td></td>
<td class="pb-2 pr-2 pt-4 text-right font-medium"> <td class="pb-2 pr-2 pt-4 text-right font-medium">
@ -79,30 +79,30 @@
</td> </td>
<td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium"> <td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium">
{{ {{
$team.doc.erpnext_partner $team.pg.erpnext_partner
? formatCurrency(doc.total_discount_amount) ? formatCurrency(pg.total_discount_amount)
: formatCurrency(0) : formatCurrency(0)
}} }}
</td> </td>
</tr> </tr>
<tr v-if="doc.gst > 0"> <tr v-if="pg.gst > 0">
<td></td> <td></td>
<td></td> <td></td>
<td class="pb-2 pr-2 pt-4 text-right font-medium"> <td class="pb-2 pr-2 pt-4 text-right font-medium">
Total (Without Tax) Total (Without Tax)
</td> </td>
<td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium"> <td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium">
{{ formatCurrency(doc.total) }} {{ formatCurrency(pg.total) }}
</td> </td>
</tr> </tr>
<tr v-if="doc.gst > 0"> <tr v-if="pg.gst > 0">
<td></td> <td></td>
<td></td> <td></td>
<td class="pb-2 pr-2 pt-4 text-right font-medium"> <td class="pb-2 pr-2 pt-4 text-right font-medium">
IGST @ {{ Number(gstPercentage * 100) }}% IGST @ {{ Number(gstPercentage * 100) }}%
</td> </td>
<td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium"> <td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium">
{{ doc.gst }} {{ pg.gst }}
</td> </td>
</tr> </tr>
<tr> <tr>
@ -110,13 +110,13 @@
<td></td> <td></td>
<td class="pb-2 pr-2 pt-4 text-right font-medium">Grand Total</td> <td class="pb-2 pr-2 pt-4 text-right font-medium">Grand Total</td>
<td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium"> <td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium">
{{ formatCurrency(doc.total + doc.gst) }} {{ formatCurrency(pg.total + pg.gst) }}
</td> </td>
</tr> </tr>
<template <template
v-if=" v-if="
doc.total !== doc.amount_due && pg.total !== pg.amount_due &&
['Paid', 'Unpaid'].includes(doc.status) ['Paid', 'Unpaid'].includes(pg.status)
" "
> >
<tr> <tr>
@ -124,7 +124,7 @@
<td></td> <td></td>
<td class="pr-2 text-right font-medium">Applied Balance</td> <td class="pr-2 text-right font-medium">Applied Balance</td>
<td class="whitespace-nowrap py-3 pr-2 text-right font-medium"> <td class="whitespace-nowrap py-3 pr-2 text-right font-medium">
- {{ formatCurrency(doc.applied_credits) }} - {{ formatCurrency(pg.applied_credits) }}
</td> </td>
</tr> </tr>
<tr> <tr>
@ -132,7 +132,7 @@
<td></td> <td></td>
<td class="pr-2 text-right font-medium">Amount Due</td> <td class="pr-2 text-right font-medium">Amount Due</td>
<td class="whitespace-nowrap py-3 pr-2 text-right font-medium"> <td class="whitespace-nowrap py-3 pr-2 text-right font-medium">
{{ formatCurrency(doc.amount_due) }} {{ formatCurrency(pg.amount_due) }}
</td> </td>
</tr> </tr>
</template> </template>
@ -175,27 +175,27 @@ export default {
}, },
computed: { computed: {
groupedLineItems() { groupedLineItems() {
if (!this.doc) return {}; if (!this.pg) return {};
const groupedLineItems = {}; const groupedLineItems = {};
for (let item of this.doc.items) { for (let item of this.pg.items) {
groupedLineItems[item.document_type] = groupedLineItems[item.document_type] =
groupedLineItems[item.document_type] || []; groupedLineItems[item.document_type] || [];
groupedLineItems[item.document_type].push(item); groupedLineItems[item.document_type].push(item);
} }
return groupedLineItems; return groupedLineItems;
}, },
doc() { pg() {
return this.$resources.invoice.doc; return this.$resources.invoice.pg;
}, },
gstPercentage() { gstPercentage() {
return this.$team.doc.billing_info.gst_percentage; return this.$team.pg.billing_info.gst_percentage;
}, },
}, },
methods: { methods: {
formatPlan(plan) { formatPlan(plan) {
let planDoc = getPlans().find((p) => p.name === plan); let planDoc = getPlans().find((p) => p.name === plan);
if (planDoc) { if (planDoc) {
let india = this.$team.doc.currency === 'INR'; let india = this.$team.pg.currency === 'INR';
return this.$format.userCurrency( return this.$format.userCurrency(
india ? planDoc.price_inr : planDoc.price_usd, india ? planDoc.price_inr : planDoc.price_usd,
); );
@ -203,8 +203,8 @@ export default {
return plan; return plan;
}, },
formatCurrency(value) { formatCurrency(value) {
if (!this.doc) return; if (!this.pg) return;
let currency = this.doc.currency; let currency = this.pg.currency;
return this.$format.currency(value, currency); return this.$format.currency(value, currency);
}, },
downloadAsCSV(data, filename) { downloadAsCSV(data, filename) {

View File

@ -24,8 +24,8 @@
/> />
<SitePlansCards <SitePlansCards
v-model="plan" v-model="plan"
:isPrivateBenchSite="!$site.doc.group_public" :isPrivateBenchSite="!$site.pg.group_public"
:isDedicatedServerSite="$site.doc.is_dedicated_server" :isDedicatedServerSite="$site.pg.is_dedicated_server"
/> />
<div class="mt-4 text-xs text-gray-700"> <div class="mt-4 text-xs text-gray-700">
<div <div
@ -121,7 +121,7 @@
<PrepaidCreditsForm <PrepaidCreditsForm
v-else v-else
:minimumAmount=" :minimumAmount="
$team.doc?.currency === 'INR' ? plan.price_inr : plan.price_usd $team.pg?.currency === 'INR' ? plan.price_inr : plan.price_usd
" "
:type="'Purchase Plan'" :type="'Purchase Plan'"
:docName="plan.name" :docName="plan.name"
@ -132,16 +132,16 @@
<template #actions v-if="step === 'site-plans'"> <template #actions v-if="step === 'site-plans'">
<Button <Button
variant="solid" variant="solid"
:disabled="!plan || ($site?.doc && plan === $site.doc.plan)" :disabled="!plan || ($site?.pg && plan === $site.pg.plan)"
@click="handleNext()" @click="handleNext()"
class="w-full" class="w-full"
> >
{{ {{
!$team.doc.payment_mode || !$team.pg.payment_mode ||
!$team.doc.billing_details || !$team.pg.billing_details ||
!Object.keys(this.$team.doc.billing_details).length !Object.keys(this.$team.pg.billing_details).length
? 'Next' ? 'Next'
: $site.doc?.current_plan?.is_trial_plan : $site.pg?.current_plan?.is_trial_plan
? 'Upgrade Plan' ? 'Upgrade Plan'
: 'Change plan' : 'Change plan'
}} }}
@ -187,8 +187,8 @@ export default {
immediate: true, immediate: true,
handler(siteName) { handler(siteName) {
if (siteName) { if (siteName) {
if (this.$site?.doc?.plan) { if (this.$site?.pg?.plan) {
this.plan = getPlan(this.$site.doc.plan); this.plan = getPlan(this.$site.pg.plan);
} }
} }
}, },
@ -197,12 +197,12 @@ export default {
methods: { methods: {
handleNext() { handleNext() {
if ( if (
!this.$team.doc.billing_details || !this.$team.pg.billing_details ||
!Object.keys(this.$team.doc.billing_details).length !Object.keys(this.$team.pg.billing_details).length
) { ) {
this.step = 'billing-details'; this.step = 'billing-details';
this.$team.reload(); this.$team.reload();
} else if (!this.$team.doc.payment_mode) { } else if (!this.$team.pg.payment_mode) {
this.step = 'add-payment-mode'; this.step = 'add-payment-mode';
} else { } else {
this.changePlan(); this.changePlan();
@ -215,11 +215,11 @@ export default {
onSuccess: () => { onSuccess: () => {
this.show = false; this.show = false;
let plan = getPlans().find( let plan = getPlans().find(
(plan) => plan.name === this.$site.doc.plan, (plan) => plan.name === this.$site.pg.plan,
); );
let formattedPlan = plan let formattedPlan = plan
? `${this.$format.planTitle(plan)}/mo` ? `${this.$format.planTitle(plan)}/mo`
: this.$site.doc.plan; : this.$site.pg.plan;
this.$toast.success(`Plan changed to ${formattedPlan}`); this.$toast.success(`Plan changed to ${formattedPlan}`);
}, },
}, },
@ -240,9 +240,9 @@ export default {
}, },
showSetupSubscription() { showSetupSubscription() {
return ( return (
!this.$team.doc.payment_mode || !this.$team.pg.payment_mode ||
!this.$team.doc.billing_details || !this.$team.pg.billing_details ||
!Object.keys(this.$team.doc.billing_details).length !Object.keys(this.$team.pg.billing_details).length
); );
}, },
progressLabel() { progressLabel() {

View File

@ -22,7 +22,7 @@
<Avatar <Avatar
size="3xl" size="3xl"
shape="square" shape="square"
:label="app.doc.title" :label="app.pg.title"
:image="profileImageUrl" :image="profileImageUrl"
/> />
</div> </div>
@ -32,7 +32,7 @@
fileTypes="image/*" fileTypes="image/*"
:upload-args="{ :upload-args="{
doctype: 'Marketplace App', doctype: 'Marketplace App',
docname: app.doc.name, docname: app.pg.name,
method: 'press.api.marketplace.update_app_image', method: 'press.api.marketplace.update_app_image',
}" }"
> >
@ -198,7 +198,7 @@ export default {
editing: false, editing: false,
editable: true, editable: true,
marketplaceApp: { marketplaceApp: {
title: this.app.doc.title, title: this.app.pg.title,
website: '', website: '',
support: '', support: '',
documentation: '', documentation: '',
@ -212,11 +212,11 @@ export default {
resources: { resources: {
updateListing() { updateListing() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: 'Marketplace App', dt: 'Marketplace App',
dn: this.app.doc.name, dn: this.app.pg.name,
method: 'update_listing', method: 'update_listing',
args: this.marketplaceApp, args: this.marketplaceApp,
}; };
@ -225,11 +225,11 @@ export default {
}, },
listingData() { listingData() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: 'Marketplace App', dt: 'Marketplace App',
dn: this.app.doc.name, dn: this.app.pg.name,
method: 'listing_details', method: 'listing_details',
}; };
}, },
@ -278,7 +278,7 @@ export default {
onClick: () => { onClick: () => {
toast.promise( toast.promise(
this.$resources.removeScreenshot.submit({ this.$resources.removeScreenshot.submit({
name: this.app.doc.name, name: this.app.pg.name,
file: image, file: image,
}), }),
{ {
@ -321,7 +321,7 @@ export default {
}, },
computed: { computed: {
profileImageUrl() { profileImageUrl() {
return this.app.doc.image; return this.app.pg.image;
}, },
}, },
}; };

View File

@ -35,7 +35,7 @@
<template #suffix> <template #suffix>
<lucide-chevron-down class="h-3.5 w-3.5 text-gray-700" /> <lucide-chevron-down class="h-3.5 w-3.5 text-gray-700" />
</template> </template>
{{ $team?.get.loading ? 'Loading...' : $team?.doc?.user }} {{ $team?.get.loading ? 'Loading...' : $team?.pg?.user }}
</Button> </Button>
</template> </template>
</Dropdown> </Dropdown>

View File

@ -30,15 +30,15 @@ export default {
name: 'NavigationItems', name: 'NavigationItems',
computed: { computed: {
navigation() { navigation() {
if (!this.$team?.doc) return []; if (!this.$team?.pg) return [];
const routeName = this.$route?.name || ''; const routeName = this.$route?.name || '';
const onboardingComplete = this.$team.doc.onboarding.complete; const onboardingComplete = this.$team.pg.onboarding.complete;
const isSaasUser = this.$team.doc.is_saas_user; const isSaasUser = this.$team.pg.is_saas_user;
const enforce2FA = Boolean( const enforce2FA = Boolean(
!this.$team.doc.is_desk_user && !this.$team.pg.is_desk_user &&
this.$team.doc.enforce_2fa && this.$team.pg.enforce_2fa &&
!this.$team.doc.user_info?.is_2fa_enabled, !this.$team.pg.user_info?.is_2fa_enabled,
); );
return [ return [
@ -84,7 +84,7 @@ export default {
icon: () => h(Package), icon: () => h(Package),
route: '/benches', route: '/benches',
isActive: routeName.startsWith('Bench'), isActive: routeName.startsWith('Bench'),
condition: this.$team.doc?.is_desk_user, condition: this.$team.pg?.is_desk_user,
disabled: !onboardingComplete || enforce2FA, disabled: !onboardingComplete || enforce2FA,
}, },
{ {
@ -166,7 +166,7 @@ export default {
icon: () => h(FileSearch), icon: () => h(FileSearch),
route: '/binlog-browser', route: '/binlog-browser',
isActive: routeName === 'Binlog Browser', isActive: routeName === 'Binlog Browser',
condition: this.$team.doc.is_binlog_indexer_enabled ?? false, condition: this.$team.pg.is_binlog_indexer_enabled ?? false,
}, },
].filter((item) => item.condition ?? true), ].filter((item) => item.condition ?? true),
isActive: [ isActive: [
@ -183,8 +183,8 @@ export default {
route: '/apps', route: '/apps',
isActive: routeName.startsWith('Marketplace'), isActive: routeName.startsWith('Marketplace'),
condition: condition:
this.$team.doc?.is_desk_user || this.$team.pg?.is_desk_user ||
(!!this.$team.doc.is_developer && this.$session.hasAppsAccess), (!!this.$team.pg.is_developer && this.$session.hasAppsAccess),
disabled: enforce2FA, disabled: enforce2FA,
}, },
{ {
@ -193,7 +193,7 @@ export default {
route: '/billing', route: '/billing',
isActive: routeName.startsWith('Billing'), isActive: routeName.startsWith('Billing'),
condition: condition:
this.$team.doc?.is_desk_user || this.$session.hasBillingAccess, this.$team.pg?.is_desk_user || this.$session.hasBillingAccess,
disabled: enforce2FA, disabled: enforce2FA,
}, },
{ {
@ -208,7 +208,7 @@ export default {
icon: () => h(Globe), icon: () => h(Globe),
route: '/partners', route: '/partners',
isActive: routeName === 'Partnership', isActive: routeName === 'Partnership',
condition: Boolean(this.$team.doc.erpnext_partner), condition: Boolean(this.$team.pg.erpnext_partner),
disabled: enforce2FA, disabled: enforce2FA,
}, },
{ {
@ -223,7 +223,7 @@ export default {
icon: () => h(Shield), icon: () => h(Shield),
route: '/partner-admin', route: '/partner-admin',
isActive: routeName === 'Partner Admin', isActive: routeName === 'Partner Admin',
condition: Boolean(this.$team.doc.is_desk_user), condition: Boolean(this.$team.pg.is_desk_user),
}, },
].filter((item) => item.condition ?? true); ].filter((item) => item.condition ?? true);
}, },
@ -231,7 +231,7 @@ export default {
mounted() { mounted() {
this.$socket.emit('doctype_subscribe', 'Press Notification'); this.$socket.emit('doctype_subscribe', 'Press Notification');
this.$socket.on('press_notification', (data) => { this.$socket.on('press_notification', (data) => {
if (data.team === this.$team.doc.name) { if (data.team === this.$team.pg.name) {
unreadNotificationsCount.setData((data) => data + 1); unreadNotificationsCount.setData((data) => data + 1);
} }
}); });

View File

@ -118,7 +118,7 @@
<div <div
class="rounded-md" class="rounded-md"
:class="{ :class="{
'pointer-events-none opacity-50': !$team.doc.onboarding.site_created, 'pointer-events-none opacity-50': !$team.pg.onboarding.site_created,
}" }"
> >
<div v-if="!isBillingDetailsSet"> <div v-if="!isBillingDetailsSet">
@ -126,7 +126,7 @@
<TextInsideCircle>3</TextInsideCircle> <TextInsideCircle>3</TextInsideCircle>
<span class="text-base font-medium"> Update billing details </span> <span class="text-base font-medium"> Update billing details </span>
</div> </div>
<div class="pl-7" v-if="$team.doc.onboarding.site_created"> <div class="pl-7" v-if="$team.pg.onboarding.site_created">
<UpdateBillingDetailsForm @updated="onBillingAddresUpdateSuccess" /> <UpdateBillingDetailsForm @updated="onBillingAddresUpdateSuccess" />
</div> </div>
</div> </div>
@ -151,7 +151,7 @@
class="rounded-md" class="rounded-md"
:class="{ 'pointer-events-none opacity-50': !isBillingDetailsSet }" :class="{ 'pointer-events-none opacity-50': !isBillingDetailsSet }"
> >
<div v-if="!$team.doc.payment_mode"> <div v-if="!$team.pg.payment_mode">
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<TextInsideCircle>4</TextInsideCircle> <TextInsideCircle>4</TextInsideCircle>
<span class="text-base font-medium"> Add a payment mode </span> <span class="text-base font-medium"> Add a payment mode </span>
@ -209,13 +209,13 @@
<TextInsideCircle>4</TextInsideCircle> <TextInsideCircle>4</TextInsideCircle>
<span <span
class="text-base font-medium" class="text-base font-medium"
v-if="$team.doc.payment_mode === 'Card'" v-if="$team.pg.payment_mode === 'Card'"
> >
Automatic billing setup completed Automatic billing setup completed
</span> </span>
<span <span
class="text-base font-medium" class="text-base font-medium"
v-if="$team.doc.payment_mode === 'Prepaid Credits'" v-if="$team.pg.payment_mode === 'Prepaid Credits'"
> >
Wallet balance updated Wallet balance updated
</span> </span>
@ -228,9 +228,9 @@
</div> </div>
<div <div
class="mt-1.5 pl-7 text-p-base text-gray-800" class="mt-1.5 pl-7 text-p-base text-gray-800"
v-if="$team.doc.payment_mode === 'Prepaid Credits'" v-if="$team.pg.payment_mode === 'Prepaid Credits'"
> >
Account balance: {{ $format.userCurrency($team.doc.balance) }} Account balance: {{ $format.userCurrency($team.pg.balance) }}
</div> </div>
</div> </div>
</div> </div>
@ -288,16 +288,16 @@ export default {
}, },
computed: { computed: {
isBillingDetailsSet() { isBillingDetailsSet() {
return Boolean(this.$team.doc.billing_details?.name); return Boolean(this.$team.pg.billing_details?.name);
}, },
minimumAmount() { minimumAmount() {
return this.$team.doc.currency == 'INR' ? 100 : 5; return this.$team.pg.currency == 'INR' ? 100 : 5;
}, },
pendingSiteRequest() { pendingSiteRequest() {
return this.$team.doc.pending_site_request; return this.$team.pg.pending_site_request;
}, },
trialSite() { trialSite() {
return this.$team.doc.trial_sites?.[0]; return this.$team.pg.trial_sites?.[0];
}, },
}, },
resources: { resources: {

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div v-if="doc" class="overflow-x-auto"> <div v-if="pg" class="overflow-x-auto">
<table <table
class="text w-full border-separate border-spacing-y-2 text-base font-normal text-gray-900" class="text w-full border-separate border-spacing-y-2 text-base font-normal text-gray-900"
> >
@ -16,7 +16,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<template v-for="(row, i) in doc.items" :key="row.idx"> <template v-for="(row, i) in pg.items" :key="row.idx">
<tr> <tr>
<td class="py-1 pl-2 pr-2"> <td class="py-1 pl-2 pr-2">
{{ row.document_name }} {{ row.document_name }}
@ -52,8 +52,8 @@
<td></td> <td></td>
<td class="pb-2 pr-2 pt-4 text-right font-medium">Total Payout</td> <td class="pb-2 pr-2 pt-4 text-right font-medium">Total Payout</td>
<td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium"> <td class="whitespace-nowrap pb-2 pr-2 pt-4 text-right font-medium">
{{ formatCurrency(doc.net_total_usd, 'USD') }} + {{ formatCurrency(pg.net_total_usd, 'USD') }} +
{{ formatCurrency(doc.net_total_inr, 'INR') }} {{ formatCurrency(pg.net_total_inr, 'INR') }}
</td> </td>
</tr> </tr>
</tfoot> </tfoot>
@ -78,8 +78,8 @@ export default {
}, },
}, },
computed: { computed: {
doc() { pg() {
return this.$resources.invoice.doc; return this.$resources.invoice.pg;
}, },
}, },
methods: { methods: {

View File

@ -51,7 +51,7 @@
{{ {{
$format.userCurrency( $format.userCurrency(
$format.pricePerDay( $format.pricePerDay(
$team.doc.currency === 'INR' $team.pg.currency === 'INR'
? plan.price_inr ? plan.price_inr
: plan.price_usd, : plan.price_usd,
), ),

View File

@ -5,7 +5,7 @@
<p class="mt-1 text-p-base text-gray-600">{{ props.description }}</p> <p class="mt-1 text-p-base text-gray-600">{{ props.description }}</p>
</div> </div>
<Button <Button
v-if="site?.doc" v-if="site?.pg"
class="whitespace-nowrap" class="whitespace-nowrap"
@click="getSiteActionHandler(props.actionLabel)" @click="getSiteActionHandler(props.actionLabel)"
> >
@ -69,7 +69,7 @@ function getSiteActionHandler(action) {
), ),
}; };
if (actionDialogs[action]) { if (actionDialogs[action]) {
const dialog = h(actionDialogs[action], { site: site.doc.name }); const dialog = h(actionDialogs[action], { site: site.pg.name });
renderDialog(dialog); renderDialog(dialog);
return; return;
} }
@ -93,7 +93,7 @@ function onNotificationSettings() {
return renderDialog( return renderDialog(
h(CommunicationInfoDialog, { h(CommunicationInfoDialog, {
referenceDoctype: 'Site', referenceDoctype: 'Site',
referenceName: site.doc.name, referenceName: site.pg.name,
}), }),
); );
} }
@ -163,12 +163,12 @@ function onDropSite() {
theme: 'red', theme: 'red',
onClick: async ({ hide, values }) => { onClick: async ({ hide, values }) => {
if ( if (
![site.doc.name, site.doc.host_name].includes(values.confirmSiteName) ![site.pg.name, site.pg.host_name].includes(values.confirmSiteName)
) { ) {
throw new Error('Site name does not match.'); throw new Error('Site name does not match.');
} }
const val = await isLastSite(site.doc.team); const val = await isLastSite(site.pg.team);
const FeedbackDialog = defineAsyncComponent( const FeedbackDialog = defineAsyncComponent(
() => import('./ChurnFeedbackDialog.vue'), () => import('./ChurnFeedbackDialog.vue'),
); );
@ -178,7 +178,7 @@ function onDropSite() {
if (val) { if (val) {
renderDialog( renderDialog(
h(FeedbackDialog, { h(FeedbackDialog, {
team: site.doc.team, team: site.pg.team,
onUpdated() { onUpdated() {
router.replace({ name: 'Site List' }); router.replace({ name: 'Site List' });
toast.success('Site dropped successfully'); toast.success('Site dropped successfully');
@ -218,7 +218,7 @@ function onMigrateSite() {
variant: 'solid', variant: 'solid',
theme: 'red', theme: 'red',
onClick: ({ hide, values }) => { onClick: ({ hide, values }) => {
if (values.confirmSiteName !== site.doc.name) { if (values.confirmSiteName !== site.pg.name) {
throw new Error('Site name does not match'); throw new Error('Site name does not match');
} }
return site.migrate return site.migrate
@ -246,7 +246,7 @@ function onSiteReset() {
variant: 'solid', variant: 'solid',
theme: 'red', theme: 'red',
onClick: ({ hide, values }) => { onClick: ({ hide, values }) => {
if (values.confirmSiteName !== site.doc.name) { if (values.confirmSiteName !== site.pg.name) {
throw new Error('Site name does not match.'); throw new Error('Site name does not match.');
} }
return site.reinstall.submit().then(hide); return site.reinstall.submit().then(hide);

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="mx-auto max-w-3xl space-y-4" v-if="$site?.doc?.actions"> <div class="mx-auto max-w-3xl space-y-4" v-if="$site?.pg?.actions">
<div <div
v-for="group in actions" v-for="group in actions"
:key="group.group" :key="group.group"
@ -15,7 +15,7 @@
:siteName="site" :siteName="site"
:group="group.group" :group="group.group"
:actionLabel="row.action" :actionLabel="row.action"
:method="row.doc_method" :method="row.pg_method"
:description="row.description" :description="row.description"
:buttonLabel="row.button_label" :buttonLabel="row.button_label"
/> />
@ -36,7 +36,7 @@ export default {
return getCachedDocumentResource('Site', this.site); return getCachedDocumentResource('Site', this.site);
}, },
actions() { actions() {
const groupedActions = this.$site.doc.actions.reduce((acc, action) => { const groupedActions = this.$site.pg.actions.reduce((acc, action) => {
const group = action.group || 'General Actions'; const group = action.group || 'General Actions';
if (!acc[group]) { if (!acc[group]) {
acc[group] = []; acc[group] = [];

View File

@ -112,7 +112,7 @@ export default {
resources: { resources: {
deleteSiteDatabaseUser() { deleteSiteDatabaseUser() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
onSuccess() { onSuccess() {
toast.success('Database User will be deleted shortly'); toast.success('Database User will be deleted shortly');
}, },
@ -267,7 +267,7 @@ export default {
}; };
}, },
sitePlan() { sitePlan() {
return this.$site.doc.current_plan; return this.$site.pg.current_plan;
}, },
planSupportsDatabaseAccess() { planSupportsDatabaseAccess() {
return this.sitePlan?.database_access; return this.sitePlan?.database_access;

View File

@ -1,20 +1,20 @@
<template> <template>
<div <div
v-if="$site?.doc" v-if="$site?.pg"
class="grid grid-cols-1 items-start gap-5 lg:grid-cols-2" class="grid grid-cols-1 items-start gap-5 lg:grid-cols-2"
> >
<CustomAlerts <CustomAlerts
:disable-last-child-bottom-margin="true" :disable-last-child-bottom-margin="true"
container-class="col-span-1 lg:col-span-2" container-class="col-span-1 lg:col-span-2"
ctx_type="Site" ctx_type="Site"
:ctx_name="$site?.doc?.name" :ctx_name="$site?.pg?.name"
/> />
<AlertBanner <AlertBanner
v-if="$site?.doc?.status === 'Suspended' && $site?.doc?.suspension_reason" v-if="$site?.pg?.status === 'Suspended' && $site?.pg?.suspension_reason"
class="col-span-1 lg:col-span-2" class="col-span-1 lg:col-span-2"
type="error" type="error"
:title="`Suspension Reason : ${$site?.doc?.suspension_reason || 'Not Specified'}`" :title="`Suspension Reason : ${$site?.pg?.suspension_reason || 'Not Specified'}`"
> >
<Button <Button
class="ml-auto min-w-[7rem]" class="ml-auto min-w-[7rem]"
@ -26,7 +26,7 @@
</AlertBanner> </AlertBanner>
<AlertBanner <AlertBanner
v-if="$site?.doc?.status === 'Active' && $site?.doc?.site_usage_exceeded" v-if="$site?.pg?.status === 'Active' && $site?.pg?.site_usage_exceeded"
class="col-span-1 lg:col-span-2" class="col-span-1 lg:col-span-2"
type="warning" type="warning"
title="Database or Disk usage limits exceeded. Upgrade plan or reduce usage to avoid suspension." title="Database or Disk usage limits exceeded. Upgrade plan or reduce usage to avoid suspension."
@ -57,7 +57,7 @@
</AlertBanner> </AlertBanner>
<AlertBanner <AlertBanner
v-if="$site.doc.current_plan?.is_trial_plan" v-if="$site.pg.current_plan?.is_trial_plan"
class="col-span-1 lg:col-span-2" class="col-span-1 lg:col-span-2"
title="Upgrade to a paid plan to continue using your site after the trial period." title="Upgrade to a paid plan to continue using your site after the trial period."
> >
@ -67,7 +67,7 @@
</AlertBanner> </AlertBanner>
<AlertBanner <AlertBanner
v-if="$site.doc.is_monitoring_disabled && $site.doc.status !== 'Archived'" v-if="$site.pg.is_monitoring_disabled && $site.pg.status !== 'Archived'"
class="col-span-1 lg:col-span-2" class="col-span-1 lg:col-span-2"
title="Site monitoring is disabled, which means we wont be able to notify you of any downtime. Please re-enable monitoring at your earliest convenience." title="Site monitoring is disabled, which means we wont be able to notify you of any downtime. Please re-enable monitoring at your earliest convenience."
:id="$site.name" :id="$site.name"
@ -75,7 +75,7 @@
> >
</AlertBanner> </AlertBanner>
<DismissableBanner <DismissableBanner
v-else-if="$site.doc.eol_versions.includes($site.doc.version)" v-else-if="$site.pg.eol_versions.includes($site.pg.version)"
class="col-span-1 lg:col-span-2" class="col-span-1 lg:col-span-2"
title="Your site is on an End of Life version. Upgrade to the latest version to get support, latest features and security updates." title="Your site is on an End of Life version. Upgrade to the latest version to get support, latest features and security updates."
:id="`${$site.name}-eol`" :id="`${$site.name}-eol`"
@ -90,11 +90,11 @@
</DismissableBanner> </DismissableBanner>
<DismissableBanner <DismissableBanner
v-else-if=" v-else-if="
$site.doc.current_plan && $site.pg.current_plan &&
!$site.doc.current_plan?.private_benches && !$site.pg.current_plan?.private_benches &&
$site.doc.group_public && $site.pg.group_public &&
!$site.doc.current_plan?.is_trial_plan && !$site.pg.current_plan?.is_trial_plan &&
$site.doc.status !== 'Archived' $site.pg.status !== 'Archived'
" "
class="col-span-1 lg:col-span-2" class="col-span-1 lg:col-span-2"
title="Your site is currently on a shared bench group. Upgrade plan to enjoy <a href='https://frappecloud.com/shared-hosting#benches' class='underline' target='_blank'>more benefits</a>." title="Your site is currently on a shared bench group. Upgrade plan to enjoy <a href='https://frappecloud.com/shared-hosting#benches' class='underline' target='_blank'>more benefits</a>."
@ -115,8 +115,8 @@
<div> <div>
<div class="leading-4"> <div class="leading-4">
<span class="flex items-center text-base text-gray-900"> <span class="flex items-center text-base text-gray-900">
<template v-if="$site.doc.trial_end_date"> <template v-if="$site.pg.trial_end_date">
{{ trialDays($site.doc.trial_end_date) }} {{ trialDays($site.pg.trial_end_date) }}
</template> </template>
<template v-else-if="currentPlan"> <template v-else-if="currentPlan">
{{ $format.planTitle(currentPlan) }} {{ $format.planTitle(currentPlan) }}
@ -172,7 +172,7 @@
{{ currentUsage.cpu }} {{ currentUsage.cpu }}
{{ $format.plural(currentUsage.cpu, 'hour', 'hours') }} {{ $format.plural(currentUsage.cpu, 'hour', 'hours') }}
<template <template
v-if="currentPlan && !$site.doc.is_dedicated_server" v-if="currentPlan && !$site.pg.is_dedicated_server"
> >
of {{ currentPlan?.cpu_time_per_day }} hours of {{ currentPlan?.cpu_time_per_day }} hours
</template> </template>
@ -202,7 +202,7 @@
<div class="text-sm text-gray-600"> <div class="text-sm text-gray-600">
{{ formatBytes(currentUsage.storage) }} {{ formatBytes(currentUsage.storage) }}
<template <template
v-if="currentPlan && !$site.doc.is_dedicated_server" v-if="currentPlan && !$site.pg.is_dedicated_server"
> >
of {{ formatBytes(currentPlan.max_storage_usage) }} of {{ formatBytes(currentPlan.max_storage_usage) }}
</template> </template>
@ -243,7 +243,7 @@
<div class="text-sm text-gray-600"> <div class="text-sm text-gray-600">
{{ formatBytes(currentUsage.database) }} {{ formatBytes(currentUsage.database) }}
<template <template
v-if="currentPlan && !$site.doc.is_dedicated_server" v-if="currentPlan && !$site.pg.is_dedicated_server"
> >
of of
{{ formatBytes(currentPlan.max_database_usage) }} {{ formatBytes(currentPlan.max_database_usage) }}
@ -288,7 +288,7 @@
<!-- Tags --> <!-- Tags -->
<div class="col-span-1 flex items-center space-x-2 lg:col-span-2"> <div class="col-span-1 flex items-center space-x-2 lg:col-span-2">
<Badge <Badge
v-for="tag in $site.doc.tags" v-for="tag in $site.pg.tags"
:key="tag.tag" :key="tag.tag"
:label="tag.tag_name" :label="tag.tag_name"
size="lg" size="lg"
@ -346,7 +346,7 @@ export default {
}; };
}, },
mounted() { mounted() {
if (this.$site?.doc?.status === 'Active') { if (this.$site?.pg?.status === 'Active') {
this.$site.isSetupWizardComplete.submit().then((res) => { this.$site.isSetupWizardComplete.submit().then((res) => {
this.isSetupWizardComplete = res; this.isSetupWizardComplete = res;
}); });
@ -374,7 +374,7 @@ export default {
.then((url) => window.open(url, '_blank')); .then((url) => window.open(url, '_blank'));
}, },
loginAsTeam() { loginAsTeam() {
if (this.$site.doc?.additional_system_user_created) { if (this.$site.pg?.additional_system_user_created) {
this.$site.loginAsTeam this.$site.loginAsTeam
.submit({ reason: '' }) .submit({ reason: '' })
.then((url) => window.open(url, '_blank')); .then((url) => window.open(url, '_blank'));
@ -407,30 +407,30 @@ export default {
return [ return [
{ {
label: 'Owned by', label: 'Owned by',
value: this.$site.doc?.owner_email, value: this.$site.pg?.owner_email,
}, },
{ {
label: 'Created by', label: 'Created by',
value: this.$site.doc?.signup_by || this.$site.doc?.owner, value: this.$site.pg?.signup_by || this.$site.pg?.owner,
}, },
{ {
label: 'Created on', label: 'Created on',
value: this.$format.date( value: this.$format.date(
this.$site.doc?.signup_time || this.$site.doc?.creation, this.$site.pg?.signup_time || this.$site.pg?.creation,
), ),
}, },
{ {
label: 'Region', label: 'Region',
value: this.$site.doc?.cluster.title, value: this.$site.pg?.cluster.title,
prefix: h('img', { prefix: h('img', {
src: this.$site.doc?.cluster.image, src: this.$site.pg?.cluster.image,
alt: this.$site.doc?.cluster.title, alt: this.$site.pg?.cluster.title,
class: 'h-4 w-4', class: 'h-4 w-4',
}), }),
}, },
{ {
label: 'Inbound IP', label: 'Inbound IP',
value: this.$site.doc?.inbound_ip, value: this.$site.pg?.inbound_ip,
suffix: h( suffix: h(
Tooltip, Tooltip,
{ {
@ -441,7 +441,7 @@ export default {
}, },
{ {
label: 'Outbound IP', label: 'Outbound IP',
value: this.$site.doc?.outbound_ip, value: this.$site.pg?.outbound_ip,
suffix: h( suffix: h(
Tooltip, Tooltip,
{ {
@ -453,24 +453,24 @@ export default {
]; ];
}, },
currentPlan() { currentPlan() {
if (!this.$site?.doc?.current_plan || !this.$team?.doc) return null; if (!this.$site?.pg?.current_plan || !this.$team?.pg) return null;
const currency = this.$team.doc.currency; const currency = this.$team.pg.currency;
return { return {
price: price:
currency === 'INR' currency === 'INR'
? this.$site.doc.current_plan.price_inr ? this.$site.pg.current_plan.price_inr
: this.$site.doc.current_plan.price_usd, : this.$site.pg.current_plan.price_usd,
price_per_day: price_per_day:
currency === 'INR' currency === 'INR'
? this.$site.doc.current_plan.price_per_day_inr ? this.$site.pg.current_plan.price_per_day_inr
: this.$site.doc.current_plan.price_per_day_usd, : this.$site.pg.current_plan.price_per_day_usd,
currency: currency === 'INR' ? '₹' : '$', currency: currency === 'INR' ? '₹' : '$',
...this.$site.doc.current_plan, ...this.$site.pg.current_plan,
}; };
}, },
currentUsage() { currentUsage() {
return this.$site.doc?.current_usage; return this.$site.pg?.current_usage;
}, },
$site() { $site() {
return getCachedDocumentResource('Site', this.site); return getCachedDocumentResource('Site', this.site);

View File

@ -24,7 +24,7 @@
label="Skip taking backup for this update" label="Skip taking backup for this update"
type="checkbox" type="checkbox"
v-model="skipBackups" v-model="skipBackups"
v-if="!$site.doc.group_public" v-if="!$site.pg.group_public"
/> />
<div <div
class="flex items-center rounded border border-gray-200 bg-gray-100 p-4 text-sm text-gray-600" class="flex items-center rounded border border-gray-200 bg-gray-100 p-4 text-sm text-gray-600"
@ -111,8 +111,8 @@ export default {
name: this.existingUpdate, name: this.existingUpdate,
}, },
auto: !!this.existingUpdate, auto: !!this.existingUpdate,
onSuccess: (doc) => { onSuccess: (pg) => {
this.initializeValues(doc); this.initializeValues(pg);
}, },
}; };
}, },
@ -182,11 +182,11 @@ export default {
}; };
}, },
updatableApps() { updatableApps() {
if (!this.$site.doc.update_information.update_available) return []; if (!this.$site.pg.update_information.update_available) return [];
let installedApps = this.$site.doc.update_information.installed_apps.map( let installedApps = this.$site.pg.update_information.installed_apps.map(
(d) => d.app, (d) => d.app,
); );
return this.$site.doc.update_information.apps.filter((app) => return this.$site.pg.update_information.apps.filter((app) =>
installedApps.includes(app.app), installedApps.includes(app.app),
); );
}, },
@ -242,10 +242,10 @@ export default {
}, },
); );
}, },
initializeValues(doc) { initializeValues(pg) {
this.skipFailingPatches = doc.skipped_failing_patches; this.skipFailingPatches = pg.skipped_failing_patches;
this.skipBackups = doc.skipped_backups; this.skipBackups = pg.skipped_backups;
this.scheduledTime = dayjs(doc.scheduled_time).format('YYYY-MM-DDTHH:mm'); this.scheduledTime = dayjs(pg.scheduled_time).format('YYYY-MM-DDTHH:mm');
}, },
}, },
}; };

View File

@ -26,7 +26,7 @@
</p> </p>
<div class="rounded-sm border divide-y"> <div class="rounded-sm border divide-y">
<div <div
v-for="resource in request.doc?.resources" v-for="resource in request.pg?.resources"
class="grid grid-cols-3 divide-x" class="grid grid-cols-3 divide-x"
> >
<div class="col-span-1 py-2 px-3 font-medium"> <div class="col-span-1 py-2 px-3 font-medium">
@ -50,9 +50,9 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="request.doc?.reason" class="space-y-2"> <div v-if="request.pg?.reason" class="space-y-2">
<p class="font-medium">Reason:</p> <p class="font-medium">Reason:</p>
<p class="leading-relaxed">{{ request.doc?.reason }}</p> <p class="leading-relaxed">{{ request.pg?.reason }}</p>
</div> </div>
<div v-if="permissions.length" class="space-y-2"> <div v-if="permissions.length" class="space-y-2">
<p class="font-medium">Permissions:</p> <p class="font-medium">Permissions:</p>
@ -93,33 +93,33 @@ const request = createDocumentResource({
}); });
const isReceived = computed(() => { const isReceived = computed(() => {
return team.doc?.name === request.doc?.target_team; return team.pg?.name === request.pg?.target_team;
}); });
const isPending = computed(() => { const isPending = computed(() => {
return request.doc?.status === 'Pending'; return request.pg?.status === 'Pending';
}); });
const permissions = computed(() => const permissions = computed(() =>
[ [
{ {
label: 'Release Group', label: 'Release Group',
requested: request.doc?.site_release_group, requested: request.pg?.site_release_group,
color: 'red', color: 'red',
}, },
{ {
label: 'SSH', label: 'SSH',
requested: request.doc?.bench_ssh, requested: request.pg?.bench_ssh,
color: 'red', color: 'red',
}, },
{ {
label: 'Login as Administrator', label: 'Login as Administrator',
requested: request.doc?.login_as_administrator, requested: request.pg?.login_as_administrator,
color: 'orange', color: 'orange',
}, },
{ {
label: 'Domains', label: 'Domains',
requested: request.doc?.site_domains, requested: request.pg?.site_domains,
color: 'green', color: 'green',
}, },
].filter((p) => p.requested), ].filter((p) => p.requested),
@ -141,22 +141,22 @@ const update = createResource({
}); });
const banner = computed(() => { const banner = computed(() => {
if (request.doc?.status === 'Accepted') { if (request.pg?.status === 'Accepted') {
return { return {
type: 'success', type: 'success',
message: 'This request has been accepted.', message: 'This request has been accepted.',
}; };
} else if (request.doc?.status === 'Rejected') { } else if (request.pg?.status === 'Rejected') {
return { return {
type: 'error', type: 'error',
message: 'This request has been rejected.', message: 'This request has been rejected.',
}; };
} else if (request.doc?.status === 'Revoked') { } else if (request.pg?.status === 'Revoked') {
return { return {
type: 'neutral', type: 'neutral',
message: 'This request has been revoked.', message: 'This request has been revoked.',
}; };
} else if (request.doc?.status === 'Forfeited') { } else if (request.pg?.status === 'Forfeited') {
return { return {
type: 'neutral', type: 'neutral',
message: 'This request has been forfeited.', message: 'This request has been forfeited.',
@ -166,9 +166,9 @@ const banner = computed(() => {
const actions = computed(() => { const actions = computed(() => {
const actions = []; const actions = [];
const isExpired = new Date(request.doc.access_allowed_till) < new Date(); const isExpired = new Date(request.pg.access_allowed_till) < new Date();
if (request.doc?.status === 'Pending' && isReceived.value) { if (request.pg?.status === 'Pending' && isReceived.value) {
actions.push( actions.push(
{ {
label: 'Reject', label: 'Reject',
@ -192,7 +192,7 @@ const actions = computed(() => {
); );
} }
if (request.doc?.status === 'Accepted' && isReceived.value && !isExpired) { if (request.pg?.status === 'Accepted' && isReceived.value && !isExpired) {
actions.push({ actions.push({
label: 'Revoke', label: 'Revoke',
variant: 'subtle', variant: 'subtle',
@ -205,7 +205,7 @@ const actions = computed(() => {
}); });
} }
if (request.doc?.status === 'Accepted' && !isReceived.value && !isExpired) { if (request.pg?.status === 'Accepted' && !isReceived.value && !isExpired) {
actions.push({ actions.push({
label: 'Forfeit', label: 'Forfeit',
variant: 'subtle', variant: 'subtle',

View File

@ -1,6 +1,6 @@
<template> <template>
<Dialog :options="{ title: 'Switch Team' }" v-model="show"> <Dialog :options="{ title: 'Switch Team' }" v-model="show">
<template #body-content v-if="$team?.doc"> <template #body-content v-if="$team?.pg">
<div class="rounded bg-gray-100 px-3 py-2.5"> <div class="rounded bg-gray-100 px-3 py-2.5">
<div class="text-base text-gray-900"> <div class="text-base text-gray-900">
You are logged in as the user You are logged in as the user
@ -9,13 +9,13 @@
<div class="mt-2 text-base text-gray-900"> <div class="mt-2 text-base text-gray-900">
You are viewing dashboard for the team You are viewing dashboard for the team
<component <component
:is="$team.doc.is_desk_user ? 'a' : 'span'" :is="$team.pg.is_desk_user ? 'a' : 'span'"
class="font-medium" class="font-medium"
:class="{ underline: $team.doc.is_desk_user }" :class="{ underline: $team.pg.is_desk_user }"
:href="$team.doc.is_desk_user ? `/app/team/${$team.name}` : null" :href="$team.pg.is_desk_user ? `/app/team/${$team.name}` : null"
target="_blank" target="_blank"
> >
{{ $team.doc.user }} {{ $team.pg.user }}
</component> </component>
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
{{ team.user }} {{ team.user }}
</span> </span>
<Button <Button
v-if="$team.doc.is_desk_user" v-if="$team.pg.is_desk_user"
icon="external-link" icon="external-link"
:link="`/app/team/${team.name}`" :link="`/app/team/${team.name}`"
variant="ghost" variant="ghost"
@ -91,8 +91,8 @@ export default {
}, },
}, },
sortedTeams() { sortedTeams() {
if (!this.$team?.doc?.valid_teams) return []; if (!this.$team?.pg?.valid_teams) return [];
return [...this.$team.doc.valid_teams].sort((a, b) => { return [...this.$team.pg.valid_teams].sort((a, b) => {
return a.user.localeCompare(b.user); return a.user.localeCompare(b.user);
}); });
}, },

View File

@ -26,7 +26,7 @@ export default {
) { ) {
return false; return false;
} else if (tab.condition) { } else if (tab.condition) {
return tab.condition({ doc: this.document }); return tab.condition({ pg: this.document });
} else { } else {
return true; return true;
} }

View File

@ -245,7 +245,7 @@ export default {
return this.qrUrl.match(/secret=(.*?)&issuer/)[1]; return this.qrUrl.match(/secret=(.*?)&issuer/)[1];
}, },
is2FAEnabled() { is2FAEnabled() {
return this.$team.doc?.user_info?.is_2fa_enabled; return this.$team.pg?.user_info?.is_2fa_enabled;
}, },
}, },
}; };

View File

@ -35,8 +35,8 @@ const team = inject('team');
const addressFormRef = ref(null); const addressFormRef = ref(null);
const fullName = `${team.doc.user_info.first_name || ''} ${ const fullName = `${team.pg.user_info.first_name || ''} ${
team.doc.user_info.last_name || '' team.pg.user_info.last_name || ''
}`.trim(); }`.trim();
const billingInformation = reactive({ const billingInformation = reactive({

View File

@ -65,7 +65,7 @@ const { currentBillingAmount, upcomingInvoice, unpaidInvoices } =
const showAddPrepaidCreditsDialog = ref(false); const showAddPrepaidCreditsDialog = ref(false);
const showInvoiceDialog = ref(false); const showInvoiceDialog = ref(false);
const currency = computed(() => (team.doc.currency == 'INR' ? '₹' : '$')); const currency = computed(() => (team.pg.currency == 'INR' ? '₹' : '$'));
const unpaidAmount = createResource({ const unpaidAmount = createResource({
url: 'press.api.billing.total_unpaid_amount', url: 'press.api.billing.total_unpaid_amount',
@ -84,7 +84,7 @@ const currentMonthEnd = () => {
}; };
function payNow() { function payNow() {
team.doc.payment_mode == 'Prepaid Credits' team.pg.payment_mode == 'Prepaid Credits'
? (showAddPrepaidCreditsDialog.value = true) ? (showAddPrepaidCreditsDialog.value = true)
: payUnpaidInvoices(); : payUnpaidInvoices();
} }
@ -92,7 +92,7 @@ function payNow() {
function payUnpaidInvoices() { function payUnpaidInvoices() {
let _unpaidInvoices = unpaidInvoices.data; let _unpaidInvoices = unpaidInvoices.data;
if (_unpaidInvoices.length > 1) { if (_unpaidInvoices.length > 1) {
if (team.doc.payment_mode === 'Prepaid Credits') { if (team.pg.payment_mode === 'Prepaid Credits') {
showAddPrepaidCreditsDialog.value = true; showAddPrepaidCreditsDialog.value = true;
} else { } else {
confirmDialog({ confirmDialog({
@ -111,9 +111,9 @@ function payUnpaidInvoices() {
} }
} else { } else {
let invoice = _unpaidInvoices; let invoice = _unpaidInvoices;
if (invoice.stripe_invoice_url && team.doc.payment_mode === 'Card') { if (invoice.stripe_invoice_url && team.pg.payment_mode === 'Card') {
window.open( window.open(
`/api/method/press.api.client.run_doc_method?dt=Invoice&dn=${invoice.name}&method=stripe_payment_url`, `/api/method/press.api.client.run_pg_method?dt=Invoice&dn=${invoice.name}&method=stripe_payment_url`,
); );
} else { } else {
showAddPrepaidCreditsDialog.value = true; showAddPrepaidCreditsDialog.value = true;

View File

@ -10,8 +10,8 @@
<div v-if="receiveBudgetAlerts"> <div v-if="receiveBudgetAlerts">
<FormControl <FormControl
v-model="monthlyAlertLimit" v-model="monthlyAlertLimit"
:label="`Monthly Alert Limit (${team?.doc?.currency})`" :label="`Monthly Alert Limit (${team?.pg?.currency})`"
:placeholder="`Enter amount in ${team?.doc?.currency}`" :placeholder="`Enter amount in ${team?.pg?.currency}`"
type="number" type="number"
:min="0" :min="0"
:step="1000" :step="1000"
@ -47,14 +47,14 @@ const team = inject('team');
let errorMessage = ref(''); let errorMessage = ref('');
const receiveBudgetAlerts = ref(Boolean(team?.doc?.receive_budget_alerts)); const receiveBudgetAlerts = ref(Boolean(team?.pg?.receive_budget_alerts));
const monthlyAlertLimit = ref(team?.doc?.monthly_alert_threshold || ''); const monthlyAlertLimit = ref(team?.pg?.monthly_alert_threshold || '');
const saveSettings = async () => { const saveSettings = async () => {
try { try {
// Check if no changes were made // Check if no changes were made
const currentAlerts = !!team.doc.receive_budget_alerts; const currentAlerts = !!team.pg.receive_budget_alerts;
const currentLimit = team.doc.monthly_alert_threshold || 0; const currentLimit = team.pg.monthly_alert_threshold || 0;
const newLimit = receiveBudgetAlerts.value const newLimit = receiveBudgetAlerts.value
? parseFloat(monthlyAlertLimit.value) || 0 ? parseFloat(monthlyAlertLimit.value) || 0
: 0; : 0;

View File

@ -1,11 +1,11 @@
<template> <template>
<div> <div>
<span <span
v-if="team.doc.currency === 'INR' || paypalEnabled" v-if="team.pg.currency === 'INR' || paypalEnabled"
class="mt-2.5 inline-flex gap-2 text-base text-gray-700" class="mt-2.5 inline-flex gap-2 text-base text-gray-700"
> >
<FeatherIcon name="info" class="my-1 h-4" /> <FeatherIcon name="info" class="my-1 h-4" />
<span class="leading-5" v-if="team.doc.currency === 'INR'"> <span class="leading-5" v-if="team.pg.currency === 'INR'">
If you select Razorpay, you can pay using Credit Card, Debit Card, Net If you select Razorpay, you can pay using Credit Card, Debit Card, Net
Banking, UPI, Wallets, etc. If you are using Net Banking, it may take Banking, UPI, Wallets, etc. If you are using Net Banking, it may take
upto 5 days for balance to reflect. upto 5 days for balance to reflect.
@ -69,7 +69,7 @@ const props = defineProps({
const emit = defineEmits(['success']); const emit = defineEmits(['success']);
const team = inject('team'); const team = inject('team');
const paypalEnabled = team.doc.currency === 'USD' && props.paypalEnabled; const paypalEnabled = team.pg.currency === 'USD' && props.paypalEnabled;
const isPaymentComplete = ref(false); const isPaymentComplete = ref(false);
const isVerifyingPayment = ref(false); const isVerifyingPayment = ref(false);
@ -94,7 +94,7 @@ const createRazorpayOrder = createResource({
params: { params: {
amount: props.amount, amount: props.amount,
transaction_type: props.type, transaction_type: props.type,
doc_name: props.docName, pg_name: props.docName,
}, },
onSuccess: (data) => processOrder(data), onSuccess: (data) => processOrder(data),
validate: () => { validate: () => {
@ -117,7 +117,7 @@ function processOrder(data) {
order_id: data.order_id, order_id: data.order_id,
name: 'Frappe Cloud', name: 'Frappe Cloud',
image: 'https://frappe.io/files/cloud.png', image: 'https://frappe.io/files/cloud.png',
prefill: { email: team.doc?.user }, prefill: { email: team.pg?.user },
handler: handlePaymentSuccess, handler: handlePaymentSuccess,
theme: { color: '#171717' }, theme: { color: '#171717' },
...(paypalEnabled ...(paypalEnabled

View File

@ -82,7 +82,7 @@ const createPaymentIntent = createResource({
url: 'press.api.billing.create_payment_intent_for_buying_credits', url: 'press.api.billing.create_payment_intent_for_buying_credits',
params: { amount: props.amount }, params: { amount: props.amount },
validate() { validate() {
if (props.amount < props.minimumAmount && !team.doc.erpnext_partner) { if (props.amount < props.minimumAmount && !team.pg.erpnext_partner) {
throw new DashboardError( throw new DashboardError(
`Amount must be greater than or equal to ${props.minimumAmount}`, `Amount must be greater than or equal to ${props.minimumAmount}`,
); );

View File

@ -252,7 +252,7 @@ const verifyCardWithMicroCharge = createResource({
async function setupStripeIntent() { async function setupStripeIntent() {
await getPublishedKeyAndSetupIntent.submit(); await getPublishedKeyAndSetupIntent.submit();
const { first_name, last_name = '' } = team.doc?.user_info; const { first_name, last_name = '' } = team.pg?.user_info;
const fullname = `${first_name} ${last_name ?? ''}`; const fullname = `${first_name} ${last_name ?? ''}`;
billingInformation.cardHolderName = fullname.trimEnd(); billingInformation.cardHolderName = fullname.trimEnd();
} }
@ -283,7 +283,7 @@ async function submit() {
city: billingInformation.city, city: billingInformation.city,
state: billingInformation.state, state: billingInformation.state,
postal_code: billingInformation.postal_code, postal_code: billingInformation.postal_code,
country: getCountryCode(team.doc?.country), country: getCountryCode(team.pg?.country),
}, },
}, },
}, },
@ -312,7 +312,7 @@ async function submit() {
} }
async function verifyWithMicroChargeIfApplicable() { async function verifyWithMicroChargeIfApplicable() {
const teamCurrency = team.doc?.currency; const teamCurrency = team.pg?.currency;
const verifyCardsWithMicroCharge = window.verify_cards_with_micro_charge; const verifyCardsWithMicroCharge = window.verify_cards_with_micro_charge;
const isMicroChargeApplicable = const isMicroChargeApplicable =
verifyCardsWithMicroCharge === 'Both INR and USD' || verifyCardsWithMicroCharge === 'Both INR and USD' ||
@ -344,12 +344,12 @@ async function clearForm() {
} }
const formattedMicroChargeAmount = computed(() => { const formattedMicroChargeAmount = computed(() => {
if (!team.doc?.currency) { if (!team.pg?.currency) {
return 0; return 0;
} }
return currency( return currency(
team.doc?.billing_info?.micro_debit_charge_amount, team.pg?.billing_info?.micro_debit_charge_amount,
team.doc?.currency, team.pg?.currency,
); );
}); });
</script> </script>

View File

@ -138,7 +138,7 @@ const _countryList = createResource({
cache: 'countryList', cache: 'countryList',
auto: true, auto: true,
onSuccess: () => { onSuccess: () => {
let userCountry = team.doc?.country; let userCountry = team.pg?.country;
if (userCountry) { if (userCountry) {
let country = countryList.value?.find((d) => d.label === userCountry); let country = countryList.value?.find((d) => d.label === userCountry);
if (country) { if (country) {

View File

@ -3,21 +3,21 @@
<div class="text-lg font-semibold text-gray-900">Payment details</div> <div class="text-lg font-semibold text-gray-900">Payment details</div>
<div class="flex flex-col"> <div class="flex flex-col">
<div <div
v-if="team.doc.payment_mode == 'Card'" v-if="team.pg.payment_mode == 'Card'"
class="flex items-center justify-between text-base text-gray-900" class="flex items-center justify-between text-base text-gray-900"
> >
<div class="flex flex-col gap-1.5"> <div class="flex flex-col gap-1.5">
<div class="font-medium">Active Card</div> <div class="font-medium">Active Card</div>
<div class="overflow-hidden text-ellipsis text-gray-700"> <div class="overflow-hidden text-ellipsis text-gray-700">
<div <div
v-if="team.doc.payment_method" v-if="team.pg.payment_method"
class="inline-flex items-center gap-2" class="inline-flex items-center gap-2"
> >
<component :is="cardBrandIcon(team.doc.payment_method.brand)" /> <component :is="cardBrandIcon(team.pg.payment_method.brand)" />
<div class="text-gray-700"> <div class="text-gray-700">
<span>{{ team.doc.payment_method.name_on_card }}</span> <span>{{ team.pg.payment_method.name_on_card }}</span>
<span> &middot; Card ending in </span> <span> &middot; Card ending in </span>
<span>{{ team.doc.payment_method.last_4 }}</span> <span>{{ team.pg.payment_method.last_4 }}</span>
</div> </div>
</div> </div>
<span v-else class="text-gray-700">No card added</span> <span v-else class="text-gray-700">No card added</span>
@ -25,24 +25,24 @@
</div> </div>
<div class="shrink-0"> <div class="shrink-0">
<Button <Button
:label="team.doc.payment_method ? 'Change card' : 'Add card'" :label="team.pg.payment_method ? 'Change card' : 'Add card'"
@click="changeMethod" @click="changeMethod"
> >
<template v-if="!team.doc.payment_method" #prefix> <template v-if="!team.pg.payment_method" #prefix>
<FeatherIcon class="h-4" name="plus" /> <FeatherIcon class="h-4" name="plus" />
</template> </template>
</Button> </Button>
</div> </div>
</div> </div>
<div <div
v-if="team.doc.payment_mode == 'Card'" v-if="team.pg.payment_mode == 'Card'"
class="my-3 h-px bg-gray-100" class="my-3 h-px bg-gray-100"
/> />
<div class="flex items-center justify-between text-base text-gray-900"> <div class="flex items-center justify-between text-base text-gray-900">
<div class="flex flex-col gap-1.5"> <div class="flex flex-col gap-1.5">
<div class="font-medium">Mode of payment</div> <div class="font-medium">Mode of payment</div>
<div <div
v-if="team.doc.payment_mode" v-if="team.pg.payment_mode"
class="inline-flex items-center gap-2 text-gray-700" class="inline-flex items-center gap-2 text-gray-700"
> >
<FeatherIcon class="h-4" name="info" /> <FeatherIcon class="h-4" name="info" />
@ -54,7 +54,7 @@
<Dropdown :options="paymentModeOptions"> <Dropdown :options="paymentModeOptions">
<template #default="{ open }"> <template #default="{ open }">
<Button <Button
:label="team.doc.payment_mode ? paymentMode.label : 'Set mode'" :label="team.pg.payment_mode ? paymentMode.label : 'Set mode'"
> >
<template #suffix> <template #suffix>
<FeatherIcon <FeatherIcon
@ -126,11 +126,11 @@
<div class="flex flex-col gap-1.5"> <div class="flex flex-col gap-1.5">
<div class="font-medium">Budget Alerts</div> <div class="font-medium">Budget Alerts</div>
<div <div
v-if="team.doc.receive_budget_alerts" v-if="team.pg.receive_budget_alerts"
class="leading-5 text-gray-700" class="leading-5 text-gray-700"
> >
Alert threshold is set at {{ currency Alert threshold is set at {{ currency
}}{{ team.doc.monthly_alert_threshold }} per month }}{{ team.pg.monthly_alert_threshold }} per month
</div> </div>
<div v-else class="text-gray-700"> <div v-else class="text-gray-700">
Receive an email alert if monthly total exceeds limit set Receive an email alert if monthly total exceeds limit set
@ -139,7 +139,7 @@
<div class="shrink-0"> <div class="shrink-0">
<Button <Button
:label=" :label="
team.doc.receive_budget_alerts ? 'Edit' : 'Set Budget Alert' team.pg.receive_budget_alerts ? 'Edit' : 'Set Budget Alert'
" "
@click="showBudgetAlertDialog = true" @click="showBudgetAlertDialog = true"
> >
@ -220,7 +220,7 @@ const showAddPrepaidCreditsDialog = ref(false);
const showAddCardDialog = ref(false); const showAddCardDialog = ref(false);
const showChangeCardDialog = ref(false); const showChangeCardDialog = ref(false);
const currency = computed(() => (team.doc.currency == 'INR' ? '₹' : '$')); const currency = computed(() => (team.pg.currency == 'INR' ? '₹' : '$'));
const billingDetails = createResource({ const billingDetails = createResource({
url: 'press.api.account.get_billing_information', url: 'press.api.account.get_billing_information',
@ -260,7 +260,7 @@ const paymentModeOptions = [
component: () => component: () =>
h(DropdownItem, { h(DropdownItem, {
label: 'Card', label: 'Card',
active: team.doc.payment_mode === 'Card', active: team.pg.payment_mode === 'Card',
onClick: () => updatePaymentMode('Card'), onClick: () => updatePaymentMode('Card'),
}), }),
}, },
@ -272,19 +272,19 @@ const paymentModeOptions = [
component: () => component: () =>
h(DropdownItem, { h(DropdownItem, {
label: 'Prepaid credits', label: 'Prepaid credits',
active: team.doc.payment_mode === 'Prepaid Credits', active: team.pg.payment_mode === 'Prepaid Credits',
onClick: () => updatePaymentMode('Prepaid Credits'), onClick: () => updatePaymentMode('Prepaid Credits'),
}), }),
}, },
{ {
label: 'Paid by Partner', label: 'Paid by Partner',
value: 'Paid By Partner', value: 'Paid By Partner',
condition: () => team.doc.partner_email, condition: () => team.pg.partner_email,
description: 'Your partner will be charged for monthly subscription', description: 'Your partner will be charged for monthly subscription',
component: () => component: () =>
h(DropdownItem, { h(DropdownItem, {
label: 'Paid by Partner', label: 'Paid by Partner',
active: team.doc.payment_mode === 'Paid by Partner', active: team.pg.payment_mode === 'Paid by Partner',
onClick: () => onClick: () =>
confirmDialog({ confirmDialog({
title: 'Confirm Payment Mode', title: 'Confirm Payment Mode',
@ -323,13 +323,13 @@ const paymentModeOptions = [
]; ];
const paymentMode = computed(() => { const paymentMode = computed(() => {
return paymentModeOptions.find((o) => o.value === team.doc.payment_mode); return paymentModeOptions.find((o) => o.value === team.pg.payment_mode);
}); });
function payUnpaidInvoices() { function payUnpaidInvoices() {
let _unpaidInvoices = unpaidInvoices.data; let _unpaidInvoices = unpaidInvoices.data;
if (_unpaidInvoices.length > 1) { if (_unpaidInvoices.length > 1) {
if (team.doc.payment_mode === 'Prepaid Credits') { if (team.pg.payment_mode === 'Prepaid Credits') {
showAddPrepaidCreditsDialog.value = true; showAddPrepaidCreditsDialog.value = true;
} else { } else {
confirmDialog({ confirmDialog({
@ -348,9 +348,9 @@ function payUnpaidInvoices() {
} }
} else { } else {
let invoice = _unpaidInvoices[0]; let invoice = _unpaidInvoices[0];
if (invoice.stripe_invoice_url && team.doc.payment_mode === 'Card') { if (invoice.stripe_invoice_url && team.pg.payment_mode === 'Card') {
window.open( window.open(
`/api/method/press.api.client.run_doc_method?dt=Invoice&dn=${invoice.name}&method=stripe_payment_url`, `/api/method/press.api.client.run_pg_method?dt=Invoice&dn=${invoice.name}&method=stripe_payment_url`,
); );
} else { } else {
showAddPrepaidCreditsDialog.value = true; showAddPrepaidCreditsDialog.value = true;
@ -366,11 +366,11 @@ function updatePaymentMode(mode) {
showBillingDetailsDialog.value = true; showBillingDetailsDialog.value = true;
return; return;
} }
if (mode === 'Prepaid Credits' && team.doc.balance === 0) { if (mode === 'Prepaid Credits' && team.pg.balance === 0) {
showMessage.value = true; showMessage.value = true;
showAddPrepaidCreditsDialog.value = true; showAddPrepaidCreditsDialog.value = true;
return; return;
} else if (mode === 'Card' && !team.doc.payment_method) { } else if (mode === 'Card' && !team.pg.payment_method) {
showMessage.value = true; showMessage.value = true;
showAddCardDialog.value = true; showAddCardDialog.value = true;
} else if ( } else if (
@ -393,7 +393,7 @@ function updatePaymentMode(mode) {
} }
function changeMethod() { function changeMethod() {
if (team.doc.payment_method) { if (team.pg.payment_method) {
showChangeCardDialog.value = true; showChangeCardDialog.value = true;
} else { } else {
showMessage.value = false; showMessage.value = false;

View File

@ -12,14 +12,14 @@
> >
<template #prefix> <template #prefix>
<div class="grid w-4 place-items-center text-sm text-gray-700"> <div class="grid w-4 place-items-center text-sm text-gray-700">
{{ team.doc.currency === 'INR' ? '₹' : '$' }} {{ team.pg.currency === 'INR' ? '₹' : '$' }}
</div> </div>
</template> </template>
</FormControl> </FormControl>
<FormControl <FormControl
v-if="team.doc.currency === 'INR'" v-if="team.pg.currency === 'INR'"
:label="`Total Amount + GST (${ :label="`Total Amount + GST (${
team.doc?.billing_info.gst_percentage * 100 team.pg?.billing_info.gst_percentage * 100
}%)`" }%)`"
disabled disabled
:modelValue="totalAmount" :modelValue="totalAmount"
@ -28,12 +28,12 @@
> >
<template #prefix> <template #prefix>
<div class="grid w-4 place-items-center text-sm text-gray-700"> <div class="grid w-4 place-items-center text-sm text-gray-700">
{{ team.doc.currency === 'INR' ? '₹' : '$' }} {{ team.pg.currency === 'INR' ? '₹' : '$' }}
</div> </div>
</template> </template>
</FormControl> </FormControl>
<FormControl <FormControl
v-if="team.doc.country === 'Kenya' && paymentGateway === 'M-Pesa'" v-if="team.pg.country === 'Kenya' && paymentGateway === 'M-Pesa'"
:label="`Amount in KES (Exchange Rate: ${Math.round( :label="`Amount in KES (Exchange Rate: ${Math.round(
exchangeRate, exchangeRate,
)} against 1 USD)`" )} against 1 USD)`"
@ -65,9 +65,9 @@
</Button> </Button>
<Button <Button
v-if=" v-if="
team.doc.razorpay_enabled || team.pg.razorpay_enabled ||
team.doc.currency === 'INR' || team.pg.currency === 'INR' ||
(team.doc.currency === 'USD' && paypalEnabled.data) (team.pg.currency === 'USD' && paypalEnabled.data)
" "
size="lg" size="lg"
:class="{ :class="{
@ -75,11 +75,11 @@
}" }"
@click="paymentGateway = 'Razorpay'" @click="paymentGateway = 'Razorpay'"
> >
<RazorpayLogo v-if="team.doc.currency === 'INR'" class="w-24" /> <RazorpayLogo v-if="team.pg.currency === 'INR'" class="w-24" />
<PayPalLogo v-if="team.doc.currency === 'USD'" class="h-7 w-20" /> <PayPalLogo v-if="team.pg.currency === 'USD'" class="h-7 w-20" />
</Button> </Button>
<Button <Button
v-if="team.doc.country === 'Kenya'" v-if="team.pg.country === 'Kenya'"
size="lg" size="lg"
:class="{ :class="{
'border-[1.5px] border-gray-700': paymentGateway === 'M-Pesa', 'border-[1.5px] border-gray-700': paymentGateway === 'M-Pesa',
@ -168,13 +168,13 @@ const totalUnpaidAmount = createResource({
const minimumAmount = computed(() => { const minimumAmount = computed(() => {
if (props.minimumAmount) return props.minimumAmount; if (props.minimumAmount) return props.minimumAmount;
if (!team.doc) return 0; if (!team.pg) return 0;
let unpaidAmount = totalUnpaidAmount.data || 0; let unpaidAmount = totalUnpaidAmount.data || 0;
const minimumDefault = team.doc?.currency == 'INR' ? 410 : 5; const minimumDefault = team.pg?.currency == 'INR' ? 410 : 5;
if (unpaidAmount > 100000 && team.doc?.currency == 'INR') { if (unpaidAmount > 100000 && team.pg?.currency == 'INR') {
unpaidAmount = 100000; unpaidAmount = 100000;
} else if (unpaidAmount > 1450 && team.doc?.currency == 'USD') { } else if (unpaidAmount > 1450 && team.pg?.currency == 'USD') {
unpaidAmount = 1450; unpaidAmount = 1450;
} }
@ -193,10 +193,10 @@ watch(minimumAmount, () => {
const totalAmount = computed(() => { const totalAmount = computed(() => {
const _creditsToBuy = creditsToBuy.value || 0; const _creditsToBuy = creditsToBuy.value || 0;
if (team.doc?.currency === 'INR') { if (team.pg?.currency === 'INR') {
return ( return (
_creditsToBuy + _creditsToBuy +
_creditsToBuy * (team.doc.billing_info.gst_percentage || 0) _creditsToBuy * (team.pg.billing_info.gst_percentage || 0)
).toFixed(2); ).toFixed(2);
} else { } else {
return _creditsToBuy; return _creditsToBuy;

View File

@ -100,8 +100,8 @@ export default {
errorMessage: null, errorMessage: null,
paymentInProgress: false, paymentInProgress: false,
partnerInput: '', partnerInput: '',
phoneNumberInput: this.$team.doc.mpesa_phone_number || '', phoneNumberInput: this.$team.pg.mpesa_phone_number || '',
taxIdInput: this.$team.doc.mpesa_tax_id || '', taxIdInput: this.$team.pg.mpesa_tax_id || '',
teams: [], teams: [],
taxPercentage: 1, taxPercentage: 1,
amountWithTax: 0, amountWithTax: 0,

View File

@ -121,7 +121,7 @@ export default {
return; return;
} }
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: 'Database Server', dt: 'Database Server',
@ -142,7 +142,7 @@ export default {
}, },
indexBinlogs() { indexBinlogs() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams: () => { makeParams: () => {
return { return {
dt: 'Database Server', dt: 'Database Server',

View File

@ -29,7 +29,7 @@ export default {
resources: { resources: {
addIndex() { addIndex() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
initialData: {}, initialData: {},
makeParams: () => { makeParams: () => {
return { return {

View File

@ -26,7 +26,7 @@ export default {
resources: { resources: {
killProcess() { killProcess() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
initialData: {}, initialData: {},
makeParams: () => { makeParams: () => {
return { return {

View File

@ -78,7 +78,7 @@ export default {
// Get the selected text // Get the selected text
if (!selection.empty) { if (!selection.empty) {
const selectedText = state.doc.sliceString( const selectedText = state.pg.sliceString(
selection.from, selection.from,
selection.to, selection.to,
); );

View File

@ -5,7 +5,7 @@
<p class="mt-1 text-p-base text-gray-600">{{ props.description }}</p> <p class="mt-1 text-p-base text-gray-600">{{ props.description }}</p>
</div> </div>
<Button <Button
v-if="releaseGroup?.doc" v-if="releaseGroup?.pg"
class="whitespace-nowrap" class="whitespace-nowrap"
@click="getBenchActionHandler(props.actionLabel)" @click="getBenchActionHandler(props.actionLabel)"
> >
@ -126,7 +126,7 @@ function onDropBench() {
confirmDialog({ confirmDialog({
title: 'Drop Bench Group', title: 'Drop Bench Group',
message: `Are you sure you want to drop the bench group <b>${ message: `Are you sure you want to drop the bench group <b>${
releaseGroup.doc.title || releaseGroup.name releaseGroup.pg.title || releaseGroup.name
}</b>?`, }</b>?`,
fields: [ fields: [
{ {
@ -139,7 +139,7 @@ function onDropBench() {
theme: 'red', theme: 'red',
onClick: ({ hide, values }) => { onClick: ({ hide, values }) => {
if (releaseGroup.delete.loading) return; if (releaseGroup.delete.loading) return;
if (values.confirmBenchName !== releaseGroup.doc.title) { if (values.confirmBenchName !== releaseGroup.pg.title) {
throw new Error('Bench group name does not match'); throw new Error('Bench group name does not match');
} }
toast.promise( toast.promise(

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="mx-auto max-w-3xl space-y-4" v-if="$releaseGroup?.doc?.actions"> <div class="mx-auto max-w-3xl space-y-4" v-if="$releaseGroup?.pg?.actions">
<div <div
v-for="group in actions" v-for="group in actions"
:key="group.group" :key="group.group"
@ -15,7 +15,7 @@
:benchName="releaseGroup" :benchName="releaseGroup"
:group="group.group" :group="group.group"
:actionLabel="row.action" :actionLabel="row.action"
:method="row.doc_method" :method="row.pg_method"
:description="row.description" :description="row.description"
:buttonLabel="row.button_label" :buttonLabel="row.button_label"
/> />
@ -35,7 +35,7 @@ export default {
return getCachedDocumentResource('Release Group', this.releaseGroup); return getCachedDocumentResource('Release Group', this.releaseGroup);
}, },
actions() { actions() {
const groupedActions = this.$releaseGroup.doc.actions.reduce( const groupedActions = this.$releaseGroup.pg.actions.reduce(
(acc, action) => { (acc, action) => {
const group = action.group || 'General Actions'; const group = action.group || 'General Actions';
if (!acc[group]) { if (!acc[group]) {

View File

@ -6,7 +6,7 @@
}" }"
v-model="show" v-model="show"
> >
<template #body-content v-if="$bench.doc"> <template #body-content v-if="$bench.pg">
<div v-if="certificate" class="space-y-4"> <div v-if="certificate" class="space-y-4">
<div class="space-y-2" v-if="isWindows"> <div class="space-y-2" v-if="isWindows">
<h4 class="text-base font-semibold text-gray-700">Step 1</h4> <h4 class="text-base font-semibold text-gray-700">Step 1</h4>
@ -67,7 +67,7 @@
</div> </div>
</div> </div>
<div class="space-y-2 text-p-base text-gray-700" v-else> <div class="space-y-2 text-p-base text-gray-700" v-else>
<p v-if="!$bench.doc.user_ssh_key"> <p v-if="!$bench.pg.user_ssh_key">
It looks like you haven't added your SSH public key. Go to It looks like you haven't added your SSH public key. Go to
<router-link <router-link
:to="{ name: 'SettingsDeveloper' }" :to="{ name: 'SettingsDeveloper' }"
@ -78,7 +78,7 @@
> >
to add your SSH public key. to add your SSH public key.
</p> </p>
<p v-else-if="!$bench.doc.is_ssh_proxy_setup"> <p v-else-if="!$bench.pg.is_ssh_proxy_setup">
SSH access is not enabled for this bench. Please contact support to SSH access is not enabled for this bench. Please contact support to
enable access. enable access.
</p> </p>
@ -100,8 +100,8 @@
#actions #actions
v-if=" v-if="
!certificate && !certificate &&
$bench.doc?.is_ssh_proxy_setup && $bench.pg?.is_ssh_proxy_setup &&
$bench.doc?.user_ssh_key $bench.pg?.user_ssh_key
" "
> >
<Button <Button
@ -140,8 +140,8 @@ export default {
type: 'document', type: 'document',
doctype: 'Bench', doctype: 'Bench',
name: this.bench, name: this.bench,
onSuccess(doc) { onSuccess(pg) {
if (doc.is_ssh_proxy_setup && doc.user_ssh_key) { if (pg.is_ssh_proxy_setup && pg.user_ssh_key) {
this.$releaseGroup.getCertificate.reload(); this.$releaseGroup.getCertificate.reload();
} }
}, },
@ -159,8 +159,8 @@ export default {
return this.$releaseGroup.getCertificate.data; return this.$releaseGroup.getCertificate.data;
}, },
sshCommand() { sshCommand() {
if (!this.$bench.doc) return; if (!this.$bench.pg) return;
return `ssh ${this.$bench.doc.name}@${this.$bench.doc.proxy_server} -p 2222`; return `ssh ${this.$bench.pg.name}@${this.$bench.pg.proxy_server} -p 2222`;
}, },
certificateCommand() { certificateCommand() {
if (this.certificate) { if (this.certificate) {

View File

@ -8,7 +8,7 @@
> >
<template #body-content> <template #body-content>
<AlertBanner <AlertBanner
v-if="benchDocResource.doc.are_builds_suspended" v-if="benchDocResource.pg.are_builds_suspended"
class="mb-4" class="mb-4"
title="<b>Builds Suspended:</b> updates will be scheduled to run when builds resume." title="<b>Builds Suspended:</b> updates will be scheduled to run when builds resume."
type="warning" type="warning"
@ -22,7 +22,7 @@
</h2> </h2>
<GenericList <GenericList
class="max-h-[500px]" class="max-h-[500px]"
v-if="benchDocResource.doc.deploy_information.update_available" v-if="benchDocResource.pg.deploy_information.update_available"
:options="updatableAppOptions" :options="updatableAppOptions"
@update:selections="handleAppSelection" @update:selections="handleAppSelection"
/> />
@ -42,13 +42,13 @@
<h2 class="mb-4 text-lg font-medium">Select sites to update</h2> <h2 class="mb-4 text-lg font-medium">Select sites to update</h2>
<GenericList <GenericList
class="max-h-[500px]" class="max-h-[500px]"
v-if="benchDocResource.doc.deploy_information.sites.length" v-if="benchDocResource.pg.deploy_information.sites.length"
:options="siteOptions" :options="siteOptions"
@update:selections="handleSiteSelection" @update:selections="handleSiteSelection"
/> />
<p <p
class="text-center text-base font-medium text-gray-600" class="text-center text-base font-medium text-gray-600"
v-else-if="!benchDocResource.doc.deploy_information.sites.length" v-else-if="!benchDocResource.pg.deploy_information.sites.length"
> >
No active sites to update No active sites to update
</p> </p>
@ -158,7 +158,7 @@ export default {
if (!this.lastDeploy) { if (!this.lastDeploy) {
// Preselect all updatable apps for first time deploys // Preselect all updatable apps for first time deploys
this.handleAppSelection( this.handleAppSelection(
this.benchDocResource.doc?.deploy_information?.apps?.map( this.benchDocResource.pg?.deploy_information?.apps?.map(
(app) => app.name, (app) => app.name,
) || [], ) || [],
); );
@ -171,7 +171,7 @@ export default {
}, },
computed: { computed: {
updatableAppOptions() { updatableAppOptions() {
let deployInformation = this.benchDocResource.doc.deploy_information; let deployInformation = this.benchDocResource.pg.deploy_information;
let appData = deployInformation.apps.filter( let appData = deployInformation.apps.filter(
(app) => app.update_available === true, (app) => app.update_available === true,
); );
@ -315,7 +315,7 @@ export default {
}; };
}, },
removedAppOptions() { removedAppOptions() {
let deployInformation = this.benchDocResource.doc.deploy_information; let deployInformation = this.benchDocResource.pg.deploy_information;
let appData = deployInformation.removed_apps; let appData = deployInformation.removed_apps;
return { return {
@ -337,7 +337,7 @@ export default {
}; };
}, },
siteOptions() { siteOptions() {
let deployInformation = this.benchDocResource.doc.deploy_information; let deployInformation = this.benchDocResource.pg.deploy_information;
let siteData = deployInformation.sites; let siteData = deployInformation.sites;
let team = getTeam(); let team = getTeam();
@ -376,7 +376,7 @@ export default {
width: 0.3, width: 0.3,
type: 'Component', type: 'Component',
condition() { condition() {
return !!team.doc.skip_backups; return !!team.pg.skip_backups;
}, },
component({ row }) { component({ row }) {
return h(Checkbox, { return h(Checkbox, {
@ -395,15 +395,15 @@ export default {
return getCachedDocumentResource('Release Group', this.bench); return getCachedDocumentResource('Release Group', this.bench);
}, },
hasUpdateAvailable() { hasUpdateAvailable() {
return this.benchDocResource.doc.deploy_information.apps.some( return this.benchDocResource.pg.deploy_information.apps.some(
(app) => app.update_available === true, (app) => app.update_available === true,
); );
}, },
hasRemovedApps() { hasRemovedApps() {
return !!this.benchDocResource.doc.deploy_information.removed_apps.length; return !!this.benchDocResource.pg.deploy_information.removed_apps.length;
}, },
deployInformation() { deployInformation() {
return this.benchDocResource?.doc.deploy_information; return this.benchDocResource?.pg.deploy_information;
}, },
canShowBack() { canShowBack() {
if (this.step === 'select-apps') { if (this.step === 'select-apps') {
@ -451,7 +451,7 @@ export default {
return `Deploy and update ${site}`; return `Deploy and update ${site}`;
}, },
canUpdateInPlace() { canUpdateInPlace() {
if (!this.benchDocResource?.doc?.enable_inplace_updates) { if (!this.benchDocResource?.pg?.enable_inplace_updates) {
return false; return false;
} }
@ -468,7 +468,7 @@ export default {
// Failed in place update benches have to be regular updated. // Failed in place update benches have to be regular updated.
const inPlaceUpdateFailedBenches = const inPlaceUpdateFailedBenches =
this.benchDocResource?.doc?.inplace_update_failed_benches ?? []; this.benchDocResource?.pg?.inplace_update_failed_benches ?? [];
const allSites = this.siteOptions.data const allSites = this.siteOptions.data
.filter( .filter(
@ -544,7 +544,7 @@ export default {
}, },
methods: { methods: {
updateNextRelease(name, next) { updateNextRelease(name, next) {
const app = this.benchDocResource.doc.deploy_information.apps.find( const app = this.benchDocResource.pg.deploy_information.apps.find(
(a) => a.name === name, (a) => a.name === name,
); );
if (app) app.next_release = next; if (app) app.next_release = next;
@ -589,7 +589,7 @@ export default {
}, },
handleAppSelection(apps) { handleAppSelection(apps) {
apps = Array.from(apps); apps = Array.from(apps);
let appData = this.benchDocResource.doc.deploy_information.apps; let appData = this.benchDocResource.pg.deploy_information.apps;
this.selectedApps = appData this.selectedApps = appData
.filter((app) => apps.includes(app.name)) .filter((app) => apps.includes(app.name))
@ -606,7 +606,7 @@ export default {
}, },
handleSiteSelection(sites) { handleSiteSelection(sites) {
sites = Array.from(sites); sites = Array.from(sites);
let siteData = this.benchDocResource.doc.deploy_information.sites; let siteData = this.benchDocResource.pg.deploy_information.sites;
this.selectedSites = siteData.filter((site) => sites.includes(site.name)); this.selectedSites = siteData.filter((site) => sites.includes(site.name));
}, },
@ -619,7 +619,7 @@ export default {
: null; : null;
}, },
initialDeployTo(app) { initialDeployTo(app) {
return this.benchDocResource.doc.deploy_information.apps.find( return this.benchDocResource.pg.deploy_information.apps.find(
(a) => a.app === app.app, (a) => a.app === app.app,
).next_release; ).next_release;
}, },

View File

@ -7,7 +7,7 @@
}" }"
> >
<template #body-content> <template #body-content>
<div v-if="appDoc.doc.review_stage === 'Ready for Review'"> <div v-if="appDoc.pg.review_stage === 'Ready for Review'">
<p class="text-p-base text-gray-700"> <p class="text-p-base text-gray-700">
Your app is sent for review to our team. Please wait for the review to Your app is sent for review to our team. Please wait for the review to
be completed. be completed.
@ -15,7 +15,7 @@
</div> </div>
<ObjectList v-else :options="listOptions" /> <ObjectList v-else :options="listOptions" />
</template> </template>
<template #actions v-if="appDoc.doc.review_stage !== 'Ready for Review'"> <template #actions v-if="appDoc.pg.review_stage !== 'Ready for Review'">
<Button <Button
class="w-full" class="w-full"
variant="solid" variant="solid"

View File

@ -17,14 +17,14 @@
<Badge <Badge
:variant="'subtle'" :variant="'subtle'"
size="lg" size="lg"
:label="$resources.codeScreening.doc.status" :label="$resources.codeScreening.pg.status"
:theme="getBadgeTheme" :theme="getBadgeTheme"
/> />
</div> </div>
<!-- <Button <!-- <Button
iconLeft="check" iconLeft="check"
v-if=" v-if="
isSystemUser && $resources.codeScreening.doc.status == 'Open' isSystemUser && $resources.codeScreening.pg.status == 'Open'
" "
:variant="'subtle'" :variant="'subtle'"
theme="gray" theme="gray"
@ -37,7 +37,7 @@
<Button <Button
iconLeft="x" iconLeft="x"
v-if=" v-if="
isSystemUser && $resources.codeScreening.doc.status == 'Open' isSystemUser && $resources.codeScreening.pg.status == 'Open'
" "
:variant="'subtle'" :variant="'subtle'"
theme="gray" theme="gray"
@ -165,7 +165,7 @@
</div> </div>
<hr class="h-2 mt-2" /> <hr class="h-2 mt-2" />
<NewComment <NewComment
v-if="$resources.codeScreening.doc.status == 'Open'" v-if="$resources.codeScreening.pg.status == 'Open'"
:approval_request_name="row.approval_request_name" :approval_request_name="row.approval_request_name"
:filename="file.name" :filename="file.name"
:line_number="line.context.line_number" :line_number="line.context.line_number"
@ -200,19 +200,19 @@ export default {
}, },
computed: { computed: {
getResults() { getResults() {
if (this.$resources.codeScreening.doc) { if (this.$resources.codeScreening.pg) {
const results = JSON.parse(this.$resources.codeScreening.doc.result); const results = JSON.parse(this.$resources.codeScreening.pg.result);
return results; return results;
} }
}, },
getComments() { getComments() {
if (this.$resources.codeScreening.doc) { if (this.$resources.codeScreening.pg) {
const results = this.$resources.codeScreening.doc.code_comments; const results = this.$resources.codeScreening.pg.code_comments;
return results; return results;
} }
}, },
getBadgeTheme() { getBadgeTheme() {
const status = this.$resources.codeScreening.doc.status.toLowerCase(); const status = this.$resources.codeScreening.pg.status.toLowerCase();
if (status === 'open') { if (status === 'open') {
return 'blue'; return 'blue';
} else if (status === 'approved') { } else if (status === 'approved') {
@ -256,7 +256,7 @@ export default {
approveRelease() { approveRelease() {
this.$resources.codeScreening.setValue.submit({ this.$resources.codeScreening.setValue.submit({
status: 'Approved', status: 'Approved',
reviewed_by: this.$team?.doc?.user, reviewed_by: this.$team?.pg?.user,
}); });
}, },
rejectRelease() { rejectRelease() {
@ -269,7 +269,7 @@ export default {
this.$resources.codeScreening.setValue.submit({ this.$resources.codeScreening.setValue.submit({
status: 'Rejected', status: 'Rejected',
reason_for_rejection: this.rejectionReason, reason_for_rejection: this.rejectionReason,
reviewed_by: this.$team?.doc?.user, reviewed_by: this.$team?.pg?.user,
}); });
this.showRejectReleaseDialog = false; this.showRejectReleaseDialog = false;
}, },

View File

@ -195,7 +195,7 @@ export default {
totalEarnings() { totalEarnings() {
if (!this.installAnalytics.total_payout.inr_amount) return 0; if (!this.installAnalytics.total_payout.inr_amount) return 0;
if (this.$team.doc.currency === 'INR') { if (this.$team.pg.currency === 'INR') {
return ( return (
this.installAnalytics.total_payout.inr_amount + this.installAnalytics.total_payout.inr_amount +
this.installAnalytics.total_payout.usd_amount * 82 this.installAnalytics.total_payout.usd_amount * 82

View File

@ -127,7 +127,7 @@ export default {
url: 'press.api.client.insert', url: 'press.api.client.insert',
makeParams() { makeParams() {
return { return {
doc: { pg: {
...this.app, ...this.app,
doctype: 'Marketplace App', doctype: 'Marketplace App',
version: this.selectedVersion, version: this.selectedVersion,

View File

@ -52,7 +52,7 @@ export default {
name: this.marketplaceApp, name: this.marketplaceApp,
}); });
return appDoc?.doc; return appDoc?.pg;
}, },
}, },
resources: { resources: {
@ -63,7 +63,7 @@ export default {
throw new DashboardError('Reply cannot be empty'); throw new DashboardError('Reply cannot be empty');
} }
const team = getTeam(); const team = getTeam();
if (!team.doc.is_developer) { if (!team.pg.is_developer) {
throw new DashboardError( throw new DashboardError(
'You must be a developer to reply to reviews', 'You must be a developer to reply to reviews',
); );

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<span <span
v-if="team.doc.currency === 'INR'" v-if="team.pg.currency === 'INR'"
class="mt-2.5 inline-flex gap-2 text-base text-gray-700" class="mt-2.5 inline-flex gap-2 text-base text-gray-700"
> >
<FeatherIcon name="info" class="my-1 h-4" /> <FeatherIcon name="info" class="my-1 h-4" />
@ -105,7 +105,7 @@ function processOrder(data) {
order_id: data.order_id, order_id: data.order_id,
name: 'Frappe Cloud', name: 'Frappe Cloud',
image: 'https://frappe.io/files/cloud.png', image: 'https://frappe.io/files/cloud.png',
prefill: { email: team.doc?.user }, prefill: { email: team.pg?.user },
handler: handlePaymentSuccess, handler: handlePaymentSuccess,
theme: { color: '#171717' }, theme: { color: '#171717' },
}; };

View File

@ -99,7 +99,7 @@ export default {
formatPlan(plan) { formatPlan(plan) {
let planDoc = getPlans().find((p) => p.name === plan); let planDoc = getPlans().find((p) => p.name === plan);
if (planDoc) { if (planDoc) {
let india = this.$team.doc.currency === 'INR'; let india = this.$team.pg.currency === 'INR';
return this.$format.userCurrency( return this.$format.userCurrency(
india ? planDoc.price_inr : planDoc.price_usd, india ? planDoc.price_inr : planDoc.price_usd,
); );

View File

@ -146,7 +146,7 @@ export default {
}, },
], ],
filters: { filters: {
partner: this.$team.doc.name, partner: this.$team.pg.name,
}, },
orderBy: 'creation desc', orderBy: 'creation desc',
}; };

View File

@ -29,7 +29,7 @@ export default {
doctype: 'Partner Certificate', doctype: 'Partner Certificate',
fields: ['free', 'certificate_link'], fields: ['free', 'certificate_link'],
filters: { filters: {
team: this.$team.doc.name, team: this.$team.pg.name,
}, },
columns: [ columns: [
{ {
@ -149,7 +149,7 @@ export default {
]; ];
}, },
filters: { filters: {
team: this.$team.doc.name, team: this.$team.pg.name,
}, },
filterControls() { filterControls() {
return [ return [

View File

@ -13,14 +13,14 @@
> >
<template #prefix> <template #prefix>
<div class="grid w-4 place-items-center text-sm text-gray-700"> <div class="grid w-4 place-items-center text-sm text-gray-700">
{{ team.doc.currency === 'INR' ? '₹' : '$' }} {{ team.pg.currency === 'INR' ? '₹' : '$' }}
</div> </div>
</template> </template>
</FormControl> </FormControl>
<FormControl <FormControl
v-if="team.doc.currency === 'INR'" v-if="team.pg.currency === 'INR'"
:label="`Total Amount + GST (${ :label="`Total Amount + GST (${
team.doc?.billing_info.gst_percentage * 100 team.pg?.billing_info.gst_percentage * 100
}%)`" }%)`"
disabled disabled
:modelValue="totalAmount" :modelValue="totalAmount"
@ -30,7 +30,7 @@
> >
<template #prefix> <template #prefix>
<div class="grid w-4 place-items-center text-sm text-gray-700"> <div class="grid w-4 place-items-center text-sm text-gray-700">
{{ team.doc.currency === 'INR' ? '₹' : '$' }} {{ team.pg.currency === 'INR' ? '₹' : '$' }}
</div> </div>
</template> </template>
</FormControl> </FormControl>
@ -41,7 +41,7 @@
<div class="text-xs text-gray-600">Select Payment Gateway</div> <div class="text-xs text-gray-600">Select Payment Gateway</div>
<div class="mt-1.5 grid grid-cols-1 gap-2 sm:grid-cols-2"> <div class="mt-1.5 grid grid-cols-1 gap-2 sm:grid-cols-2">
<Button <Button
v-if="team.doc.currency === 'INR' || team.doc.razorpay_enabled" v-if="team.pg.currency === 'INR' || team.pg.razorpay_enabled"
size="lg" size="lg"
:class="{ :class="{
'border-[1.5px] border-gray-700': paymentGateway === 'Razorpay', 'border-[1.5px] border-gray-700': paymentGateway === 'Razorpay',
@ -101,11 +101,11 @@ const pressSettings = createDocumentResource({
}); });
const maximumAmount = computed(() => { const maximumAmount = computed(() => {
if (!pressSettings.doc) return 0; if (!pressSettings.pg) return 0;
const feeAmount = const feeAmount =
team.doc?.currency == 'INR' team.pg?.currency == 'INR'
? pressSettings.doc.partnership_fee_inr ? pressSettings.pg.partnership_fee_inr
: pressSettings.doc.partnership_fee_usd; : pressSettings.pg.partnership_fee_usd;
return Math.ceil(feeAmount); return Math.ceil(feeAmount);
}); });
@ -115,10 +115,10 @@ const paymentGateway = ref('');
const totalAmount = computed(() => { const totalAmount = computed(() => {
const _creditsToBuy = creditsToBuy.value || 0; const _creditsToBuy = creditsToBuy.value || 0;
if (team.doc?.currency === 'INR') { if (team.pg?.currency === 'INR') {
return ( return (
_creditsToBuy + _creditsToBuy +
_creditsToBuy * (team.doc.billing_info.gst_percentage || 0) _creditsToBuy * (team.pg.billing_info.gst_percentage || 0)
).toFixed(2); ).toFixed(2);
} else { } else {
return _creditsToBuy; return _creditsToBuy;

View File

@ -29,7 +29,7 @@
> >
<template #body-content> <template #body-content>
<p class="pb-3 text-p-base"> <p class="pb-3 text-p-base">
Enter the equivalent amount of credits (in {{ $team.doc.currency }}) Enter the equivalent amount of credits (in {{ $team.pg.currency }})
you wish to transfer. you wish to transfer.
</p> </p>
<FormControl placeholder="Amount" v-model="amount" autocomplete="off" /> <FormControl placeholder="Amount" v-model="amount" autocomplete="off" />
@ -48,7 +48,7 @@
$resources.transferCredits.submit({ $resources.transferCredits.submit({
amount: amount, amount: amount,
customer: customerTeam.name, customer: customerTeam.name,
partner: $team.doc.name, partner: $team.pg.name,
}) })
" "
> >

View File

@ -29,7 +29,7 @@
:config="{ :config="{
title: 'Contribution', title: 'Contribution',
value: currentMonthContribution.data || 0, value: currentMonthContribution.data || 0,
prefix: team.doc.currency == 'INR' ? '₹' : '$', prefix: team.pg.currency == 'INR' ? '₹' : '$',
}" }"
class="border rounded-md" class="border rounded-md"
/> />
@ -93,7 +93,7 @@ const partnerDetails = createResource({
auto: true, auto: true,
cache: 'partnerDetails', cache: 'partnerDetails',
params: { params: {
partner_email: team.doc.partner_email, partner_email: team.pg.partner_email,
}, },
}); });
@ -102,7 +102,7 @@ const currentMonthContribution = createResource({
auto: true, auto: true,
cache: 'currentMonthContribution', cache: 'currentMonthContribution',
params: { params: {
partner_email: team.doc.partner_email, partner_email: team.pg.partner_email,
}, },
}); });
@ -111,7 +111,7 @@ let partnerInvoices = createResource({
auto: true, auto: true,
cache: 'partnerInvoices', cache: 'partnerInvoices',
params: { params: {
partner_email: team.doc.partner_email, partner_email: team.pg.partner_email,
}, },
}); });
@ -142,7 +142,7 @@ let partnerCustomerDistribution = createResource({
auto: true, auto: true,
cache: 'partnerCustomerDistribution', cache: 'partnerCustomerDistribution',
params: { params: {
partner_email: team.doc.partner_email, partner_email: team.pg.partner_email,
}, },
}); });

View File

@ -2,7 +2,7 @@
<div> <div>
<div <div
v-if=" v-if="
lead && (lead.partner_team == $team.doc.name || $team.doc.is_desk_user) lead && (lead.partner_team == $team.pg.name || $team.pg.is_desk_user)
" "
> >
<div class="flex flex-col gap-5 overflow-y-auto px-60 py-6"> <div class="flex flex-col gap-5 overflow-y-auto px-60 py-6">
@ -307,7 +307,7 @@ export default {
].filter((d) => d.condition ?? true); ].filter((d) => d.condition ?? true);
}, },
lead() { lead() {
return this.$resources.lead.doc; return this.$resources.lead.pg;
}, },
statusOptions() { statusOptions() {
return [ return [

View File

@ -109,7 +109,7 @@ export default {
{ {
label: 'Partner', label: 'Partner',
fieldname: 'partner_team', fieldname: 'partner_team',
condition: () => Boolean(this.$team.doc.is_desk_user), condition: () => Boolean(this.$team.pg.is_desk_user),
}, },
], ],
filterControls() { filterControls() {

View File

@ -3,7 +3,7 @@
<div class="grid grid-cols-1 gap-5 sm:grid-cols-2"> <div class="grid grid-cols-1 gap-5 sm:grid-cols-2">
<!-- Adding Mpesa Details --> <!-- Adding Mpesa Details -->
<div <div
v-if="$team.doc.country === 'Kenya'" v-if="$team.pg.country === 'Kenya'"
class="flex flex-col gap-2 rounded-md border p-4 shadow" class="flex flex-col gap-2 rounded-md border p-4 shadow"
> >
<div class="flex justify-between items-center text-sm text-gray-700"> <div class="flex justify-between items-center text-sm text-gray-700">

View File

@ -8,8 +8,8 @@
</h1> </h1>
<Badge <Badge
variant="subtle" variant="subtle"
:label="team.doc.partner_status" :label="team.pg.partner_status"
:theme="team.doc.partner_status == 'Active' ? 'green' : 'gray'" :theme="team.pg.partner_status == 'Active' ? 'green' : 'gray'"
/> />
</div> </div>
</div> </div>
@ -84,7 +84,7 @@
<div class="flex"> <div class="flex">
<h3 class="font-semibold text-lg">Partner Referral Code</h3> <h3 class="font-semibold text-lg">Partner Referral Code</h3>
</div> </div>
<ClickToCopyField :textContent="team.doc?.partner_referral_code" /> <ClickToCopyField :textContent="team.pg?.partner_referral_code" />
<span class="text-sm text-gray-600" <span class="text-sm text-gray-600"
>Share code with customers to link with your account.</span >Share code with customers to link with your account.</span
> >
@ -123,7 +123,7 @@
:options="{ size: '5xl', title: 'Contributions of this month' }" :options="{ size: '5xl', title: 'Contributions of this month' }"
> >
<template #body-content> <template #body-content>
<PartnerContribution :partnerEmail="team.doc.partner_email" /> <PartnerContribution :partnerEmail="team.pg.partner_email" />
</template> </template>
</Dialog> </Dialog>
@ -166,7 +166,7 @@
showRenewalConfirmationDialog = false; showRenewalConfirmationDialog = false;
partnerConsent.insert.submit({ partnerConsent.insert.submit({
agreed: true, agreed: true,
team: $team.doc?.name, team: $team.pg?.name,
}); });
}, },
}, },
@ -218,7 +218,7 @@ const partnerDetails = createResource({
auto: true, auto: true,
cache: 'partnerDetails', cache: 'partnerDetails',
params: { params: {
partner_email: team.doc.partner_email, partner_email: team.pg.partner_email,
}, },
onSuccess(data) { onSuccess(data) {
calculateNextTier(data.partner_type); calculateNextTier(data.partner_type);
@ -257,7 +257,7 @@ const currentMonthContribution = createResource({
auto: true, auto: true,
cache: 'currentMonthContribution', cache: 'currentMonthContribution',
params: { params: {
partner_email: team.doc.partner_email, partner_email: team.pg.partner_email,
}, },
}); });
@ -266,7 +266,7 @@ const prevMonthContribution = createResource({
auto: true, auto: true,
cache: 'prevMonthContribution', cache: 'prevMonthContribution',
params: { params: {
partner_email: team.doc.partner_email, partner_email: team.pg.partner_email,
}, },
}); });
@ -298,27 +298,27 @@ function calculateNextTier(tier) {
case 'Entry': case 'Entry':
next_tier = 'Emerging'; next_tier = 'Emerging';
nextTierTarget.value = nextTierTarget.value =
team.doc.currency === 'INR' ? target_inr.Emerging : target_usd.Emerging; team.pg.currency === 'INR' ? target_inr.Emerging : target_usd.Emerging;
break; break;
case 'Emerging': case 'Emerging':
next_tier = 'Bronze'; next_tier = 'Bronze';
nextTierTarget.value = nextTierTarget.value =
team.doc.currency === 'INR' ? target_inr.Bronze : target_usd.Bronze; team.pg.currency === 'INR' ? target_inr.Bronze : target_usd.Bronze;
break; break;
case 'Bronze': case 'Bronze':
next_tier = 'Silver'; next_tier = 'Silver';
nextTierTarget.value = nextTierTarget.value =
team.doc.currency === 'INR' ? target_inr.Silver : target_usd.Silver; team.pg.currency === 'INR' ? target_inr.Silver : target_usd.Silver;
break; break;
case 'Silver': case 'Silver':
next_tier = 'Gold'; next_tier = 'Gold';
nextTierTarget.value = nextTierTarget.value =
team.doc.currency === 'INR' ? target_inr.Gold : target_usd.Gold; team.pg.currency === 'INR' ? target_inr.Gold : target_usd.Gold;
break; break;
default: default:
next_tier = 'Gold'; next_tier = 'Gold';
nextTierTarget.value = nextTierTarget.value =
team.doc.currency === 'INR' ? target_inr.Gold : target_usd.Gold; team.pg.currency === 'INR' ? target_inr.Gold : target_usd.Gold;
} }
nextTier.value = next_tier; nextTier.value = next_tier;
tierProgressValue.value = calculateTierProgress(nextTierTarget.value); tierProgressValue.value = calculateTierProgress(nextTierTarget.value);
@ -346,7 +346,7 @@ const formatDate = (dateString) => {
const formatCurrency = (amount) => { const formatCurrency = (amount) => {
return new Intl.NumberFormat('en-US', { return new Intl.NumberFormat('en-US', {
style: 'currency', style: 'currency',
currency: team.doc.currency, currency: team.pg.currency,
maximumFractionDigits: 2, maximumFractionDigits: 2,
}).format(amount); }).format(amount);
}; };

View File

@ -61,7 +61,7 @@ export default {
filters: { filters: {
docstatus: 1, docstatus: 1,
partner: this.$team.doc.name, partner: this.$team.pg.name,
}, },
primaryAction() { primaryAction() {
return { return {

View File

@ -116,7 +116,7 @@ const partnerDetails = createResource({
auto: true, auto: true,
cache: 'partnerDetails', cache: 'partnerDetails',
params: { params: {
partner_email: team.doc.partner_email, partner_email: team.pg.partner_email,
}, },
}); });

View File

@ -112,17 +112,17 @@ export default {
}, },
computed: { computed: {
autoScale() { autoScale() {
return this.$resources.autoScale?.doc ?? {}; return this.$resources.autoScale?.pg ?? {};
}, },
steps() { steps() {
return this.$resources.autoScale?.doc?.steps || []; return this.$resources.autoScale?.pg?.steps || [];
}, },
dropdownOptions() { dropdownOptions() {
return [ return [
{ {
label: 'View in Desk', label: 'View in Desk',
icon: 'external-link', icon: 'external-link',
condition: () => this.$team.doc?.is_desk_user, condition: () => this.$team.pg?.is_desk_user,
onClick: () => { onClick: () => {
window.open( window.open(
`${window.location.protocol}//${window.location.host}/app/auto-scale-record/${this.id}`, `${window.location.protocol}//${window.location.host}/app/auto-scale-record/${this.id}`,

View File

@ -137,7 +137,7 @@ export default {
url: 'press.api.server.get_reclaimable_size', url: 'press.api.server.get_reclaimable_size',
makeParams: () => { makeParams: () => {
return { return {
name: this.server.doc.name, name: this.server.pg.name,
}; };
}, },
auto: false, auto: false,

View File

@ -103,7 +103,7 @@ export default {
resources: { resources: {
binlogs() { binlogs() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
initialData: {}, initialData: {},
makeParams: () => { makeParams: () => {
return { return {
@ -131,7 +131,7 @@ export default {
if (!this.purgeFrom) return; if (!this.purgeFrom) return;
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
initialData: {}, initialData: {},
makeParams: () => { makeParams: () => {
return { return {

View File

@ -40,7 +40,7 @@ export default {
resources: { resources: {
mariadbVariables() { mariadbVariables() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
params: { params: {
dt: 'Database Server', dt: 'Database Server',
dn: this.name, dn: this.name,

View File

@ -89,8 +89,8 @@ export default {
immediate: true, immediate: true,
handler(serverName) { handler(serverName) {
if (serverName) { if (serverName) {
if (this.$server?.doc?.plan) { if (this.$server?.pg?.plan) {
this.plan = this.$server.doc.current_plan; this.plan = this.$server.pg.current_plan;
} }
} }
}, },
@ -102,9 +102,9 @@ export default {
url: 'press.api.server.secondary_server_plans', url: 'press.api.server.secondary_server_plans',
params: { params: {
name: 'Server', name: 'Server',
cluster: this.$server.doc.cluster, cluster: this.$server.pg.cluster,
platform: this.$server.doc.current_plan.platform, platform: this.$server.pg.current_plan.platform,
current_plan: this.$server.doc.current_plan.name, current_plan: this.$server.pg.current_plan.name,
}, },
auto: true, auto: true,
initialData: [], initialData: [],
@ -120,7 +120,7 @@ export default {
this.show = false; this.show = false;
this.$toast.success('Starting secondary server setup'); this.$toast.success('Starting secondary server setup');
this.$router.push({ this.$router.push({
path: this.$server.doc.name, path: this.$server.pg.name,
path: 'plays', path: 'plays',
}); });
}, },

View File

@ -5,7 +5,7 @@
<p class="mt-1 text-p-base text-gray-600">{{ props.description }}</p> <p class="mt-1 text-p-base text-gray-600">{{ props.description }}</p>
</div> </div>
<Button <Button
v-if="server?.doc" v-if="server?.pg"
class="whitespace-nowrap" class="whitespace-nowrap"
@click="getServerActionHandler(props.actionLabel)" @click="getServerActionHandler(props.actionLabel)"
> >
@ -71,11 +71,11 @@ function getServerActionHandler(action) {
} }
function onNotificationSettings() { function onNotificationSettings() {
if (!server?.doc) return; if (!server?.pg) return;
return renderDialog( return renderDialog(
h(CommunicationInfoDialog, { h(CommunicationInfoDialog, {
referenceDoctype: 'Server', referenceDoctype: 'Server',
referenceName: server.doc.name, referenceName: server.pg.name,
}), }),
); );
} }
@ -188,7 +188,7 @@ function onSetupSecondaryServer() {
hide(); hide();
renderDialog( renderDialog(
h(SecondaryServerPlanDialog, { h(SecondaryServerPlanDialog, {
server: server.doc.name, server: server.pg.name,
}), }),
); );
}, },
@ -198,7 +198,7 @@ function onSetupSecondaryServer() {
function onRebootServer() { function onRebootServer() {
confirmDialog({ confirmDialog({
title: 'Reboot Server', title: 'Reboot Server',
message: `Are you sure you want to reboot the server <b>${server.doc.name}</b>?`, message: `Are you sure you want to reboot the server <b>${server.pg.name}</b>?`,
fields: [ fields: [
{ {
label: 'Please type the server name to confirm', label: 'Please type the server name to confirm',
@ -210,7 +210,7 @@ function onRebootServer() {
}, },
onSuccess({ hide, values }) { onSuccess({ hide, values }) {
if (server.reboot.loading) return; if (server.reboot.loading) return;
if (values.confirmServerName !== server.doc.name) { if (values.confirmServerName !== server.pg.name) {
throw new Error('Server name does not match'); throw new Error('Server name does not match');
} }
toast.promise( toast.promise(
@ -324,12 +324,12 @@ function onDisableAutoDiskExpansion() {
function onDropServer() { function onDropServer() {
const databaseServer = createDocumentResource({ const databaseServer = createDocumentResource({
doctype: 'Database Server', doctype: 'Database Server',
name: server.doc.database_server, name: server.pg.database_server,
}); });
confirmDialog({ confirmDialog({
title: 'Drop Server', title: 'Drop Server',
message: `<div class="prose text-base">Are you sure you want to drop your servers?<br><br>Following servers will be dropped<ul><li>${server.doc.title} (<b>${server.doc.name}</b>)</li><li>${databaseServer.doc.title} (<b>${server.doc.database_server}</b>)</li></ul><br>This action cannot be undone.</div>`, message: `<div class="prose text-base">Are you sure you want to drop your servers?<br><br>Following servers will be dropped<ul><li>${server.pg.title} (<b>${server.pg.name}</b>)</li><li>${databaseServer.pg.title} (<b>${server.pg.database_server}</b>)</li></ul><br>This action cannot be undone.</div>`,
fields: [ fields: [
{ {
label: "Please type either server's name or title to confirm", label: "Please type either server's name or title to confirm",
@ -343,10 +343,10 @@ function onDropServer() {
onSuccess({ hide, values }) { onSuccess({ hide, values }) {
if (server.dropServer.loading) return; if (server.dropServer.loading) return;
if ( if (
values.confirmServerName !== server.doc.name && values.confirmServerName !== server.pg.name &&
values.confirmServerName !== server.doc.database_server && values.confirmServerName !== server.pg.database_server &&
values.confirmServerName.trim() !== server.doc.title.trim() && values.confirmServerName.trim() !== server.pg.title.trim() &&
values.confirmServerName.trim() !== databaseServer.doc.title.trim() values.confirmServerName.trim() !== databaseServer.pg.title.trim()
) { ) {
throw new Error('Server name does not match'); throw new Error('Server name does not match');
} }
@ -369,7 +369,7 @@ function onEnableBinlogIndexing() {
if (!server.enableBinlogIndexing) return; if (!server.enableBinlogIndexing) return;
confirmDialog({ confirmDialog({
title: 'Enable Binlog Indexing', title: 'Enable Binlog Indexing',
message: `Are you sure you want to enable the Binlog Indexing on the database server <b>${server.doc.name}</b> ?<br><br><b>Note:</b> Binlog indexes will consume additional disk space (10% of total binlog size). It can take upto 1 day to index existing binlogs depending on the size of binlogs.`, message: `Are you sure you want to enable the Binlog Indexing on the database server <b>${server.pg.name}</b> ?<br><br><b>Note:</b> Binlog indexes will consume additional disk space (10% of total binlog size). It can take upto 1 day to index existing binlogs depending on the size of binlogs.`,
primaryAction: { primaryAction: {
label: 'Enable Binlog Indexing', label: 'Enable Binlog Indexing',
}, },
@ -395,7 +395,7 @@ function onDisableBinlogIndexing() {
if (!server.disableBinlogIndexing) return; if (!server.disableBinlogIndexing) return;
confirmDialog({ confirmDialog({
title: 'Disable Binlog Indexing', title: 'Disable Binlog Indexing',
message: `Are you sure you want to disable the Binlog Indexing on the database server <b>${server.doc.name}</b> ?<br><br><b>Note:</b> Disabling binlog indexing will remove all existing binlog indexes from the server.`, message: `Are you sure you want to disable the Binlog Indexing on the database server <b>${server.pg.name}</b> ?<br><br><b>Note:</b> Disabling binlog indexing will remove all existing binlog indexes from the server.`,
primaryAction: { primaryAction: {
label: 'Disable Binlog Indexing', label: 'Disable Binlog Indexing',
}, },
@ -421,7 +421,7 @@ function onEnablePerformanceSchema() {
if (!server.enablePerformanceSchema) return; if (!server.enablePerformanceSchema) return;
confirmDialog({ confirmDialog({
title: 'Enable Performance Schema', title: 'Enable Performance Schema',
message: `Are you sure you want to enable the Performance Schema on the database server <b>${server.doc.name}</b> ?<br><br><b>Note:</b> Your database server will be restarted to apply the changes. Your sites will face few minutes of downtime.`, message: `Are you sure you want to enable the Performance Schema on the database server <b>${server.pg.name}</b> ?<br><br><b>Note:</b> Your database server will be restarted to apply the changes. Your sites will face few minutes of downtime.`,
fields: [ fields: [
{ {
label: 'Please type the server name to confirm', label: 'Please type the server name to confirm',
@ -433,7 +433,7 @@ function onEnablePerformanceSchema() {
}, },
onSuccess({ hide, values }) { onSuccess({ hide, values }) {
if (server.enablePerformanceSchema.loading) return; if (server.enablePerformanceSchema.loading) return;
if (values.confirmServerName !== server.doc.name) { if (values.confirmServerName !== server.pg.name) {
throw new Error('Server name does not match'); throw new Error('Server name does not match');
} }
toast.promise( toast.promise(
@ -456,7 +456,7 @@ function onDisablePerformanceSchema() {
if (!server.disablePerformanceSchema) return; if (!server.disablePerformanceSchema) return;
confirmDialog({ confirmDialog({
title: 'Disable Performance Schema', title: 'Disable Performance Schema',
message: `Are you sure you want to disable the Performance Schema on the database server <b>${server.doc.name}</b> ?<br><br><b>Note:</b> Your database server will be restarted to apply the changes. Your sites will face few minutes of downtime.`, message: `Are you sure you want to disable the Performance Schema on the database server <b>${server.pg.name}</b> ?<br><br><b>Note:</b> Your database server will be restarted to apply the changes. Your sites will face few minutes of downtime.`,
fields: [ fields: [
{ {
label: 'Please type the server name to confirm', label: 'Please type the server name to confirm',
@ -468,7 +468,7 @@ function onDisablePerformanceSchema() {
}, },
onSuccess({ hide, values }) { onSuccess({ hide, values }) {
if (server.disablePerformanceSchema.loading) return; if (server.disablePerformanceSchema.loading) return;
if (values.confirmServerName !== server.doc.name) { if (values.confirmServerName !== server.pg.name) {
throw new Error('Server name does not match'); throw new Error('Server name does not match');
} }
toast.promise( toast.promise(
@ -491,13 +491,13 @@ function onUpdateInnodbBufferPoolSize() {
if (!server.updateInnodbBufferPoolSize) return; if (!server.updateInnodbBufferPoolSize) return;
confirmDialog({ confirmDialog({
title: 'Update InnoDB Buffer Pool Size', title: 'Update InnoDB Buffer Pool Size',
message: `Are you sure you want to change the InnoDB Buffer Pool Size of the database server <b>${server.doc.name}</b> ? <br><br> Recommended Buffer Pool Size is <b>${server.doc.mariadb_variables_recommended_values.innodb_buffer_pool_size} MB</b>`, message: `Are you sure you want to change the InnoDB Buffer Pool Size of the database server <b>${server.pg.name}</b> ? <br><br> Recommended Buffer Pool Size is <b>${server.pg.mariadb_variables_recommended_values.innodb_buffer_pool_size} MB</b>`,
fields: [ fields: [
{ {
label: 'Enter the new InnoDB Buffer Pool Size (MB)', label: 'Enter the new InnoDB Buffer Pool Size (MB)',
fieldname: 'innodbBufferPoolSize', fieldname: 'innodbBufferPoolSize',
type: 'number', type: 'number',
default: server.doc.mariadb_variables.innodb_buffer_pool_size, default: server.pg.mariadb_variables.innodb_buffer_pool_size,
}, },
], ],
primaryAction: { primaryAction: {
@ -535,13 +535,13 @@ function onUpdateBinlogRetention() {
if (!server.updateBinlogRetention) return; if (!server.updateBinlogRetention) return;
confirmDialog({ confirmDialog({
title: 'Update Binlog Retention', title: 'Update Binlog Retention',
message: `Are you sure you want to change the Binlog Retention of the database server <b>${server.doc.name}</b> ? <br><br> Recommended Binlog Retention is <b>${server.doc.mariadb_variables_recommended_values.expire_logs_days} days</b>`, message: `Are you sure you want to change the Binlog Retention of the database server <b>${server.pg.name}</b> ? <br><br> Recommended Binlog Retention is <b>${server.pg.mariadb_variables_recommended_values.expire_logs_days} days</b>`,
fields: [ fields: [
{ {
label: 'Enter the new Binlog Retention (days)', label: 'Enter the new Binlog Retention (days)',
fieldname: 'days', fieldname: 'days',
type: 'number', type: 'number',
default: server.doc.mariadb_variables.expire_logs_days, default: server.pg.mariadb_variables.expire_logs_days,
}, },
], ],
primaryAction: { primaryAction: {
@ -585,13 +585,13 @@ function onUpdateBinlogSizeLimit() {
label: 'Enable Binlog Auto Purging', label: 'Enable Binlog Auto Purging',
fieldname: 'enabled', fieldname: 'enabled',
type: 'checkbox', type: 'checkbox',
default: server.doc.auto_purge_binlog_based_on_size, default: server.pg.auto_purge_binlog_based_on_size,
}, },
{ {
label: 'Percent of disk space can be used by binlog (10-90)', label: 'Percent of disk space can be used by binlog (10-90)',
fieldname: 'size', fieldname: 'size',
type: 'number', type: 'number',
default: server.doc.binlog_max_disk_usage_percent, default: server.pg.binlog_max_disk_usage_percent,
condition: (values) => values.enabled, condition: (values) => values.enabled,
}, },
], ],
@ -631,7 +631,7 @@ function onViewMariaDBBinlogs() {
if (!server.getBinlogsInfo) return; if (!server.getBinlogsInfo) return;
renderDialog( renderDialog(
h(DatabaseBinlogsDialog, { h(DatabaseBinlogsDialog, {
databaseServer: server.doc.name, databaseServer: server.pg.name,
}), }),
); );
} }
@ -640,13 +640,13 @@ function onUpdateMaxDBConnections() {
if (!server.updateMaxDbConnections) return; if (!server.updateMaxDbConnections) return;
confirmDialog({ confirmDialog({
title: 'Update Max DB Connections', title: 'Update Max DB Connections',
message: `Are you sure you want to change the Max DB Connections of the database server <b>${server.doc.name}</b> ?<br><br> Recommended Max DB Connections is <b>${server.doc.mariadb_variables_recommended_values.max_connections}</b>`, message: `Are you sure you want to change the Max DB Connections of the database server <b>${server.pg.name}</b> ?<br><br> Recommended Max DB Connections is <b>${server.pg.mariadb_variables_recommended_values.max_connections}</b>`,
fields: [ fields: [
{ {
label: 'Enter the new Max DB Connections', label: 'Enter the new Max DB Connections',
fieldname: 'maxDBConnections', fieldname: 'maxDBConnections',
type: 'number', type: 'number',
default: server.doc.mariadb_variables.max_connections, default: server.pg.mariadb_variables.max_connections,
}, },
], ],
primaryAction: { primaryAction: {
@ -683,7 +683,7 @@ function onUpdateMaxDBConnections() {
function onViewDatabaseConfiguration() { function onViewDatabaseConfiguration() {
renderDialog( renderDialog(
h(DatabaseConfigurationDialog, { h(DatabaseConfigurationDialog, {
name: server.doc.name, name: server.pg.name,
}), }),
); );
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<div <div
class="mx-auto max-w-3xl space-y-4" class="mx-auto max-w-3xl space-y-4"
v-if="$appServer?.doc?.actions && $dbServer?.doc?.actions" v-if="$appServer?.pg?.actions && $dbServer?.pg?.actions"
> >
<div <div
v-for="group in actions" v-for="group in actions"
@ -19,7 +19,7 @@
:serverName="row.server_name" :serverName="row.server_name"
:serverType="row.server_doctype" :serverType="row.server_doctype"
:actionLabel="row.action" :actionLabel="row.action"
:method="row.doc_method" :method="row.pg_method"
:description="row.description" :description="row.description"
:buttonLabel="row.button_label" :buttonLabel="row.button_label"
/> />
@ -39,9 +39,9 @@ export default {
computed: { computed: {
actions() { actions() {
const totalActions = [ const totalActions = [
...this.$appServer.doc.actions, ...this.$appServer.pg.actions,
...this.$dbServer.doc.actions, ...this.$dbServer.pg.actions,
...(this.$dbReplicaServer?.doc?.actions || []), ...(this.$dbReplicaServer?.pg?.actions || []),
]; ];
const groupedActions = totalActions.reduce((acc, action) => { const groupedActions = totalActions.reduce((acc, action) => {
@ -78,7 +78,7 @@ export default {
// Should mirror the whitelistedMethods in ServerOverview.vue // Should mirror the whitelistedMethods in ServerOverview.vue
return getDocResource({ return getDocResource({
doctype: 'Database Server', doctype: 'Database Server',
name: this.$appServer.doc.database_server, name: this.$appServer.pg.database_server,
whitelistedMethods: { whitelistedMethods: {
changePlan: 'change_plan', changePlan: 'change_plan',
reboot: 'reboot', reboot: 'reboot',
@ -99,7 +99,7 @@ export default {
$dbReplicaServer() { $dbReplicaServer() {
return getDocResource({ return getDocResource({
doctype: 'Database Server', doctype: 'Database Server',
name: this.$appServer.doc.replication_server, name: this.$appServer.pg.replication_server,
whitelistedMethods: { whitelistedMethods: {
changePlan: 'change_plan', changePlan: 'change_plan',
reboot: 'reboot', reboot: 'reboot',

View File

@ -747,15 +747,15 @@ export default {
return [ return [
{ {
label: 'Application Server', label: 'Application Server',
value: this.$server.doc.name, value: this.$server.pg.name,
}, },
{ {
label: 'Database Server', label: 'Database Server',
value: this.$server.doc.database_server, value: this.$server.pg.database_server,
}, },
{ {
label: 'Replication Server', label: 'Replication Server',
value: this.$server.doc.replication_server, value: this.$server.pg.replication_server,
}, },
].filter((v) => v.value); ].filter((v) => v.value);
}, },

View File

@ -81,7 +81,7 @@ export default {
}, },
create_snapshot() { create_snapshot() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: 'Server', dt: 'Server',
@ -104,14 +104,14 @@ export default {
return this.$resources?.options?.data ?? {}; return this.$resources?.options?.data ?? {};
}, },
snapshotPlanRate() { snapshotPlanRate() {
if (!this.$team?.doc?.currency) return -1; if (!this.$team?.pg?.currency) return -1;
try { try {
let priceField = let priceField =
this.$team.doc.currency === 'INR' ? 'price_inr' : 'price_usd'; this.$team.pg.currency === 'INR' ? 'price_inr' : 'price_usd';
return ( return (
(this.options?.snapshot_plan?.[priceField] || 0) + (this.options?.snapshot_plan?.[priceField] || 0) +
' ' + ' ' +
this.$team.doc.currency + this.$team.pg.currency +
' / GB / month' ' / GB / month'
); );
} catch (error) { } catch (error) {

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="w-100" v-if="$appServer?.doc"> <div class="w-100" v-if="$appServer?.pg">
<CustomAlerts ctx_type="Server" :ctx_name="$appServer?.doc?.name" /> <CustomAlerts ctx_type="Server" :ctx_name="$appServer?.pg?.name" />
<div class="grid grid-cols-1 items-start gap-5 sm:grid-cols-2"> <div class="grid grid-cols-1 items-start gap-5 sm:grid-cols-2">
<div <div
v-for="server in $appServer?.doc?.secondary_server v-for="server in $appServer?.pg?.secondary_server
? $dbReplicaServer?.doc ? $dbReplicaServer?.pg
? [ ? [
'Server', 'Server',
'App Secondary Server', 'App Secondary Server',
@ -12,7 +12,7 @@
'Replication Server', 'Replication Server',
] ]
: ['Server', 'App Secondary Server', 'Database Server'] : ['Server', 'App Secondary Server', 'Database Server']
: $dbReplicaServer?.doc : $dbReplicaServer?.pg
? ['Server', 'Database Server', 'Replication Server'] ? ['Server', 'Database Server', 'Replication Server']
: ['Server', 'Database Server']" : ['Server', 'Database Server']"
class="col-span-1 rounded-md border lg:col-span-2" class="col-span-1 rounded-md border lg:col-span-2"
@ -21,7 +21,7 @@
class="grid grid-cols-2 lg:grid-cols-4" class="grid grid-cols-2 lg:grid-cols-4"
:class="{ :class="{
'opacity-70 pointer-events-none': 'opacity-70 pointer-events-none':
server === 'App Secondary Server' && !$appServer?.doc?.scaled_up, server === 'App Secondary Server' && !$appServer?.pg?.scaled_up,
}" }"
> >
<template v-for="(d, i) in currentUsage(server)" :key="d.value"> <template v-for="(d, i) in currentUsage(server)" :key="d.value">
@ -42,7 +42,7 @@
<Badge <Badge
v-if=" v-if="
server === 'App Secondary Server' && server === 'App Secondary Server' &&
!$appServer?.doc?.scaled_up !$appServer?.pg?.scaled_up
" "
class="ml-2" class="ml-2"
theme="gray" theme="gray"
@ -86,7 +86,7 @@
<Button <Button
v-if=" v-if="
d.type === 'header' && d.type === 'header' &&
!$appServer.doc.is_self_hosted && !$appServer.pg.is_self_hosted &&
server != 'App Secondary Server' server != 'App Secondary Server'
" "
@click="showPlanChangeDialog(server)" @click="showPlanChangeDialog(server)"
@ -96,9 +96,9 @@
<Button <Button
v-if=" v-if="
server === 'Server' && server === 'Server' &&
!$appServer?.doc?.scaled_up && !$appServer?.pg?.scaled_up &&
$appServer?.doc?.status === 'Active' && $appServer?.pg?.status === 'Active' &&
$appServer?.doc?.secondary_server $appServer?.pg?.secondary_server
" "
:disabled="startedScaleUp" :disabled="startedScaleUp"
@click="scaleUp()" @click="scaleUp()"
@ -108,7 +108,7 @@
<Button <Button
v-if=" v-if="
server === 'App Secondary Server' && server === 'App Secondary Server' &&
$appServer?.doc?.scaled_up $appServer?.pg?.scaled_up
" "
:disabled="startedScaleDown" :disabled="startedScaleDown"
@click="scaleDown()" @click="scaleDown()"
@ -306,34 +306,34 @@ export default {
}); });
}, },
currentUsage(serverType) { currentUsage(serverType) {
if (!this.$appServer?.doc) return []; if (!this.$appServer?.pg) return [];
if (!this.$dbServer?.doc) return []; if (!this.$dbServer?.pg) return [];
let formatBytes = (v) => this.$format.bytes(v, 0, 2); let formatBytes = (v) => this.$format.bytes(v, 0, 2);
let doc = let pg =
serverType === 'Server' serverType === 'Server'
? this.$appServer.doc ? this.$appServer.pg
: serverType === 'App Secondary Server' : serverType === 'App Secondary Server'
? this.$appSecondaryServer?.doc ? this.$appSecondaryServer?.pg
: serverType === 'Database Server' : serverType === 'Database Server'
? this.$dbServer.doc ? this.$dbServer.pg
: serverType === 'Replication Server' : serverType === 'Replication Server'
? this.$dbReplicaServer?.doc ? this.$dbReplicaServer?.pg
: null; : null;
if (!doc) return []; if (!pg) return [];
let currentPlan = doc.current_plan; let currentPlan = pg.current_plan;
let currentUsage = doc.usage; let currentUsage = pg.usage;
let diskSize = doc.disk_size; let diskSize = pg.disk_size;
let additionalStorage = diskSize - (currentPlan?.disk || 0); let additionalStorage = diskSize - (currentPlan?.disk || 0);
let additionalStorageIncrementRecommendation = let additionalStorageIncrementRecommendation =
doc.recommended_storage_increment; pg.recommended_storage_increment;
let price = 0; let price = 0;
// not using $format.planTitle cuz of manual calculation of add-on storage plan // not using $format.planTitle cuz of manual calculation of add-on storage plan
let priceField = let priceField =
this.$team.doc.currency === 'INR' ? 'price_inr' : 'price_usd'; this.$team.pg.currency === 'INR' ? 'price_inr' : 'price_usd';
let planDescription = ''; let planDescription = '';
if (!currentPlan?.name) { if (!currentPlan?.name) {
@ -355,7 +355,7 @@ export default {
if ( if (
serverType === 'App Secondary Server' && serverType === 'App Secondary Server' &&
!this.$appServer?.doc?.scaled_up !this.$appServer?.pg?.scaled_up
) { ) {
return [ return [
{ {
@ -396,7 +396,7 @@ export default {
subValue: subValue:
additionalStorage > 0 additionalStorage > 0
? `${this.$format.userCurrency( ? `${this.$format.userCurrency(
doc.storage_plan[priceField] * additionalStorage, pg.storage_plan[priceField] * additionalStorage,
0, 0,
)}/mo` )}/mo`
: '', : '',
@ -407,7 +407,7 @@ export default {
? `Server Plan: ${this.$format.userCurrency( ? `Server Plan: ${this.$format.userCurrency(
currentPlan[priceField], currentPlan[priceField],
)}/mo & Add-on Storage Plan: ${this.$format.userCurrency( )}/mo & Add-on Storage Plan: ${this.$format.userCurrency(
doc.storage_plan[priceField] * additionalStorage, pg.storage_plan[priceField] * additionalStorage,
)}/mo` )}/mo`
: '', : '',
}, },
@ -475,12 +475,12 @@ export default {
confirmDialog({ confirmDialog({
title: 'Increase Storage', title: 'Increase Storage',
message: `Enter the disk size you want to increase to the server <b>${ message: `Enter the disk size you want to increase to the server <b>${
doc.title || doc.name pg.title || pg.name
}</b> }</b>
<div class="rounded mt-4 p-2 text-sm text-gray-700 bg-gray-100 border"> <div class="rounded mt-4 p-2 text-sm text-gray-700 bg-gray-100 border">
You will be charged at the rate of You will be charged at the rate of
<strong> <strong>
${this.$format.userCurrency(doc.storage_plan[priceField])}/mo ${this.$format.userCurrency(pg.storage_plan[priceField])}/mo
</strong> </strong>
for each additional GB of storage. for each additional GB of storage.
${ ${
@ -509,7 +509,7 @@ export default {
toast.promise( toast.promise(
this.$appServer.increaseDiskSize.submit( this.$appServer.increaseDiskSize.submit(
{ {
server: doc.name, server: pg.name,
increment: Number(values.storage), increment: Number(values.storage),
}, },
{ {
@ -569,14 +569,14 @@ export default {
{ {
fieldname: 'auto_increase_storage', fieldname: 'auto_increase_storage',
type: 'checkbox', type: 'checkbox',
default: doc.auto_increase_storage, default: pg.auto_increase_storage,
label: 'Enable Auto Increase Storage', label: 'Enable Auto Increase Storage',
variant: 'outline', variant: 'outline',
}, },
{ {
fieldname: 'min', fieldname: 'min',
type: 'select', type: 'select',
default: String(doc.auto_add_storage_min), default: String(pg.auto_add_storage_min),
label: 'Minimum Storage Increase (GB)', label: 'Minimum Storage Increase (GB)',
variant: 'outline', variant: 'outline',
// options from 5 GB to 250 GB in steps of 5 GB // options from 5 GB to 250 GB in steps of 5 GB
@ -591,7 +591,7 @@ export default {
{ {
fieldname: 'max', fieldname: 'max',
type: 'select', type: 'select',
default: String(doc.auto_add_storage_max), default: String(pg.auto_add_storage_max),
label: 'Maximum Storage Increase (GB)', label: 'Maximum Storage Increase (GB)',
variant: 'outline', variant: 'outline',
// options from 5 GB to 250 GB in steps of 5 GB // options from 5 GB to 250 GB in steps of 5 GB
@ -608,7 +608,7 @@ export default {
toast.promise( toast.promise(
this.$appServer.configureAutoAddStorage.submit( this.$appServer.configureAutoAddStorage.submit(
{ {
server: doc.name, server: pg.name,
enabled: values.auto_increase_storage, enabled: values.auto_increase_storage,
min: Number(values.min), min: Number(values.min),
max: Number(values.max), max: Number(values.max),
@ -617,12 +617,12 @@ export default {
onSuccess: () => { onSuccess: () => {
hide(); hide();
if (doc.name === this.$appServer.name) if (pg.name === this.$appServer.name)
this.$appServer.reload(); this.$appServer.reload();
else if (doc.name === this.$dbServer.name) else if (pg.name === this.$dbServer.name)
this.$dbServer.reload(); this.$dbServer.reload();
else if ( else if (
doc.name === this.$replicationServer.name pg.name === this.$replicationServer.name
) )
this.$replicationServer.reload(); this.$replicationServer.reload();
}, },
@ -662,31 +662,31 @@ export default {
return [ return [
{ {
label: 'Application server', label: 'Application server',
value: this.$appServer.doc.name, value: this.$appServer.pg.name,
}, },
{ {
label: 'Secondary App Server', label: 'Secondary App Server',
value: this.$appServer.doc.secondary_server, value: this.$appServer.pg.secondary_server,
}, },
{ {
label: 'Database server', label: 'Database server',
value: this.$appServer.doc.database_server, value: this.$appServer.pg.database_server,
}, },
{ {
label: 'Replication server', label: 'Replication server',
value: this.$appServer.doc.replication_server, value: this.$appServer.pg.replication_server,
}, },
{ {
label: 'Owned by', label: 'Owned by',
value: this.$appServer.doc.owner_email || this.$appServer.doc.team, value: this.$appServer.pg.owner_email || this.$appServer.pg.team,
}, },
{ {
label: 'Created by', label: 'Created by',
value: this.$appServer.doc.owner, value: this.$appServer.pg.owner,
}, },
{ {
label: 'Created on', label: 'Created on',
value: this.$format.date(this.$appServer.doc.creation), value: this.$format.date(this.$appServer.pg.creation),
}, },
].filter((d) => d.value); ].filter((d) => d.value);
}, },
@ -696,14 +696,14 @@ export default {
$appSecondaryServer() { $appSecondaryServer() {
return getDocResource({ return getDocResource({
doctype: 'Server', doctype: 'Server',
name: this.$appServer.doc.secondary_server, name: this.$appServer.pg.secondary_server,
}); });
}, },
$dbServer() { $dbServer() {
// Should mirror the whitelistedMethods in ServerActions.vue // Should mirror the whitelistedMethods in ServerActions.vue
return getDocResource({ return getDocResource({
doctype: 'Database Server', doctype: 'Database Server',
name: this.$appServer.doc.database_server, name: this.$appServer.pg.database_server,
whitelistedMethods: { whitelistedMethods: {
changePlan: 'change_plan', changePlan: 'change_plan',
reboot: 'reboot', reboot: 'reboot',
@ -724,7 +724,7 @@ export default {
$dbReplicaServer() { $dbReplicaServer() {
return getDocResource({ return getDocResource({
doctype: 'Database Server', doctype: 'Database Server',
name: this.$appServer.doc.replication_server, name: this.$appServer.pg.replication_server,
whitelistedMethods: { whitelistedMethods: {
changePlan: 'change_plan', changePlan: 'change_plan',
reboot: 'reboot', reboot: 'reboot',

View File

@ -8,7 +8,7 @@
label: 'Change plan', label: 'Change plan',
variant: 'solid', variant: 'solid',
onClick: changePlan, onClick: changePlan,
disabled: !plan || plan === $server?.doc.plan, disabled: !plan || plan === $server?.pg.plan,
}, },
], ],
}" }"
@ -88,8 +88,8 @@ export default {
immediate: true, immediate: true,
handler(serverName) { handler(serverName) {
if (serverName) { if (serverName) {
if (this.$server?.doc?.plan) { if (this.$server?.pg?.plan) {
this.plan = this.$server.doc.current_plan; this.plan = this.$server.pg.current_plan;
} }
} }
}, },
@ -101,8 +101,8 @@ export default {
url: 'press.api.server.plans', url: 'press.api.server.plans',
params: { params: {
name: this.cleanedServerType, name: this.cleanedServerType,
cluster: this.$server.doc.cluster, cluster: this.$server.pg.cluster,
platform: this.$server.doc.current_plan.platform, platform: this.$server.pg.current_plan.platform,
}, },
auto: true, auto: true,
initialData: [], initialData: [],
@ -118,12 +118,12 @@ export default {
this.show = false; this.show = false;
const plan = this.$resources.serverPlans.data.find( const plan = this.$resources.serverPlans.data.find(
(plan) => plan.name === this.$server.doc.plan, (plan) => plan.name === this.$server.pg.plan,
); );
const formattedPlan = plan const formattedPlan = plan
? `${this.$format.planTitle(plan)}/mo` ? `${this.$format.planTitle(plan)}/mo`
: this.$server.doc.plan; : this.$server.pg.plan;
this.$toast.success(`Plan changed to ${formattedPlan}`); this.$toast.success(`Plan changed to ${formattedPlan}`);
}, },

View File

@ -180,7 +180,7 @@ export default {
}, },
computed: { computed: {
snapshot() { snapshot() {
return this.$resources.snapshot?.doc || {}; return this.$resources.snapshot?.pg || {};
}, },
sites() { sites() {
return this.snapshot?.site_list_json || []; return this.snapshot?.site_list_json || [];

View File

@ -115,7 +115,7 @@ export default {
}, },
computed: { computed: {
snapshot() { snapshot() {
return this.$resources.snapshot?.doc || {}; return this.$resources.snapshot?.pg || {};
}, },
sites() { sites() {
return this.snapshot?.site_list_json || []; return this.snapshot?.site_list_json || [];

View File

@ -43,7 +43,7 @@ export default {
}, },
computed: { computed: {
sites() { sites() {
return this.$resources?.snapshotRecovery?.doc?.sites_data || []; return this.$resources?.snapshotRecovery?.pg?.sites_data || [];
}, },
siteOptions() { siteOptions() {
return { return {

View File

@ -157,7 +157,7 @@ export default {
resources: { resources: {
applicationServerStorageBreakdown() { applicationServerStorageBreakdown() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: 'Server', dt: 'Server',
@ -170,7 +170,7 @@ export default {
}, },
databaseServerStorageBreakdown() { databaseServerStorageBreakdown() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: 'Database Server', dt: 'Database Server',

View File

@ -81,7 +81,7 @@ export default {
resources: { resources: {
validateEndpoint() { validateEndpoint() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: 'Press Webhook', dt: 'Press Webhook',
@ -112,7 +112,7 @@ export default {
}, },
activateWebhook() { activateWebhook() {
return { return {
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
makeParams() { makeParams() {
return { return {
dt: 'Press Webhook', dt: 'Press Webhook',

View File

@ -7,15 +7,15 @@
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div class="text-xl font-semibold">API Access</div> <div class="text-xl font-semibold">API Access</div>
<Button @click="showCreateSecretDialog = true">{{ <Button @click="showCreateSecretDialog = true">{{
$team.doc?.user_info?.api_key $team.pg?.user_info?.api_key
? 'Regenerate API Secret' ? 'Regenerate API Secret'
: 'Create New API Key' : 'Create New API Key'
}}</Button> }}</Button>
</div> </div>
<div v-if="$team.doc?.user_info?.api_key"> <div v-if="$team.pg?.user_info?.api_key">
<ClickToCopyField <ClickToCopyField
v-if="$team.doc?.user_info?.api_key" v-if="$team.pg?.user_info?.api_key"
:textContent="$team.doc.user_info.api_key" :textContent="$team.pg.user_info.api_key"
/> />
</div> </div>
<div v-else class="pb-2 text-base text-gray-700"> <div v-else class="pb-2 text-base text-gray-700">
@ -28,7 +28,7 @@
size: 'xl', size: 'xl',
actions: [ actions: [
{ {
label: $team.doc.user_info.api_key label: $team.pg.user_info.api_key
? 'Regenerate API Secret' ? 'Regenerate API Secret'
: 'Create New API Key', : 'Create New API Key',
variant: 'solid', variant: 'solid',
@ -140,7 +140,7 @@ const selectedWebhook = ref(null);
const createSecret = createResource({ const createSecret = createResource({
url: 'press.api.account.create_api_secret', url: 'press.api.account.create_api_secret',
onSuccess() { onSuccess() {
if ($team.doc.user_info.api_key) { if ($team.pg.user_info.api_key) {
toast.success('API Secret regenerated successfully'); toast.success('API Secret regenerated successfully');
} else { } else {
toast.success('API Secret created successfully'); toast.success('API Secret created successfully');
@ -273,10 +273,10 @@ function renderAddNewKeyDialog(listResource) {
if (!values.sshKey) throw new Error('SSH Key is required'); if (!values.sshKey) throw new Error('SSH Key is required');
addSSHKey addSSHKey
.submit({ .submit({
doc: { pg: {
doctype: 'User SSH Key', doctype: 'User SSH Key',
ssh_public_key: values.sshKey, ssh_public_key: values.sshKey,
user: $team.doc.user_info.name, user: $team.pg.user_info.name,
}, },
}) })
.then(() => { .then(() => {
@ -435,7 +435,7 @@ const webhookListOptions = computed(() => ({
})); }));
const disableWebhook = createResource({ const disableWebhook = createResource({
url: 'press.api.client.run_doc_method', url: 'press.api.client.run_pg_method',
onSuccess() { onSuccess() {
toast.success('Webhook disabled successfully'); toast.success('Webhook disabled successfully');
webhookListResource.reload(); webhookListResource.reload();

View File

@ -115,9 +115,9 @@ export default {
name: this.webhook.name, name: this.webhook.name,
}, },
auto: true, auto: true,
onSuccess: (doc) => { onSuccess: (pg) => {
this.endpoint = doc.endpoint; this.endpoint = pg.endpoint;
this.selectedEvents = doc.events.map((event) => event.event); this.selectedEvents = pg.events.map((event) => event.event);
}, },
}; };
}, },

View File

@ -8,9 +8,9 @@
</Button> </Button>
</Tooltip> </Tooltip>
<h3 class="text-lg font-medium text-gray-900"> <h3 class="text-lg font-medium text-gray-900">
{{ role.doc?.title }} {{ role.pg?.title }}
</h3> </h3>
<Tooltip text="Admin Role" v-if="role.doc?.admin_access"> <Tooltip text="Admin Role" v-if="role.pg?.admin_access">
<FeatherIcon name="shield" class="h-5 w-5 text-gray-700" /> <FeatherIcon name="shield" class="h-5 w-5 text-gray-700" />
</Tooltip> </Tooltip>
</div> </div>
@ -58,7 +58,7 @@
</div> </div>
<RoleMembers <RoleMembers
v-if="tab === 'members'" v-if="tab === 'members'"
:users="role.doc?.users" :users="role.pg?.users"
@add=" @add="
(id: string) => { (id: string) => {
role.add_user.submit({ role.add_user.submit({
@ -76,7 +76,7 @@
/> />
<RoleResources <RoleResources
v-else-if="tab === 'resources'" v-else-if="tab === 'resources'"
:resources="role.doc?.resources" :resources="role.pg?.resources"
@include=" @include="
(document_type, document_name) => { (document_type, document_name) => {
role.add_resource.submit({ role.add_resource.submit({
@ -96,18 +96,18 @@
/> />
<RolePermissions <RolePermissions
v-else-if="tab === 'permissions'" v-else-if="tab === 'permissions'"
:admin_access="role.doc?.admin_access" :admin_access="role.pg?.admin_access"
:allow_bench_creation="role.doc?.allow_bench_creation" :allow_bench_creation="role.pg?.allow_bench_creation"
:allow_billing="role.doc?.allow_billing" :allow_billing="role.pg?.allow_billing"
:allow_partner="role.doc?.allow_partner" :allow_partner="role.pg?.allow_partner"
:allow_server_creation="role.doc?.allow_server_creation" :allow_server_creation="role.pg?.allow_server_creation"
:allow_site_creation="role.doc?.allow_site_creation" :allow_site_creation="role.pg?.allow_site_creation"
:allow_webhook_configuration="role.doc?.allow_webhook_configuration" :allow_webhook_configuration="role.pg?.allow_webhook_configuration"
:allow_dashboard="role.doc?.allow_dashboard" :allow_dashboard="role.pg?.allow_dashboard"
:allow_customer="role.doc?.allow_customer" :allow_customer="role.pg?.allow_customer"
:allow_leads="role.doc?.allow_leads" :allow_leads="role.pg?.allow_leads"
:allow_contribution="role.doc?.allow_contribution" :allow_contribution="role.pg?.allow_contribution"
:disabled="user != team.doc?.user" :disabled="user != team.pg?.user"
@update=" @update="
(key: string, value: boolean) => { (key: string, value: boolean) => {
role.setValueDebounced.submit({ role.setValueDebounced.submit({

View File

@ -96,7 +96,7 @@
:disabled="adminAccess" :disabled="adminAccess"
/> />
<Switch <Switch
v-if="$team.doc.erpnext_partner" v-if="$team.pg.erpnext_partner"
v-model="allowPartner" v-model="allowPartner"
label="Allow Partner Access" label="Allow Partner Access"
:disabled="adminAccess" :disabled="adminAccess"
@ -193,7 +193,7 @@ export default {
}, },
computed: { computed: {
role() { role() {
return this.$resources.role.doc; return this.$resources.role.pg;
}, },
roleUsers() { roleUsers() {
return this.role?.users || []; return this.role?.users || [];
@ -201,7 +201,7 @@ export default {
autoCompleteList() { autoCompleteList() {
const isNotGroupMember = (u) => const isNotGroupMember = (u) =>
!this.roleUsers.map(({ user }) => user).includes(u); !this.roleUsers.map(({ user }) => user).includes(u);
return this.$team.doc.team_members return this.$team.pg.team_members
?.filter(({ user }) => isNotGroupMember(user)) ?.filter(({ user }) => isNotGroupMember(user))
.map(({ user }) => ({ label: user, value: user })); .map(({ user }) => ({ label: user, value: user }));
}, },

View File

@ -78,7 +78,7 @@
@create=" @create="
(title, users, resources) => { (title, users, resources) => {
insert.submit({ insert.submit({
doc: { pg: {
doctype: 'Press Role', doctype: 'Press Role',
title, title,
users: users.map((u) => ({ users: users.map((u) => ({

View File

@ -35,12 +35,12 @@ const teamMembersListOptions = ref({
], ],
rowActions({ row }) { rowActions({ row }) {
let team = getTeam(); let team = getTeam();
if (row.name === team.doc.user || row.name === team.doc.user_info?.name) if (row.name === team.pg.user || row.name === team.pg.user_info?.name)
return []; return [];
return [ return [
{ {
label: 'Remove Member', label: 'Remove Member',
condition: () => row.name !== team.doc.user, condition: () => row.name !== team.pg.user,
onClick() { onClick() {
if (team.removeTeamMember.loading) return; if (team.removeTeamMember.loading) return;
confirmDialog({ confirmDialog({

View File

@ -40,7 +40,7 @@ export default {
computed: { computed: {
enforce2FA: { enforce2FA: {
get() { get() {
return Boolean(this.$team?.doc.enforce_2fa); return Boolean(this.$team?.pg.enforce_2fa);
}, },
set(value) { set(value) {
this.$team.setValue.submit({ enforce_2fa: value }); this.$team.setValue.submit({ enforce_2fa: value });
@ -48,7 +48,7 @@ export default {
}, },
enableBenchGroups: { enableBenchGroups: {
get() { get() {
return Boolean(this.$team?.doc.benches_enabled); return Boolean(this.$team?.pg.benches_enabled);
}, },
set(value) { set(value) {
this.$team.setValue.submit({ benches_enabled: value }); this.$team.setValue.submit({ benches_enabled: value });
@ -56,7 +56,7 @@ export default {
}, },
enableServers: { enableServers: {
get() { get() {
return Boolean(this.$team?.doc.servers_enabled); return Boolean(this.$team?.pg.servers_enabled);
}, },
set(value) { set(value) {
this.$team.setValue.submit({ servers_enabled: value }); this.$team.setValue.submit({ servers_enabled: value });

View File

@ -9,7 +9,7 @@ const sites = createListResource({
auto: true, auto: true,
pageLength: 99999, pageLength: 99999,
filters: { filters: {
team: team.doc?.name, team: team.pg?.name,
}, },
}); });
@ -18,7 +18,7 @@ const servers = createListResource({
auto: true, auto: true,
pageLength: 99999, pageLength: 99999,
filters: { filters: {
team: team.doc?.name, team: team.pg?.name,
}, },
}); });
@ -27,12 +27,12 @@ const releaseGroups = createListResource({
auto: true, auto: true,
pageLength: 99999, pageLength: 99999,
filters: { filters: {
team: team.doc?.name, team: team.pg?.name,
}, },
}); });
export const teamMembers = (ignore: string[] = []) => { export const teamMembers = (ignore: string[] = []) => {
return team.doc?.team_members return team.pg?.team_members
.filter((u: any) => !ignore.some((user) => user === u.user)) .filter((u: any) => !ignore.some((user) => user === u.user))
.map((user: any) => ({ .map((user: any) => ({
label: user.user, label: user.user,

View File

@ -1,13 +1,13 @@
<template> <template>
<Card <Card
v-if="!$team.doc?.erpnext_partner" v-if="!$team.pg?.erpnext_partner"
title="Frappe Partner" title="Frappe Partner"
subtitle="Frappe Partner associated with your account" subtitle="Frappe Partner associated with your account"
class="mx-auto max-w-3xl" class="mx-auto max-w-3xl"
> >
<template #actions> <template #actions>
<Button <Button
v-if="!$team.doc?.partner_email" v-if="!$team.pg?.partner_email"
icon-left="edit" icon-left="edit"
@click="showAddPartnerCodeDialog = true" @click="showAddPartnerCodeDialog = true"
> >
@ -24,7 +24,7 @@
<div class="py-4"> <div class="py-4">
<span <span
class="text-base font-medium text-gray-700" class="text-base font-medium text-gray-700"
v-if="!$team.doc?.partner_email" v-if="!$team.pg?.partner_email"
> >
Have a Frappe Partner Referral Code? Click on Have a Frappe Partner Referral Code? Click on
<strong>Add Partner Code</strong> to link with your Partner team. <strong>Add Partner Code</strong> to link with your Partner team.
@ -32,7 +32,7 @@
<ListItem <ListItem
v-else v-else
:title="partner_billing_name" :title="partner_billing_name"
:subtitle="$team.doc?.partner_email" :subtitle="$team.pg?.partner_email"
/> />
</div> </div>
<Dialog <Dialog
@ -150,7 +150,7 @@ export default {
url: 'press.api.partner.get_partner_name', url: 'press.api.partner.get_partner_name',
auto: true, auto: true,
params: { params: {
partner_email: this.$team.doc?.partner_email, partner_email: this.$team.pg?.partner_email,
}, },
}; };
}, },

View File

@ -41,7 +41,7 @@
<ListItem <ListItem
title="Notification Settings" title="Notification Settings"
subtitle="Manage notification channels" subtitle="Manage notification channels"
v-if="$team?.doc?.user === $session?.user" v-if="$team?.pg?.user === $session?.user"
> >
<template #actions> <template #actions>
<Button @click="showCommunicationInfoDialog = true"> Manage </Button> <Button @click="showCommunicationInfoDialog = true"> Manage </Button>
@ -51,7 +51,7 @@
<ListItem <ListItem
title="Become Marketplace Developer" title="Become Marketplace Developer"
subtitle="Become a marketplace app publisher" subtitle="Become a marketplace app publisher"
v-if="!$team.doc.is_developer" v-if="!$team.pg.is_developer"
> >
<template #actions> <template #actions>
<Button @click="confirmPublisherAccount"> <Button @click="confirmPublisherAccount">
@ -210,7 +210,7 @@
v-model="showCommunicationInfoDialog" v-model="showCommunicationInfoDialog"
@close="showCommunicationInfoDialog = false" @close="showCommunicationInfoDialog = false"
reference-doctype="Team" reference-doctype="Team"
:reference-name="$team.doc.name" :reference-name="$team.pg.name"
/> />
</Card> </Card>
<TFADialog v-model="show2FADialog" /> <TFADialog v-model="show2FADialog" />
@ -254,10 +254,10 @@ export default {
}, },
computed: { computed: {
teamEnabled() { teamEnabled() {
return this.$team.doc.enabled; return this.$team.pg.enabled;
}, },
user() { user() {
return this.$team?.doc?.user_info; return this.$team?.pg?.user_info;
}, },
}, },
resources: { resources: {
@ -287,7 +287,7 @@ export default {
renderDialog( renderDialog(
h(ChurnFeedbackDialog, { h(ChurnFeedbackDialog, {
team: this.$team.doc.name, team: this.$team.pg.name,
onUpdated: () => { onUpdated: () => {
toast.success('Your feedback was submitted successfully'); toast.success('Your feedback was submitted successfully');
}, },
@ -324,7 +324,7 @@ export default {
url: 'press.api.account.has_active_servers', url: 'press.api.account.has_active_servers',
auto: true, auto: true,
params: { params: {
team: this.$team.doc.name, team: this.$team.pg.name,
}, },
onSuccess(data) { onSuccess(data) {
if (data) { if (data) {
@ -346,7 +346,7 @@ export default {
toast.success('Your profile was updated successfully'); toast.success('Your profile was updated successfully');
}, },
deactivateAccount(disableAccount2FACode) { deactivateAccount(disableAccount2FACode) {
const currency = this.$team.doc.currency; const currency = this.$team.pg.currency;
const minAmount = currency === 'INR' ? 410 : 5; const minAmount = currency === 'INR' ? 410 : 5;
if (this.draftInvoice && this.draftInvoice.amount_due > minAmount) { if (this.draftInvoice && this.draftInvoice.amount_due > minAmount) {
const finalizeInvoicesDialog = defineAsyncComponent( const finalizeInvoicesDialog = defineAsyncComponent(
@ -356,7 +356,7 @@ export default {
} else if (this.unpaidInvoices) { } else if (this.unpaidInvoices) {
if (this.unpaidInvoices.length > 1) { if (this.unpaidInvoices.length > 1) {
this.showDisableAccountDialog = false; this.showDisableAccountDialog = false;
if (this.$team.doc.payment_mode === 'Prepaid Credits') { if (this.$team.pg.payment_mode === 'Prepaid Credits') {
this.showAddPrepaidCreditsDialog = true; this.showAddPrepaidCreditsDialog = true;
} else { } else {
confirmDialog({ confirmDialog({
@ -390,10 +390,10 @@ export default {
onClick: ({ hide }) => { onClick: ({ hide }) => {
if ( if (
invoice.stripe_invoice_url && invoice.stripe_invoice_url &&
this.$team.doc.payment_mode === 'Card' this.$team.pg.payment_mode === 'Card'
) { ) {
window.open( window.open(
`/api/method/press.api.client.run_doc_method?dt=Invoice&dn=${invoice.name}&method=stripe_payment_url`, `/api/method/press.api.client.run_pg_method?dt=Invoice&dn=${invoice.name}&method=stripe_payment_url`,
); );
} else { } else {
this.showAddPrepaidCreditsDialog = true; this.showAddPrepaidCreditsDialog = true;

View File

@ -28,16 +28,16 @@ export default {
}, },
computed: { computed: {
referralLink() { referralLink() {
if (this.$team.doc?.referrer_id) { if (this.$team.pg?.referrer_id) {
return `${location.origin}/dashboard/signup?referrer=${this.$team.doc?.referrer_id}`; return `${location.origin}/dashboard/signup?referrer=${this.$team.pg?.referrer_id}`;
} }
return ''; return '';
}, },
minimumSpentAmount() { minimumSpentAmount() {
return this.$team.doc?.country == 'India' ? '₹1800' : '$25'; return this.$team.pg?.country == 'India' ? '₹1800' : '$25';
}, },
creditAmountInTeamCurrency() { creditAmountInTeamCurrency() {
return this.$team.doc?.country == 'India' ? '₹750' : '$10'; return this.$team.pg?.country == 'India' ? '₹750' : '$10';
}, },
}, },
}; };

View File

@ -49,7 +49,7 @@ export default {
}, },
computed: { computed: {
is2FAEnabled() { is2FAEnabled() {
return this.$team.doc?.user_info?.is_2fa_enabled; return this.$team.pg?.user_info?.is_2fa_enabled;
}, },
show: { show: {
get() { get() {

View File

@ -18,7 +18,7 @@
<FormControl <FormControl
label="Email" label="Email"
type="email" type="email"
:modelValue="$team.doc.user" :modelValue="$team.pg.user"
name="email" name="email"
disabled disabled
/> />
@ -46,7 +46,7 @@
variant="solid" variant="solid"
@click=" @click="
$resources.sendOTP.submit({ $resources.sendOTP.submit({
email: $team.doc.user, email: $team.pg.user,
for_2fa_keys: true, for_2fa_keys: true,
}) })
" "

View File

@ -34,7 +34,7 @@ export default {
}, },
enableAutoUpdate: { enableAutoUpdate: {
get() { get() {
return !this.$site?.doc.skip_auto_updates; return !this.$site?.pg.skip_auto_updates;
}, },
set(value) { set(value) {
this.$site.setValue.submit({ skip_auto_updates: !value }); this.$site.setValue.submit({ skip_auto_updates: !value });

View File

@ -48,7 +48,7 @@ export default {
if ( if (
row.plans && row.plans &&
row.plans.some((plan) => plan.price_inr > 0) && row.plans.some((plan) => plan.price_inr > 0) &&
row.team !== this.$site.doc?.team row.team !== this.$site.pg?.team
) { ) {
this.show = false; this.show = false;
@ -116,7 +116,7 @@ export default {
fieldtype: 'ListSelection', fieldtype: 'ListSelection',
emptyStateMessage: emptyStateMessage:
'No apps found' + 'No apps found' +
(!this.$site.doc?.group_public (!this.$site.pg?.group_public
? '. Please add them from your bench.' ? '. Please add them from your bench.'
: ''), : ''),
columns: [ columns: [

View File

@ -170,7 +170,7 @@
v-if="runDocMethodMethodnamesData" v-if="runDocMethodMethodnamesData"
> >
<template #action> <template #action>
<Tooltip text="Shown only as run_doc_method calls seem to take time"> <Tooltip text="Shown only as run_pg_method calls seem to take time">
<lucide-info class="ml-2 mr-auto h-3.5 w-3.5 text-gray-500" /> <lucide-info class="ml-2 mr-auto h-3.5 w-3.5 text-gray-500" />
</Tooltip> </Tooltip>
</template> </template>
@ -487,7 +487,7 @@ export default {
}, },
runDocMethodMethodnamesData() { runDocMethodMethodnamesData() {
let runDocMethodMethodnames = let runDocMethodMethodnames =
this.$resources.advancedAnalytics.data?.run_doc_method_methodnames; this.$resources.advancedAnalytics.data?.run_pg_method_methodnames;
if (!runDocMethodMethodnames) return; if (!runDocMethodMethodnames) return;
return runDocMethodMethodnames; return runDocMethodMethodnames;

View File

@ -54,7 +54,7 @@ export default {
plan.price_inr === 0 || plan.price_usd === 0 plan.price_inr === 0 || plan.price_usd === 0
? 'Free' ? 'Free'
: `${this.$format.userCurrency( : `${this.$format.userCurrency(
this.$team.doc.currency === 'INR' this.$team.pg.currency === 'INR'
? plan.price_inr ? plan.price_inr
: plan.price_usd, : plan.price_usd,
)}/mo`, )}/mo`,

Some files were not shown because too many files have changed in this diff Show More