mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-05 05:35:58 +00:00
api refactoring
This commit is contained in:
@@ -116,11 +116,8 @@ export default {
|
||||
config: this.$root.$data.config,
|
||||
})
|
||||
|
||||
// Get installation state
|
||||
let installation = this.$root.$data.config.installation
|
||||
|
||||
// Redirect to setup wizard
|
||||
if (installation === 'installation-needed') {
|
||||
if (this.$root.$data.config.installation === 'installation-needed') {
|
||||
this.isLoaded = true
|
||||
|
||||
if (window.location.pathname.split('/')[1] !== 'setup-wizard') {
|
||||
|
||||
@@ -50,7 +50,7 @@ export default {
|
||||
reader.readAsDataURL(file)
|
||||
|
||||
// Update user avatar
|
||||
this.$updateImage('/user/settings', 'avatar', event.target.files[0])
|
||||
this.$updateAvatar(event.target.files[0])
|
||||
} else {
|
||||
alert(this.$t('wrong_image_error'))
|
||||
}
|
||||
|
||||
+30
-5
@@ -63,6 +63,27 @@ const FunctionHelpers = {
|
||||
})
|
||||
}
|
||||
|
||||
Vue.prototype.$updateAvatar = function (image) {
|
||||
// Create form
|
||||
let formData = new FormData()
|
||||
|
||||
// Add image to form
|
||||
formData.append('avatar', image)
|
||||
|
||||
axios
|
||||
.post(`${store.getters.api}/user/avatar`, formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
})
|
||||
.catch(() => {
|
||||
events.$emit('alert:open', {
|
||||
title: this.$t('popup_error.title'),
|
||||
message: this.$t('popup_error.message'),
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Vue.prototype.$scrollTop = function () {
|
||||
const container = document.getElementsByTagName('html')[0]
|
||||
|
||||
@@ -226,17 +247,21 @@ const FunctionHelpers = {
|
||||
'.part'
|
||||
|
||||
do {
|
||||
let isLast = chunks.length === 1,
|
||||
let isLastChunk = chunks.length === 1 ? 1 : 0,
|
||||
chunk = chunks.shift(),
|
||||
attempts = 0
|
||||
|
||||
// Set form data
|
||||
formData.set('name', item.file.name)
|
||||
formData.set('file', chunk, source_name)
|
||||
formData.set('path', item.path)
|
||||
formData.set('parent_id', item.parent_id)
|
||||
formData.set('chunk', chunk, source_name)
|
||||
formData.set('extension', item.file.name.split('.').pop())
|
||||
formData.set('is_last', isLast)
|
||||
formData.set('is_last_chunk', isLastChunk)
|
||||
|
||||
if (item.path && item.path !== '/')
|
||||
formData.set('path', item.path)
|
||||
|
||||
if (item.parent_id)
|
||||
formData.set('parent_id', item.parent_id)
|
||||
|
||||
// Upload chunks
|
||||
do {
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ const actions = {
|
||||
commit('LOADING_STATE', { loading: true, data: [] })
|
||||
|
||||
axios
|
||||
.get(`${getters.api}/browse/folders/${id}${getters.sorting.URI}`)
|
||||
.get(`${getters.api}/browse/folders/${id || 'all'}${getters.sorting.URI}`)
|
||||
.then((response) => {
|
||||
let folders = response.data.folders.data
|
||||
let files = response.data.files.data
|
||||
@@ -85,7 +85,7 @@ const actions = {
|
||||
commit('LOADING_STATE', { loading: true, data: [] })
|
||||
|
||||
axios
|
||||
.get(`${getters.api}/browse/trash/${id}${getters.sorting.URI}`)
|
||||
.get(`${getters.api}/browse/trash/${id || 'all'}${getters.sorting.URI}`)
|
||||
.then((response) => {
|
||||
let folders = response.data.folders.data
|
||||
let files = response.data.files.data
|
||||
|
||||
+3
-3
@@ -149,9 +149,9 @@ const actions = {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Get route
|
||||
let route = {
|
||||
RequestUpload: `/api/upload-request/${router.currentRoute.params.token}/upload`,
|
||||
Public: `/api/editor/upload/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/upload'
|
||||
RequestUpload: `/api/upload-request/${router.currentRoute.params.token}/upload/chunks`,
|
||||
Public: `/api/editor/upload/chunks/${router.currentRoute.params.token}`,
|
||||
}[router.currentRoute.name] || '/api/upload/chunks'
|
||||
|
||||
// Create cancel token for axios cancellation
|
||||
const CancelToken = axios.CancelToken,
|
||||
|
||||
Vendored
+2
-2
@@ -17,7 +17,7 @@ const actions = {
|
||||
}
|
||||
|
||||
axios
|
||||
.get(`${getters.api}/teams/folders/${id}${getters.sorting.URI}`)
|
||||
.get(`${getters.api}/teams/folders/${id || 'all'}${getters.sorting.URI}`)
|
||||
.then((response) => {
|
||||
let folders = response.data.folders.data
|
||||
let files = response.data.files.data
|
||||
@@ -59,7 +59,7 @@ const actions = {
|
||||
}
|
||||
|
||||
axios
|
||||
.get(`${getters.api}/teams/shared-with-me/${id}${getters.sorting.URI}`)
|
||||
.get(`${getters.api}/teams/shared-with-me/${id || 'all'}${getters.sorting.URI}`)
|
||||
.then((response) => {
|
||||
let folders = response.data.folders.data
|
||||
let files = response.data.files.data
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ const actions = {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
axios
|
||||
.get(`/api/upload-request/${router.currentRoute.params.token}/browse/${id}${getters.sorting.URI}`)
|
||||
.get(`/api/upload-request/${router.currentRoute.params.token}/browse/${id || 'all'}${getters.sorting.URI}`)
|
||||
.then((response) => {
|
||||
let folders = response.data.folders.data
|
||||
let files = response.data.files.data
|
||||
|
||||
+4
-4
@@ -93,7 +93,7 @@ const actions = {
|
||||
context.commit('ADD_TO_FAVOURITES', favouritesWidget)
|
||||
|
||||
axios
|
||||
.post(context.getters.api + '/folders/favourites', {
|
||||
.post(context.getters.api + '/favourites', {
|
||||
ids: itemsToFavourites,
|
||||
})
|
||||
.catch(() => {
|
||||
@@ -105,19 +105,19 @@ const actions = {
|
||||
commit('REMOVE_ITEM_FROM_FAVOURITES', folder)
|
||||
|
||||
axios
|
||||
.post(getters.api + '/folders/favourites/' + folder.data.id, {
|
||||
.post(getters.api + '/favourites/' + folder.data.id, {
|
||||
_method: 'delete',
|
||||
})
|
||||
.catch(() => Vue.prototype.$isSomethingWrong())
|
||||
},
|
||||
readAllNotifications: ({ commit }) => {
|
||||
axios.post('/api/user/notifications/read')
|
||||
axios.post('/api/notifications/read')
|
||||
.then(() => {
|
||||
commit('UPDATE_NOTIFICATION_COUNT', 0)
|
||||
})
|
||||
},
|
||||
deleteAllNotifications: ({ commit }) => {
|
||||
axios.delete('/api/user/notifications')
|
||||
axios.delete('/api/notifications')
|
||||
.then(() => {
|
||||
commit('FLUSH_NOTIFICATIONS')
|
||||
})
|
||||
|
||||
@@ -119,7 +119,7 @@ export default {
|
||||
|
||||
// Send request to get user reset link
|
||||
axios
|
||||
.post('/api/password/email', {
|
||||
.post('/api/password/recover', {
|
||||
email: this.recoverEmail,
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
@@ -275,7 +275,7 @@ export default {
|
||||
},
|
||||
resendEmail() {
|
||||
axios
|
||||
.post('/api/user/email/verify/resend', {
|
||||
.post('/api/user/verify', {
|
||||
email: this.loginEmail,
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
+87
-144
@@ -1,70 +1,15 @@
|
||||
@php
|
||||
use Monolog\Handler\MissingExtensionException;
|
||||
use VueFileManager\Subscription\Domain\Plans\Models\Plan;
|
||||
use VueFileManager\Subscription\Domain\Transactions\Models\Transaction;
|
||||
use VueFileManager\Subscription\Domain\Subscriptions\Models\Subscription;
|
||||
|
||||
try {
|
||||
// Bcmath Extension
|
||||
$storageDefaultSpaceFormatted = isset($settings->default_max_storage_amount)
|
||||
? format_gigabytes($settings->default_max_storage_amount)
|
||||
: format_gigabytes(5);
|
||||
|
||||
$uploadLimit = isset($settings->upload_limit)
|
||||
? format_bytes($settings->upload_limit)
|
||||
: 'undefined';
|
||||
|
||||
$chunkSize = isset($settings->chunk_size)
|
||||
? format_bytes($settings->chunk_size)
|
||||
: format_bytes(64);
|
||||
|
||||
$uploadLimitFormatted = isset($settings->upload_limit)
|
||||
? format_megabytes($settings->upload_limit)
|
||||
: null;
|
||||
|
||||
} catch (MissingExtensionException $exception) {
|
||||
$storageDefaultSpaceFormatted = '5GB';
|
||||
$uploadLimit = 'undefined';
|
||||
$uploadLimitFormatted = 5;
|
||||
$chunkSize = 64000000;
|
||||
}
|
||||
|
||||
try {
|
||||
// Subscription
|
||||
$isEmptySubscriptions = Subscription::count() === 0;
|
||||
$isEmptyTransactions = Transaction::count() === 0;
|
||||
$isEmptyPlans = Plan::count() === 0;
|
||||
$plan = Plan::where('status', 'active')
|
||||
->where('type', 'metered');
|
||||
|
||||
// User
|
||||
$isUser = auth()->check();
|
||||
$user = Auth::user();
|
||||
|
||||
// Default user settings
|
||||
$defaultEmoji = $isUser ? $user->settings->emoji_type : 'twemoji';
|
||||
$defaultThemeMode = $isUser ? $user->settings->theme_mode : 'system';
|
||||
} catch (PDOException $e) {
|
||||
[$isUser, $isEmptyPlans, $isEmptyTransactions, $isEmptySubscriptions] = false;
|
||||
|
||||
$plan = null;
|
||||
$defaultEmoji = 'twemoji';
|
||||
$defaultThemeMode = 'system';
|
||||
}
|
||||
@endphp
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="{{ $installation === 'installation-needed' ? 'dark:bg-dark-background bg-light-background' : '' }}" style="min-height: 100%" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<html class="{{ $config->installation === 'installation-needed' ? 'dark:bg-dark-background bg-light-background' : '' }}" style="min-height: 100%" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta name="theme-color" content="{{ $settings->app_color ?? '#00BC7E' }}">
|
||||
<meta name="theme-color" content="{{ $config->app_color ?? '#00BC7E' }}">
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
|
||||
<meta name="description" content="{{ $settings->app_description ?? __t('app_description') }}">
|
||||
<meta name="description" content="{{ $config->app_description ?? __t('app_description') }}">
|
||||
|
||||
<title>
|
||||
{{ $settings->app_title ?? 'VueFileManager' }} | {{ $settings->app_description ?? __t('app_description') }}
|
||||
{{ $config->app_title ?? 'VueFileManager' }} | {{ $config->app_description ?? __t('app_description') }}
|
||||
</title>
|
||||
|
||||
{{--StyleSheet--}}
|
||||
@@ -73,18 +18,18 @@
|
||||
|
||||
{{--OG items--}}
|
||||
<meta property="og:url" content="{{ url('/') }}">
|
||||
<meta property="og:title" content="{{ $settings->app_title ?? 'VueFileManager' }} | {{ $settings->app_description ?? __t('app_description') }}">
|
||||
<meta property="og:description" content="{{ $settings->app_description ?? __t('app_description') }}">
|
||||
<meta property="og:image" content="{{ isset($settings->app_og_image) ? url($settings->app_og_image) : '' }}">
|
||||
<meta property="og:title" content="{{ $config->app_title ?? 'VueFileManager' }} | {{ $config->app_description ?? __t('app_description') }}">
|
||||
<meta property="og:description" content="{{ $config->app_description ?? __t('app_description') }}">
|
||||
<meta property="og:image" content="{{ isset($config->app_og_image) ? url($config->app_og_image) : '' }}">
|
||||
|
||||
{{-- Apple Mobile Web App--}}
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="white">
|
||||
<meta name="apple-mobile-web-app-title" content="{{ $settings->app_title ?? 'VueFileManager' }}">
|
||||
<meta name="apple-mobile-web-app-title" content="{{ $config->app_title ?? 'VueFileManager' }}">
|
||||
|
||||
{{--Icons--}}
|
||||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ isset($settings->app_touch_icon) ? url($settings->app_touch_icon) : '' }}">
|
||||
<link rel="icon" href="{{ isset($settings->app_favicon) ? url($settings->app_favicon) : asset('favicon.png') }}?v={{ get_version() }}">
|
||||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ isset($config->app_touch_icon) ? url($config->app_touch_icon) : '' }}">
|
||||
<link rel="icon" href="{{ isset($config->app_favicon) ? url($config->app_favicon) : asset('favicon.png') }}?v={{ get_version() }}">
|
||||
|
||||
{{--Format Detection--}}
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
@@ -97,115 +42,113 @@
|
||||
<div id="app"></div>
|
||||
|
||||
<script>
|
||||
// todo: refactoring
|
||||
|
||||
let config = {
|
||||
host: '{{ url('/') }}',
|
||||
api: '{{ url('/api') }}',
|
||||
locale: '{{ app()->getLocale() }}',
|
||||
host: '{{ $config->host }}',
|
||||
api: '{{ $config->api }}',
|
||||
locale: '{{ $config->locale }}',
|
||||
|
||||
broadcasting: '{{ config('broadcasting.default') }}',
|
||||
broadcastingKey: '{{ config('broadcasting.connections.pusher.key') }}',
|
||||
broadcastingHost: '{{ config('broadcasting.connections.pusher.options.host') }}',
|
||||
broadcastingPort: '{{ config('broadcasting.connections.pusher.options.port') }}',
|
||||
broadcastingCluster: '{{ config('broadcasting.connections.pusher.options.cluster') }}',
|
||||
broadcasting: '{{ $config->broadcasting }}',
|
||||
broadcastingKey: '{{ $config->broadcastingKey }}',
|
||||
broadcastingHost: '{{ $config->broadcastingHost }}',
|
||||
broadcastingPort: '{{ $config->broadcastingPort }}',
|
||||
broadcastingCluster: '{{ $config->broadcastingCluster }}',
|
||||
|
||||
app_logo: '{{ $settings->app_logo ?? null }}',
|
||||
app_logo_dark: '{{ $settings->app_logo_dark ?? null }}',
|
||||
app_logo_horizontal: '{{ $settings->app_logo_horizontal ?? null }}',
|
||||
app_logo_horizontal_dark: '{{ $settings->app_logo_horizontal_dark ?? null }}',
|
||||
app_logo: '{{ $config->app_logo }}',
|
||||
app_logo_dark: '{{ $config->app_logo_dark }}',
|
||||
app_logo_horizontal: '{{ $config->app_logo_horizontal }}',
|
||||
app_logo_horizontal_dark: '{{ $config->app_logo_horizontal_dark }}',
|
||||
|
||||
app_color: '{{ $settings->app_color ?? '#00BC7E' }}',
|
||||
app_footer: '{!! $settings->footer_content ?? null !!}',
|
||||
app_name: '{{ $settings->app_title ?? 'VueFileManager' }}',
|
||||
app_description: '{{ $settings->app_description ?? __t('app_description') }}',
|
||||
app_color: '{{ $config->app_color }}',
|
||||
app_footer: '{!! $config->app_footer !!}',
|
||||
app_name: '{{ $config->app_name }}',
|
||||
app_description: '{{ $config->app_description }}',
|
||||
|
||||
allowHomepage: {{ $settings->allow_homepage ?? 1 }},
|
||||
storageLimit: {{ $settings->storage_limitation ?? 1 }},
|
||||
teamsDefaultMembers: {{ $settings->default_max_team_member ?? 10 }},
|
||||
storageDefaultSpace: {{ $settings->default_max_storage_amount ?? 5 }},
|
||||
storageDefaultSpaceFormatted: '{{ $storageDefaultSpaceFormatted }}',
|
||||
mimetypesBlacklist: '{{ isset($settings->mimetypes_blacklist) ? $settings->mimetypes_blacklist: null}}',
|
||||
uploadLimit: {{ $uploadLimit }},
|
||||
uploadLimitFormatted: '{{ $uploadLimitFormatted }}',
|
||||
chunkSize: {{ $chunkSize }},
|
||||
allowHomepage: {{ $config->allowHomepage }},
|
||||
storageLimit: {{ $config->storageLimit }},
|
||||
teamsDefaultMembers: {{ $config->teamsDefaultMembers }},
|
||||
storageDefaultSpace: {{ $config->storageDefaultSpace }},
|
||||
storageDefaultSpaceFormatted: '{{ $config->storageDefaultSpaceFormatted }}',
|
||||
mimetypesBlacklist: '{{ $config->mimetypesBlacklist }}',
|
||||
uploadLimit: {{ $config->uploadLimit }},
|
||||
uploadLimitFormatted: '{{ $config->uploadLimitFormatted }}',
|
||||
chunkSize: {{ $config->chunkSize }},
|
||||
|
||||
isAuthenticated: {{ $isUser ? 1 : 0 }},
|
||||
isSaaS: {{ $settings && optional($settings)->license === 'extended' ? 1 : 0 }},
|
||||
isAuthenticated: {{ $config->isAuthenticated }},
|
||||
isSaaS: {{ $config->isSaaS }},
|
||||
|
||||
isDev: {{ is_dev() ? 1 : 0 }},
|
||||
isDemo: {{ config('vuefilemanager.is_demo') ? 1 : 0 }},
|
||||
isDev: {{ $config->isDev }},
|
||||
isDemo: {{ $config->isDemo }},
|
||||
|
||||
legal: {!! $legal ?? 'undefined' !!},
|
||||
legal: {!! $config->legal !!},
|
||||
|
||||
installation: '{{ $installation ?? 'initial' }}',
|
||||
statusCheck: {!! json_encode($status_check) ?? 'undefined' !!},
|
||||
isSetupWizardDemo: {{ config('vuefilemanager.is_setup_wizard_demo') ? 1 : 0 }},
|
||||
isSetupWizardDebug: {{ config('vuefilemanager.is_setup_wizard_debug') ? 1 : 0 }},
|
||||
installation: '{{ $config->installation }}',
|
||||
statusCheck: {!! $config->statusCheck !!},
|
||||
isSetupWizardDemo: {{ $config->isSetupWizardDemo }},
|
||||
isSetupWizardDebug: {{ $config->isSetupWizardDebug }},
|
||||
|
||||
// States
|
||||
isEmptyPlans: {{ $isEmptyPlans ? 1 : 0 }},
|
||||
isEmptyTransactions: {{ $isEmptyTransactions ? 1 : 0 }},
|
||||
isEmptySubscriptions: {{ $isEmptySubscriptions ? 1 : 0 }},
|
||||
isEmptyPlans: {{ $config->isEmptyPlans }},
|
||||
isEmptyTransactions: {{ $config->isEmptyTransactions }},
|
||||
isEmptySubscriptions: {{ $config->isEmptySubscriptions }},
|
||||
|
||||
// Hidden set ups
|
||||
isAdminVueFileManagerBar: {{ config('vuefilemanager.is_admin_vuefilemanager_bar', 1) ? 1 : 0 }},
|
||||
isAdminVueFileManagerBar: {{ $config->isAdminVueFileManagerBar }},
|
||||
|
||||
// Metered
|
||||
allowed_registration_bonus: {{ $settings->allowed_registration_bonus ?? 0 }},
|
||||
registration_bonus_amount: {{ $settings->registration_bonus_amount ?? 0 }},
|
||||
isCreatedMeteredPlan: {{ $plan && $plan->exists() ? 1 : 0 }},
|
||||
meteredPlanId: '{{ $plan && $plan->exists() ? $plan->first()->id : null }}',
|
||||
allowed_registration_bonus: {{ $config->allowed_registration_bonus }},
|
||||
registration_bonus_amount: {{ $config->registration_bonus_amount }},
|
||||
isCreatedMeteredPlan: {{ $config->isCreatedMeteredPlan }},
|
||||
meteredPlanId: '{{ $config->meteredPlanId }}',
|
||||
|
||||
// Payments
|
||||
allowed_payments: {{ $settings->allowed_payments ?? 0 }},
|
||||
subscriptionType: '{{ $settings->subscription_type ?? 'none' }}',
|
||||
allowed_payments: {{ $config->allowed_payments }},
|
||||
subscriptionType: '{{ $config->subscriptionType }}',
|
||||
|
||||
// PayPal
|
||||
isPayPal: {{ $settings->allowed_paypal ?? 0 }},
|
||||
isPayPalLive: {{ config('subscription.credentials.paypal.is_live') ? 1 : 0 }},
|
||||
paypal_client_id: '{{ config('subscription.credentials.paypal.id') }}',
|
||||
paypal_payment_description: '{{ $settings->paypal_payment_description ?? '' }}',
|
||||
isPayPal: {{ $config->isPayPal }},
|
||||
isPayPalLive: {{ $config->isPayPalLive }},
|
||||
paypal_client_id: '{{ $config->paypal_client_id }}',
|
||||
paypal_payment_description: '{{ $config->paypal_payment_description }}',
|
||||
|
||||
// Paystack
|
||||
isPaystack: {{ $settings->allowed_paystack ?? 0 }},
|
||||
paystack_public_key: '{{ config('subscription.credentials.paystack.public_key') }}',
|
||||
paystack_payment_description: '{{ $settings->paystack_payment_description ?? '' }}',
|
||||
isPaystack: {{ $config->isPaystack }},
|
||||
paystack_public_key: '{{ $config->paystack_public_key }}',
|
||||
paystack_payment_description: '{{ $config->paystack_payment_description }}',
|
||||
|
||||
// Stripe
|
||||
isStripe: {{ $settings->allowed_stripe ?? 0 }},
|
||||
stripe_public_key: '{{ config('subscription.credentials.stripe.public_key') }}',
|
||||
stripe_payment_description: '{{ $settings->stripe_payment_description ?? '' }}',
|
||||
isStripe: {{ $config->isStripe }},
|
||||
stripe_public_key: '{{ $config->stripe_public_key }}',
|
||||
stripe_payment_description: '{{ $config->stripe_payment_description }}',
|
||||
|
||||
// ReCaptcha
|
||||
recaptcha_client_id: '{{ config('services.recaptcha.client_id') }}',
|
||||
allowedRecaptcha: {{ $settings->allowed_recaptcha ?? 0 }},
|
||||
isRecaptchaConfigured: {{ config('services.recaptcha.client_id') ? 1 : 0 }},
|
||||
recaptcha_client_id: '{{ $config->recaptcha_client_id }}',
|
||||
allowedRecaptcha: {{ $config->allowedRecaptcha }},
|
||||
isRecaptchaConfigured: {{ $config->isRecaptchaConfigured }},
|
||||
|
||||
// Social logins
|
||||
allowedFacebookLogin: {{ $settings->allowed_facebook_login ?? 0 }},
|
||||
isFacebookLoginConfigured: {{ config('services.facebook.client_id') ? 1 : 0 }},
|
||||
allowedFacebookLogin: {{ $config->allowedFacebookLogin }},
|
||||
isFacebookLoginConfigured: {{ $config->isFacebookLoginConfigured }},
|
||||
|
||||
allowedGoogleLogin: {{ $settings->allowed_google_login ?? 0 }},
|
||||
isGoogleLoginConfigured: {{ config('services.google.client_id') ? 1 : 0 }},
|
||||
allowedGoogleLogin: {{ $config->allowedGoogleLogin }},
|
||||
isGoogleLoginConfigured: {{ $config->isGoogleLoginConfigured }},
|
||||
|
||||
allowedGithubLogin: {{ $settings->allowed_github_login ?? 0 }},
|
||||
isGithubLoginConfigured: {{ config('services.github.client_id') ? 1 : 0 }},
|
||||
allowedGithubLogin: {{ $config->allowedGithubLogin }},
|
||||
isGithubLoginConfigured: {{ $config->isGithubLoginConfigured }},
|
||||
|
||||
// Adsense
|
||||
allowedAdsense: {{ $settings?->allowed_adsense ?? 0 }},
|
||||
adsenseClientId: '{{ $settings->adsense_client_id ?? '' }}',
|
||||
adsenseBanner01: `{!! $settings->adsense_banner_01 ?? '' !!}`,
|
||||
adsenseBanner02: `{!! $settings->adsense_banner_02 ?? '' !!}`,
|
||||
adsenseBanner03: `{!! $settings->adsense_banner_03 ?? '' !!}`,
|
||||
allowedAdsense: {{ $config->allowedAdsense }},
|
||||
adsenseClientId: '{{ $config->adsenseClientId }}',
|
||||
adsenseBanner01: `{!! $config->adsenseBanner01 !!}`,
|
||||
adsenseBanner02: `{!! $config->adsenseBanner02 !!}`,
|
||||
adsenseBanner03: `{!! $config->adsenseBanner03 !!}`,
|
||||
|
||||
// User settings
|
||||
defaultEmoji: '{{ $defaultEmoji }}',
|
||||
defaultThemeMode: '{{ $defaultThemeMode }}',
|
||||
defaultEmoji: '{{ $config->defaultEmoji }}',
|
||||
defaultThemeMode: '{{ $config->defaultThemeMode }}',
|
||||
|
||||
// App settings
|
||||
userRegistration: {{ $settings->registration ?? 1 }},
|
||||
userVerification: {{ $settings->user_verification ?? 0 }},
|
||||
userRegistration: {{ $config->userRegistration }},
|
||||
userVerification: {{ $config->userVerification }},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -215,14 +158,14 @@
|
||||
<script src="{{ asset('js/main.js') }}?v={{ get_version() }}"></script>
|
||||
|
||||
{{--Global site tag (gtag.js) - Google Analytics--}}
|
||||
@if(isset($settings->google_analytics) && $settings->google_analytics)
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ $settings->google_analytics }}"></script>
|
||||
@if(isset($config->google_analytics) && $config->google_analytics)
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ $config->google_analytics }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '{{ $settings->google_analytics }}');
|
||||
gtag('config', '{{ $config->google_analytics }}');
|
||||
</script>
|
||||
@endif
|
||||
@else
|
||||
@@ -231,8 +174,8 @@
|
||||
@endif
|
||||
|
||||
{{--Adsense code--}}
|
||||
@if(optional($settings)->allowed_adsense)
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client={{ $settings->adsense_client_id ?? '' }}" crossorigin="anonymous"></script>
|
||||
@if(optional($config)->allowed_adsense)
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client={{ $config->adsense_client_id ?? '' }}" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
|
||||
Reference in New Issue
Block a user