mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
Merge branch 'master' into fix_all_customer_load
This commit is contained in:
@ -28,7 +28,16 @@
|
||||
"
|
||||
>
|
||||
<div class="w-full">
|
||||
<MainLogo class="block w-48 h-auto max-w-full mb-32 text-primary-500" />
|
||||
<MainLogo
|
||||
v-if="!loginPageLogo"
|
||||
class="block w-48 h-auto max-w-full mb-32 text-primary-500"
|
||||
/>
|
||||
|
||||
<img
|
||||
v-else
|
||||
:src="loginPageLogo"
|
||||
class="block w-48 h-auto max-w-full mb-32 text-primary-500"
|
||||
/>
|
||||
|
||||
<router-view />
|
||||
|
||||
@ -76,7 +85,7 @@
|
||||
|
||||
<LoginBackgroundOverlay class="absolute h-full w-full right-[7.5%]" />
|
||||
|
||||
<div class="pl-20 xl:pl-0 relative z-50">
|
||||
<div class="md:pl-10 xl:pl-0 relative z-50 w-7/12 xl:w-5/12 xl:w-5/12">
|
||||
<h1
|
||||
class="
|
||||
hidden
|
||||
@ -89,9 +98,7 @@
|
||||
lg:block
|
||||
"
|
||||
>
|
||||
<b class="font-bold">Simple Invoicing</b> <br />
|
||||
for Individuals & <br />
|
||||
Small Businesses <br />
|
||||
{{ pageHeading }}
|
||||
</h1>
|
||||
<p
|
||||
class="
|
||||
@ -106,9 +113,7 @@
|
||||
lg:block
|
||||
"
|
||||
>
|
||||
Crater helps you track expenses, record payments & generate beautiful
|
||||
<br />
|
||||
invoices & estimates. <br />
|
||||
{{ pageDescription }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@ -136,6 +141,31 @@ import LoginBackground from '@/scripts/components/svg/LoginBackground.vue'
|
||||
import LoginPlanetCrater from '@/scripts/components/svg/LoginPlanetCrater.vue'
|
||||
import LoginBottomVector from '@/scripts/components/svg/LoginBottomVector.vue'
|
||||
import LoginBackgroundOverlay from '@/scripts/components/svg/LoginBackgroundOverlay.vue'
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
const pageHeading = computed(() => {
|
||||
if (window.login_page_heading) {
|
||||
return window.login_page_heading
|
||||
}
|
||||
|
||||
return 'Simple Invoicing for Individuals Small Businesses'
|
||||
})
|
||||
|
||||
const pageDescription = computed(() => {
|
||||
if (window.login_page_description) {
|
||||
return window.login_page_description
|
||||
}
|
||||
|
||||
return 'Crater helps you track expenses, record payments & generate beautiful invoices & estimates.'
|
||||
})
|
||||
|
||||
const loginPageLogo = computed(() => {
|
||||
if (window.login_page_logo) {
|
||||
return window.login_page_logo
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -33,7 +33,8 @@
|
||||
md:block
|
||||
"
|
||||
>
|
||||
<MainLogo class="h-6" light-color="white" dark-color="white" />
|
||||
<img v-if="adminLogo" :src="adminLogo" class="h-6" />
|
||||
<MainLogo v-else class="h-6" light-color="white" dark-color="white" />
|
||||
</router-link>
|
||||
|
||||
<!-- toggle button-->
|
||||
@ -195,6 +196,14 @@ const previewAvatar = computed(() => {
|
||||
: getDefaultAvatar()
|
||||
})
|
||||
|
||||
const adminLogo = computed(() => {
|
||||
if (globalStore.globalSettings.admin_portal_logo) {
|
||||
return '/storage/' + globalStore.globalSettings.admin_portal_logo
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
function getDefaultAvatar() {
|
||||
const imgUrl = new URL('/img/default-avatar.jpg', import.meta.url)
|
||||
return imgUrl
|
||||
|
||||
@ -46,7 +46,7 @@ export const useAuthStore = (useWindow = false) => {
|
||||
logout() {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get('/auth/logout')
|
||||
.post('/auth/logout')
|
||||
.then((response) => {
|
||||
const notificationStore = useNotificationStore()
|
||||
notificationStore.showNotification({
|
||||
@ -55,7 +55,7 @@ export const useAuthStore = (useWindow = false) => {
|
||||
})
|
||||
|
||||
window.router.push('/login')
|
||||
// resetStore.clearPinia()
|
||||
// resetStore.clearPinia()
|
||||
resolve(response)
|
||||
})
|
||||
.catch((err) => {
|
||||
@ -67,4 +67,4 @@ export const useAuthStore = (useWindow = false) => {
|
||||
},
|
||||
},
|
||||
})()
|
||||
}
|
||||
}
|
||||
@ -2,11 +2,10 @@
|
||||
<div class="grid gap-6 sm:grid-cols-2 lg:grid-cols-9 xl:gap-8">
|
||||
<!-- Amount Due -->
|
||||
<DashboardStatsItem
|
||||
v-if="userStore.hasAbilities(abilities.VIEW_INVOICE)"
|
||||
:icon-component="DollarIcon"
|
||||
:loading="!dashboardStore.isDashboardDataLoaded"
|
||||
:route="
|
||||
userStore.hasAbilities(abilities.VIEW_INVOICE) ? `/admin/invoices` : ''
|
||||
"
|
||||
route="/admin/invoices"
|
||||
:large="true"
|
||||
:label="$t('dashboard.cards.due_amount')"
|
||||
>
|
||||
@ -18,13 +17,10 @@
|
||||
|
||||
<!-- Customers -->
|
||||
<DashboardStatsItem
|
||||
v-if="userStore.hasAbilities(abilities.VIEW_CUSTOMER)"
|
||||
:icon-component="CustomerIcon"
|
||||
:loading="!dashboardStore.isDashboardDataLoaded"
|
||||
:route="
|
||||
userStore.hasAbilities(abilities.VIEW_CUSTOMER)
|
||||
? `/admin/customers`
|
||||
: ''
|
||||
"
|
||||
route="/admin/customers"
|
||||
:label="$t('dashboard.cards.customers')"
|
||||
>
|
||||
{{ dashboardStore.stats.totalCustomerCount }}
|
||||
@ -32,11 +28,10 @@
|
||||
|
||||
<!-- Invoices -->
|
||||
<DashboardStatsItem
|
||||
v-if="userStore.hasAbilities(abilities.VIEW_INVOICE)"
|
||||
:icon-component="InvoiceIcon"
|
||||
:loading="!dashboardStore.isDashboardDataLoaded"
|
||||
:route="
|
||||
userStore.hasAbilities(abilities.VIEW_INVOICE) ? `/admin/invoices` : ''
|
||||
"
|
||||
route="/admin/invoices"
|
||||
:label="$t('dashboard.cards.invoices')"
|
||||
>
|
||||
{{ dashboardStore.stats.totalInvoiceCount }}
|
||||
@ -44,13 +39,10 @@
|
||||
|
||||
<!-- Estimates -->
|
||||
<DashboardStatsItem
|
||||
v-if="userStore.hasAbilities(abilities.VIEW_ESTIMATE)"
|
||||
:icon-component="EstimateIcon"
|
||||
:loading="!dashboardStore.isDashboardDataLoaded"
|
||||
:route="
|
||||
userStore.hasAbilities(abilities.VIEW_ESTIMATE)
|
||||
? `/admin/estimates`
|
||||
: ''
|
||||
"
|
||||
route="/admin/estimates"
|
||||
:label="$t('dashboard.cards.estimates')"
|
||||
>
|
||||
{{ dashboardStore.stats.totalEstimateCount }}
|
||||
|
||||
@ -2,7 +2,10 @@
|
||||
<div>
|
||||
<div class="grid grid-cols-1 gap-6 mt-10 xl:grid-cols-2">
|
||||
<!-- Due Invoices -->
|
||||
<div class="due-invoices">
|
||||
<div
|
||||
v-if="userStore.hasAbilities(abilities.VIEW_INVOICE)"
|
||||
class="due-invoices"
|
||||
>
|
||||
<div class="relative z-10 flex items-center justify-between mb-3">
|
||||
<h6 class="mb-0 text-xl font-semibold leading-normal">
|
||||
{{ $t('dashboard.recent_invoices_card.title') }}
|
||||
@ -49,7 +52,10 @@
|
||||
</div>
|
||||
|
||||
<!-- Recent Estimates -->
|
||||
<div class="recent-estimates">
|
||||
<div
|
||||
v-if="userStore.hasAbilities(abilities.VIEW_ESTIMATE)"
|
||||
class="recent-estimates"
|
||||
>
|
||||
<div class="relative z-10 flex items-center justify-between mb-3">
|
||||
<h6 class="mb-0 text-xl font-semibold leading-normal">
|
||||
{{ $t('dashboard.recent_estimate_card.title') }}
|
||||
|
||||
@ -50,6 +50,7 @@ import { useUserStore } from '@/scripts/admin/stores/user'
|
||||
import { useRecurringInvoiceStore } from '@/scripts/admin/stores/recurring-invoice'
|
||||
import abilities from '@/scripts/admin/stub/abilities'
|
||||
import InvoiceDropdown from '@/scripts/admin/components/dropdowns/InvoiceIndexDropdown.vue'
|
||||
import SendInvoiceModal from '@/scripts/admin/components/modal-components/SendInvoiceModal.vue'
|
||||
|
||||
const recurringInvoiceStore = useRecurringInvoiceStore()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user