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

View File

@ -68,7 +68,7 @@ const isHideSidebar = computed(() => {
return true;
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<{
doctype: string;
docname: string;
doc?: any;
pg?: any;
error?: Error;
}>();
const team = getTeam();
const buttonProps = computed(() => {
if (props.doc) {
if (props.pg) {
return {
label: '',
icon: 'unlock',
@ -63,11 +63,11 @@ const isPermissionError = computed(() => {
});
const canRequestAccess = computed(() => {
return Boolean(team.doc?.can_request_access);
return Boolean(team.pg?.can_request_access);
});
const isOwner = computed(() => {
return props.doc?.team === team.doc?.name;
return props.pg?.team === team.pg?.name;
});
const hasAccess = computed(() => {
@ -75,7 +75,7 @@ const hasAccess = computed(() => {
});
const DialogComponent = computed(() => {
if (props.doc) {
if (props.pg) {
return AccessRequestStatusDialog;
} else {
return AccessRequestDialog;

View File

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

View File

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

View File

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

View File

@ -1,21 +1,21 @@
<template>
<Dialog v-if="doc" v-model="show">
<Dialog v-if="pg" v-model="show">
<!-- Title -->
<template v-slot:body-title>
<h1 class="font-semibold">
{{ doc.title }}
{{ pg.title }}
</h1>
</template>
<!-- Message and Traceback -->
<template v-slot:body-content>
<div
:if="doc.message"
v-html="doc.message"
:if="pg.message"
v-html="pg.message"
class="flex flex-col gap-2 whitespace-pre-wrap text-p-base text-gray-700"
></div>
<div v-if="doc.traceback" class="relative mt-6">
<div v-if="pg.traceback" class="relative mt-6">
<button
class="absolute right-2 top-2 rounded-sm border border-gray-200 bg-white p-1 text-xs text-gray-600"
variant="outline"
@ -26,7 +26,7 @@
<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"
>
<pre>{{ doc.traceback }}</pre>
<pre>{{ pg.traceback }}</pre>
</div>
</div>
@ -36,12 +36,12 @@
<!-- Help and Done -->
<template v-slot:actions>
<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
</Link>
<Button
v-if="!doc.is_addressed"
v-if="!pg.is_addressed"
variant="solid"
class="w-40"
@click="done"
@ -86,18 +86,18 @@ export default {
},
},
computed: {
doc() {
return this.$resources.notification.doc ?? null;
pg() {
return this.$resources.notification.pg ?? null;
},
},
methods: {
async copyTraceback() {
await navigator.clipboard.writeText(this.doc.traceback);
await navigator.clipboard.writeText(this.pg.traceback);
this.copied = true;
setTimeout(() => (this.copied = false), 4000);
},
async done() {
if (this.doc.assistance_url && !this.helpViewed) {
if (this.pg.assistance_url && !this.helpViewed) {
this.error =
'Please follow the steps mentioned in <i>Help</i> before clicking Done';
return;
@ -110,7 +110,7 @@ export default {
help() {
this.error = '';
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',
icon: 'command',
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),
},
{
@ -39,11 +39,11 @@
<div class="text-base font-medium leading-none text-gray-900">
Frappe Cloud
</div>
<Tooltip :text="$team?.doc?.user || null">
<Tooltip :text="$team?.pg?.user || null">
<div
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>
</Tooltip>
</div>

View File

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

View File

@ -1,6 +1,6 @@
<template>
<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
Banking, UPI, Wallets, etc. If you are using Net Banking, it may take upto
5 days for balance to reflect.
@ -101,7 +101,7 @@ export default {
name: 'Frappe Cloud',
image: '/assets/press/images/frappe-cloud-logo.png',
prefill: {
email: this.$team.doc.user,
email: this.$team.pg.user,
},
handler: this.handlePaymentSuccess,
theme: { color: '#171717' },
@ -132,7 +132,7 @@ export default {
async checkForOnboardingPaymentCompletion() {
this.isVerifyingPayment = true;
await this.$team.reload();
if (!this.$team.doc.payment_mode) {
if (!this.$team.pg.payment_mode) {
setTimeout(this.checkForOnboardingPaymentCompletion, 2000);
} else {
this.isVerifyingPayment = false;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,15 +30,15 @@ export default {
name: 'NavigationItems',
computed: {
navigation() {
if (!this.$team?.doc) return [];
if (!this.$team?.pg) return [];
const routeName = this.$route?.name || '';
const onboardingComplete = this.$team.doc.onboarding.complete;
const isSaasUser = this.$team.doc.is_saas_user;
const onboardingComplete = this.$team.pg.onboarding.complete;
const isSaasUser = this.$team.pg.is_saas_user;
const enforce2FA = Boolean(
!this.$team.doc.is_desk_user &&
this.$team.doc.enforce_2fa &&
!this.$team.doc.user_info?.is_2fa_enabled,
!this.$team.pg.is_desk_user &&
this.$team.pg.enforce_2fa &&
!this.$team.pg.user_info?.is_2fa_enabled,
);
return [
@ -84,7 +84,7 @@ export default {
icon: () => h(Package),
route: '/benches',
isActive: routeName.startsWith('Bench'),
condition: this.$team.doc?.is_desk_user,
condition: this.$team.pg?.is_desk_user,
disabled: !onboardingComplete || enforce2FA,
},
{
@ -166,7 +166,7 @@ export default {
icon: () => h(FileSearch),
route: '/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),
isActive: [
@ -183,8 +183,8 @@ export default {
route: '/apps',
isActive: routeName.startsWith('Marketplace'),
condition:
this.$team.doc?.is_desk_user ||
(!!this.$team.doc.is_developer && this.$session.hasAppsAccess),
this.$team.pg?.is_desk_user ||
(!!this.$team.pg.is_developer && this.$session.hasAppsAccess),
disabled: enforce2FA,
},
{
@ -193,7 +193,7 @@ export default {
route: '/billing',
isActive: routeName.startsWith('Billing'),
condition:
this.$team.doc?.is_desk_user || this.$session.hasBillingAccess,
this.$team.pg?.is_desk_user || this.$session.hasBillingAccess,
disabled: enforce2FA,
},
{
@ -208,7 +208,7 @@ export default {
icon: () => h(Globe),
route: '/partners',
isActive: routeName === 'Partnership',
condition: Boolean(this.$team.doc.erpnext_partner),
condition: Boolean(this.$team.pg.erpnext_partner),
disabled: enforce2FA,
},
{
@ -223,7 +223,7 @@ export default {
icon: () => h(Shield),
route: '/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);
},
@ -231,7 +231,7 @@ export default {
mounted() {
this.$socket.emit('doctype_subscribe', 'Press Notification');
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);
}
});

View File

@ -118,7 +118,7 @@
<div
class="rounded-md"
: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">
@ -126,7 +126,7 @@
<TextInsideCircle>3</TextInsideCircle>
<span class="text-base font-medium"> Update billing details </span>
</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" />
</div>
</div>
@ -151,7 +151,7 @@
class="rounded-md"
: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">
<TextInsideCircle>4</TextInsideCircle>
<span class="text-base font-medium"> Add a payment mode </span>
@ -209,13 +209,13 @@
<TextInsideCircle>4</TextInsideCircle>
<span
class="text-base font-medium"
v-if="$team.doc.payment_mode === 'Card'"
v-if="$team.pg.payment_mode === 'Card'"
>
Automatic billing setup completed
</span>
<span
class="text-base font-medium"
v-if="$team.doc.payment_mode === 'Prepaid Credits'"
v-if="$team.pg.payment_mode === 'Prepaid Credits'"
>
Wallet balance updated
</span>
@ -228,9 +228,9 @@
</div>
<div
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>
@ -288,16 +288,16 @@ export default {
},
computed: {
isBillingDetailsSet() {
return Boolean(this.$team.doc.billing_details?.name);
return Boolean(this.$team.pg.billing_details?.name);
},
minimumAmount() {
return this.$team.doc.currency == 'INR' ? 100 : 5;
return this.$team.pg.currency == 'INR' ? 100 : 5;
},
pendingSiteRequest() {
return this.$team.doc.pending_site_request;
return this.$team.pg.pending_site_request;
},
trialSite() {
return this.$team.doc.trial_sites?.[0];
return this.$team.pg.trial_sites?.[0];
},
},
resources: {

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<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
v-for="group in actions"
:key="group.group"
@ -15,7 +15,7 @@
:siteName="site"
:group="group.group"
:actionLabel="row.action"
:method="row.doc_method"
:method="row.pg_method"
:description="row.description"
:buttonLabel="row.button_label"
/>
@ -36,7 +36,7 @@ export default {
return getCachedDocumentResource('Site', this.site);
},
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';
if (!acc[group]) {
acc[group] = [];

View File

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

View File

@ -1,20 +1,20 @@
<template>
<div
v-if="$site?.doc"
v-if="$site?.pg"
class="grid grid-cols-1 items-start gap-5 lg:grid-cols-2"
>
<CustomAlerts
:disable-last-child-bottom-margin="true"
container-class="col-span-1 lg:col-span-2"
ctx_type="Site"
:ctx_name="$site?.doc?.name"
:ctx_name="$site?.pg?.name"
/>
<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"
type="error"
:title="`Suspension Reason : ${$site?.doc?.suspension_reason || 'Not Specified'}`"
:title="`Suspension Reason : ${$site?.pg?.suspension_reason || 'Not Specified'}`"
>
<Button
class="ml-auto min-w-[7rem]"
@ -26,7 +26,7 @@
</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"
type="warning"
title="Database or Disk usage limits exceeded. Upgrade plan or reduce usage to avoid suspension."
@ -57,7 +57,7 @@
</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"
title="Upgrade to a paid plan to continue using your site after the trial period."
>
@ -67,7 +67,7 @@
</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"
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"
@ -75,7 +75,7 @@
>
</AlertBanner>
<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"
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`"
@ -90,11 +90,11 @@
</DismissableBanner>
<DismissableBanner
v-else-if="
$site.doc.current_plan &&
!$site.doc.current_plan?.private_benches &&
$site.doc.group_public &&
!$site.doc.current_plan?.is_trial_plan &&
$site.doc.status !== 'Archived'
$site.pg.current_plan &&
!$site.pg.current_plan?.private_benches &&
$site.pg.group_public &&
!$site.pg.current_plan?.is_trial_plan &&
$site.pg.status !== 'Archived'
"
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>."
@ -115,8 +115,8 @@
<div>
<div class="leading-4">
<span class="flex items-center text-base text-gray-900">
<template v-if="$site.doc.trial_end_date">
{{ trialDays($site.doc.trial_end_date) }}
<template v-if="$site.pg.trial_end_date">
{{ trialDays($site.pg.trial_end_date) }}
</template>
<template v-else-if="currentPlan">
{{ $format.planTitle(currentPlan) }}
@ -172,7 +172,7 @@
{{ currentUsage.cpu }}
{{ $format.plural(currentUsage.cpu, 'hour', 'hours') }}
<template
v-if="currentPlan && !$site.doc.is_dedicated_server"
v-if="currentPlan && !$site.pg.is_dedicated_server"
>
of {{ currentPlan?.cpu_time_per_day }} hours
</template>
@ -202,7 +202,7 @@
<div class="text-sm text-gray-600">
{{ formatBytes(currentUsage.storage) }}
<template
v-if="currentPlan && !$site.doc.is_dedicated_server"
v-if="currentPlan && !$site.pg.is_dedicated_server"
>
of {{ formatBytes(currentPlan.max_storage_usage) }}
</template>
@ -243,7 +243,7 @@
<div class="text-sm text-gray-600">
{{ formatBytes(currentUsage.database) }}
<template
v-if="currentPlan && !$site.doc.is_dedicated_server"
v-if="currentPlan && !$site.pg.is_dedicated_server"
>
of
{{ formatBytes(currentPlan.max_database_usage) }}
@ -288,7 +288,7 @@
<!-- Tags -->
<div class="col-span-1 flex items-center space-x-2 lg:col-span-2">
<Badge
v-for="tag in $site.doc.tags"
v-for="tag in $site.pg.tags"
:key="tag.tag"
:label="tag.tag_name"
size="lg"
@ -346,7 +346,7 @@ export default {
};
},
mounted() {
if (this.$site?.doc?.status === 'Active') {
if (this.$site?.pg?.status === 'Active') {
this.$site.isSetupWizardComplete.submit().then((res) => {
this.isSetupWizardComplete = res;
});
@ -374,7 +374,7 @@ export default {
.then((url) => window.open(url, '_blank'));
},
loginAsTeam() {
if (this.$site.doc?.additional_system_user_created) {
if (this.$site.pg?.additional_system_user_created) {
this.$site.loginAsTeam
.submit({ reason: '' })
.then((url) => window.open(url, '_blank'));
@ -407,30 +407,30 @@ export default {
return [
{
label: 'Owned by',
value: this.$site.doc?.owner_email,
value: this.$site.pg?.owner_email,
},
{
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',
value: this.$format.date(
this.$site.doc?.signup_time || this.$site.doc?.creation,
this.$site.pg?.signup_time || this.$site.pg?.creation,
),
},
{
label: 'Region',
value: this.$site.doc?.cluster.title,
value: this.$site.pg?.cluster.title,
prefix: h('img', {
src: this.$site.doc?.cluster.image,
alt: this.$site.doc?.cluster.title,
src: this.$site.pg?.cluster.image,
alt: this.$site.pg?.cluster.title,
class: 'h-4 w-4',
}),
},
{
label: 'Inbound IP',
value: this.$site.doc?.inbound_ip,
value: this.$site.pg?.inbound_ip,
suffix: h(
Tooltip,
{
@ -441,7 +441,7 @@ export default {
},
{
label: 'Outbound IP',
value: this.$site.doc?.outbound_ip,
value: this.$site.pg?.outbound_ip,
suffix: h(
Tooltip,
{
@ -453,24 +453,24 @@ export default {
];
},
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 {
price:
currency === 'INR'
? this.$site.doc.current_plan.price_inr
: this.$site.doc.current_plan.price_usd,
? this.$site.pg.current_plan.price_inr
: this.$site.pg.current_plan.price_usd,
price_per_day:
currency === 'INR'
? this.$site.doc.current_plan.price_per_day_inr
: this.$site.doc.current_plan.price_per_day_usd,
? this.$site.pg.current_plan.price_per_day_inr
: this.$site.pg.current_plan.price_per_day_usd,
currency: currency === 'INR' ? '₹' : '$',
...this.$site.doc.current_plan,
...this.$site.pg.current_plan,
};
},
currentUsage() {
return this.$site.doc?.current_usage;
return this.$site.pg?.current_usage;
},
$site() {
return getCachedDocumentResource('Site', this.site);

View File

@ -24,7 +24,7 @@
label="Skip taking backup for this update"
type="checkbox"
v-model="skipBackups"
v-if="!$site.doc.group_public"
v-if="!$site.pg.group_public"
/>
<div
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,
},
auto: !!this.existingUpdate,
onSuccess: (doc) => {
this.initializeValues(doc);
onSuccess: (pg) => {
this.initializeValues(pg);
},
};
},
@ -182,11 +182,11 @@ export default {
};
},
updatableApps() {
if (!this.$site.doc.update_information.update_available) return [];
let installedApps = this.$site.doc.update_information.installed_apps.map(
if (!this.$site.pg.update_information.update_available) return [];
let installedApps = this.$site.pg.update_information.installed_apps.map(
(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),
);
},
@ -242,10 +242,10 @@ export default {
},
);
},
initializeValues(doc) {
this.skipFailingPatches = doc.skipped_failing_patches;
this.skipBackups = doc.skipped_backups;
this.scheduledTime = dayjs(doc.scheduled_time).format('YYYY-MM-DDTHH:mm');
initializeValues(pg) {
this.skipFailingPatches = pg.skipped_failing_patches;
this.skipBackups = pg.skipped_backups;
this.scheduledTime = dayjs(pg.scheduled_time).format('YYYY-MM-DDTHH:mm');
},
},
};

View File

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

View File

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

View File

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

View File

@ -245,7 +245,7 @@ export default {
return this.qrUrl.match(/secret=(.*?)&issuer/)[1];
},
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 fullName = `${team.doc.user_info.first_name || ''} ${
team.doc.user_info.last_name || ''
const fullName = `${team.pg.user_info.first_name || ''} ${
team.pg.user_info.last_name || ''
}`.trim();
const billingInformation = reactive({

View File

@ -65,7 +65,7 @@ const { currentBillingAmount, upcomingInvoice, unpaidInvoices } =
const showAddPrepaidCreditsDialog = ref(false);
const showInvoiceDialog = ref(false);
const currency = computed(() => (team.doc.currency == 'INR' ? '₹' : '$'));
const currency = computed(() => (team.pg.currency == 'INR' ? '₹' : '$'));
const unpaidAmount = createResource({
url: 'press.api.billing.total_unpaid_amount',
@ -84,7 +84,7 @@ const currentMonthEnd = () => {
};
function payNow() {
team.doc.payment_mode == 'Prepaid Credits'
team.pg.payment_mode == 'Prepaid Credits'
? (showAddPrepaidCreditsDialog.value = true)
: payUnpaidInvoices();
}
@ -92,7 +92,7 @@ function payNow() {
function payUnpaidInvoices() {
let _unpaidInvoices = unpaidInvoices.data;
if (_unpaidInvoices.length > 1) {
if (team.doc.payment_mode === 'Prepaid Credits') {
if (team.pg.payment_mode === 'Prepaid Credits') {
showAddPrepaidCreditsDialog.value = true;
} else {
confirmDialog({
@ -111,9 +111,9 @@ function payUnpaidInvoices() {
}
} else {
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(
`/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 {
showAddPrepaidCreditsDialog.value = true;

View File

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

View File

@ -1,11 +1,11 @@
<template>
<div>
<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"
>
<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
Banking, UPI, Wallets, etc. If you are using Net Banking, it may take
upto 5 days for balance to reflect.
@ -69,7 +69,7 @@ const props = defineProps({
const emit = defineEmits(['success']);
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 isVerifyingPayment = ref(false);
@ -94,7 +94,7 @@ const createRazorpayOrder = createResource({
params: {
amount: props.amount,
transaction_type: props.type,
doc_name: props.docName,
pg_name: props.docName,
},
onSuccess: (data) => processOrder(data),
validate: () => {
@ -117,7 +117,7 @@ function processOrder(data) {
order_id: data.order_id,
name: 'Frappe Cloud',
image: 'https://frappe.io/files/cloud.png',
prefill: { email: team.doc?.user },
prefill: { email: team.pg?.user },
handler: handlePaymentSuccess,
theme: { color: '#171717' },
...(paypalEnabled

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<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
v-for="group in actions"
:key="group.group"
@ -15,7 +15,7 @@
:benchName="releaseGroup"
:group="group.group"
:actionLabel="row.action"
:method="row.doc_method"
:method="row.pg_method"
:description="row.description"
:buttonLabel="row.button_label"
/>
@ -35,7 +35,7 @@ export default {
return getCachedDocumentResource('Release Group', this.releaseGroup);
},
actions() {
const groupedActions = this.$releaseGroup.doc.actions.reduce(
const groupedActions = this.$releaseGroup.pg.actions.reduce(
(acc, action) => {
const group = action.group || 'General Actions';
if (!acc[group]) {

View File

@ -6,7 +6,7 @@
}"
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 class="space-y-2" v-if="isWindows">
<h4 class="text-base font-semibold text-gray-700">Step 1</h4>
@ -67,7 +67,7 @@
</div>
</div>
<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
<router-link
:to="{ name: 'SettingsDeveloper' }"
@ -78,7 +78,7 @@
>
to add your SSH public key.
</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
enable access.
</p>
@ -100,8 +100,8 @@
#actions
v-if="
!certificate &&
$bench.doc?.is_ssh_proxy_setup &&
$bench.doc?.user_ssh_key
$bench.pg?.is_ssh_proxy_setup &&
$bench.pg?.user_ssh_key
"
>
<Button
@ -140,8 +140,8 @@ export default {
type: 'document',
doctype: 'Bench',
name: this.bench,
onSuccess(doc) {
if (doc.is_ssh_proxy_setup && doc.user_ssh_key) {
onSuccess(pg) {
if (pg.is_ssh_proxy_setup && pg.user_ssh_key) {
this.$releaseGroup.getCertificate.reload();
}
},
@ -159,8 +159,8 @@ export default {
return this.$releaseGroup.getCertificate.data;
},
sshCommand() {
if (!this.$bench.doc) return;
return `ssh ${this.$bench.doc.name}@${this.$bench.doc.proxy_server} -p 2222`;
if (!this.$bench.pg) return;
return `ssh ${this.$bench.pg.name}@${this.$bench.pg.proxy_server} -p 2222`;
},
certificateCommand() {
if (this.certificate) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<template>
<div>
<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"
>
<FeatherIcon name="info" class="my-1 h-4" />
@ -105,7 +105,7 @@ function processOrder(data) {
order_id: data.order_id,
name: 'Frappe Cloud',
image: 'https://frappe.io/files/cloud.png',
prefill: { email: team.doc?.user },
prefill: { email: team.pg?.user },
handler: handlePaymentSuccess,
theme: { color: '#171717' },
};

View File

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

View File

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

View File

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

View File

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

View File

@ -29,7 +29,7 @@
>
<template #body-content>
<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.
</p>
<FormControl placeholder="Amount" v-model="amount" autocomplete="off" />
@ -48,7 +48,7 @@
$resources.transferCredits.submit({
amount: amount,
customer: customerTeam.name,
partner: $team.doc.name,
partner: $team.pg.name,
})
"
>

View File

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

View File

@ -2,7 +2,7 @@
<div>
<div
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">
@ -307,7 +307,7 @@ export default {
].filter((d) => d.condition ?? true);
},
lead() {
return this.$resources.lead.doc;
return this.$resources.lead.pg;
},
statusOptions() {
return [

View File

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

View File

@ -3,7 +3,7 @@
<div class="grid grid-cols-1 gap-5 sm:grid-cols-2">
<!-- Adding Mpesa Details -->
<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"
>
<div class="flex justify-between items-center text-sm text-gray-700">

View File

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

View File

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

View File

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

View File

@ -112,17 +112,17 @@ export default {
},
computed: {
autoScale() {
return this.$resources.autoScale?.doc ?? {};
return this.$resources.autoScale?.pg ?? {};
},
steps() {
return this.$resources.autoScale?.doc?.steps || [];
return this.$resources.autoScale?.pg?.steps || [];
},
dropdownOptions() {
return [
{
label: 'View in Desk',
icon: 'external-link',
condition: () => this.$team.doc?.is_desk_user,
condition: () => this.$team.pg?.is_desk_user,
onClick: () => {
window.open(
`${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',
makeParams: () => {
return {
name: this.server.doc.name,
name: this.server.pg.name,
};
},
auto: false,

View File

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

View File

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

View File

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

View File

@ -5,7 +5,7 @@
<p class="mt-1 text-p-base text-gray-600">{{ props.description }}</p>
</div>
<Button
v-if="server?.doc"
v-if="server?.pg"
class="whitespace-nowrap"
@click="getServerActionHandler(props.actionLabel)"
>
@ -71,11 +71,11 @@ function getServerActionHandler(action) {
}
function onNotificationSettings() {
if (!server?.doc) return;
if (!server?.pg) return;
return renderDialog(
h(CommunicationInfoDialog, {
referenceDoctype: 'Server',
referenceName: server.doc.name,
referenceName: server.pg.name,
}),
);
}
@ -188,7 +188,7 @@ function onSetupSecondaryServer() {
hide();
renderDialog(
h(SecondaryServerPlanDialog, {
server: server.doc.name,
server: server.pg.name,
}),
);
},
@ -198,7 +198,7 @@ function onSetupSecondaryServer() {
function onRebootServer() {
confirmDialog({
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: [
{
label: 'Please type the server name to confirm',
@ -210,7 +210,7 @@ function onRebootServer() {
},
onSuccess({ hide, values }) {
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');
}
toast.promise(
@ -324,12 +324,12 @@ function onDisableAutoDiskExpansion() {
function onDropServer() {
const databaseServer = createDocumentResource({
doctype: 'Database Server',
name: server.doc.database_server,
name: server.pg.database_server,
});
confirmDialog({
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: [
{
label: "Please type either server's name or title to confirm",
@ -343,10 +343,10 @@ function onDropServer() {
onSuccess({ hide, values }) {
if (server.dropServer.loading) return;
if (
values.confirmServerName !== server.doc.name &&
values.confirmServerName !== server.doc.database_server &&
values.confirmServerName.trim() !== server.doc.title.trim() &&
values.confirmServerName.trim() !== databaseServer.doc.title.trim()
values.confirmServerName !== server.pg.name &&
values.confirmServerName !== server.pg.database_server &&
values.confirmServerName.trim() !== server.pg.title.trim() &&
values.confirmServerName.trim() !== databaseServer.pg.title.trim()
) {
throw new Error('Server name does not match');
}
@ -369,7 +369,7 @@ function onEnableBinlogIndexing() {
if (!server.enableBinlogIndexing) return;
confirmDialog({
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: {
label: 'Enable Binlog Indexing',
},
@ -395,7 +395,7 @@ function onDisableBinlogIndexing() {
if (!server.disableBinlogIndexing) return;
confirmDialog({
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: {
label: 'Disable Binlog Indexing',
},
@ -421,7 +421,7 @@ function onEnablePerformanceSchema() {
if (!server.enablePerformanceSchema) return;
confirmDialog({
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: [
{
label: 'Please type the server name to confirm',
@ -433,7 +433,7 @@ function onEnablePerformanceSchema() {
},
onSuccess({ hide, values }) {
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');
}
toast.promise(
@ -456,7 +456,7 @@ function onDisablePerformanceSchema() {
if (!server.disablePerformanceSchema) return;
confirmDialog({
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: [
{
label: 'Please type the server name to confirm',
@ -468,7 +468,7 @@ function onDisablePerformanceSchema() {
},
onSuccess({ hide, values }) {
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');
}
toast.promise(
@ -491,13 +491,13 @@ function onUpdateInnodbBufferPoolSize() {
if (!server.updateInnodbBufferPoolSize) return;
confirmDialog({
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: [
{
label: 'Enter the new InnoDB Buffer Pool Size (MB)',
fieldname: 'innodbBufferPoolSize',
type: 'number',
default: server.doc.mariadb_variables.innodb_buffer_pool_size,
default: server.pg.mariadb_variables.innodb_buffer_pool_size,
},
],
primaryAction: {
@ -535,13 +535,13 @@ function onUpdateBinlogRetention() {
if (!server.updateBinlogRetention) return;
confirmDialog({
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: [
{
label: 'Enter the new Binlog Retention (days)',
fieldname: 'days',
type: 'number',
default: server.doc.mariadb_variables.expire_logs_days,
default: server.pg.mariadb_variables.expire_logs_days,
},
],
primaryAction: {
@ -585,13 +585,13 @@ function onUpdateBinlogSizeLimit() {
label: 'Enable Binlog Auto Purging',
fieldname: 'enabled',
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)',
fieldname: 'size',
type: 'number',
default: server.doc.binlog_max_disk_usage_percent,
default: server.pg.binlog_max_disk_usage_percent,
condition: (values) => values.enabled,
},
],
@ -631,7 +631,7 @@ function onViewMariaDBBinlogs() {
if (!server.getBinlogsInfo) return;
renderDialog(
h(DatabaseBinlogsDialog, {
databaseServer: server.doc.name,
databaseServer: server.pg.name,
}),
);
}
@ -640,13 +640,13 @@ function onUpdateMaxDBConnections() {
if (!server.updateMaxDbConnections) return;
confirmDialog({
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: [
{
label: 'Enter the new Max DB Connections',
fieldname: 'maxDBConnections',
type: 'number',
default: server.doc.mariadb_variables.max_connections,
default: server.pg.mariadb_variables.max_connections,
},
],
primaryAction: {
@ -683,7 +683,7 @@ function onUpdateMaxDBConnections() {
function onViewDatabaseConfiguration() {
renderDialog(
h(DatabaseConfigurationDialog, {
name: server.doc.name,
name: server.pg.name,
}),
);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -28,16 +28,16 @@ export default {
},
computed: {
referralLink() {
if (this.$team.doc?.referrer_id) {
return `${location.origin}/dashboard/signup?referrer=${this.$team.doc?.referrer_id}`;
if (this.$team.pg?.referrer_id) {
return `${location.origin}/dashboard/signup?referrer=${this.$team.pg?.referrer_id}`;
}
return '';
},
minimumSpentAmount() {
return this.$team.doc?.country == 'India' ? '₹1800' : '$25';
return this.$team.pg?.country == 'India' ? '₹1800' : '$25';
},
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: {
is2FAEnabled() {
return this.$team.doc?.user_info?.is_2fa_enabled;
return this.$team.pg?.user_info?.is_2fa_enabled;
},
show: {
get() {

View File

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

View File

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

View File

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

View File

@ -170,7 +170,7 @@
v-if="runDocMethodMethodnamesData"
>
<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" />
</Tooltip>
</template>
@ -487,7 +487,7 @@ export default {
},
runDocMethodMethodnamesData() {
let runDocMethodMethodnames =
this.$resources.advancedAnalytics.data?.run_doc_method_methodnames;
this.$resources.advancedAnalytics.data?.run_pg_method_methodnames;
if (!runDocMethodMethodnames) return;
return runDocMethodMethodnames;

View File

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

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