This commit is contained in:
Dennis
2022-08-08 11:53:55 +02:00
parent e601222b4f
commit f0a8e5e318
18 changed files with 70 additions and 57 deletions

View File

@@ -31,11 +31,11 @@ class Ploi
{
$this->url = config('services.ploi-api.url');
if ( ! $token ) {
if (!$token) {
$token = config('services.ploi.token');
}
if ( ! $coreApiToken ) {
if (!$coreApiToken) {
$coreApiToken = config('services.ploi.core-token');
}
@@ -68,12 +68,17 @@ class Ploi
public function buildClient(): static
{
$this->client = Http::baseUrl($this->url)->withHeaders([
'Authorization' => 'Bearer ' . $this->getApiToken(),
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'X-Ploi-Core-Key' => $this->getCoreApiToken(),
]);
$this->client = Http::baseUrl($this->url)
->withHeaders([
'Authorization' => 'Bearer ' . $this->getApiToken(),
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'X-Ploi-Core-Key' => $this->getCoreApiToken(),
]);
if (app()->isLocal()) {
$this->client->withoutVerifying();
}
return $this;
}
@@ -90,7 +95,7 @@ class Ploi
public function makeAPICall(string $url, string $method = 'get', array $options = []): Response
{
if ( ! in_array($method, ['get', 'post', 'patch', 'delete']) ) {
if (!in_array($method, ['get', 'post', 'patch', 'delete'])) {
throw new Exception('Invalid method type');
}
@@ -98,7 +103,7 @@ class Ploi
* This is a temporary method that was necessary for the switch from the Guzzle client to the Http facade.
* We _should not_ need this, but it feels safer to keep this fallback code around for now.
*/
if ( count($options) === 1 && array_key_exists('body', $options) ) {
if (count($options) === 1 && array_key_exists('body', $options)) {
$options = is_string($options['body']) ? json_decode($options['body']) : $options['body'];
}

41
package-lock.json generated
View File

@@ -25,18 +25,18 @@
"laravel-vite-plugin": "^0.5.0",
"lodash": "^4.17.15",
"mitt": "^3.0.0",
"portal-vue": "^3.0.0-beta.0",
"postcss": "^8.4.5",
"resolve-url-loader": "^3.1.0",
"sass": "^1.53.0",
"sass-loader": "^8.0.0",
"tailwindcss": "^3.1.8",
"tippy.js": "^6.3.7",
"v-click-outside": "^3.1.2",
"v-click-outside": "^3.2.0",
"vite": "^3.0.2",
"vue": "^3.1.0",
"vue-clipboard2": "^0.3.1",
"vue-loader": "^16.0.0",
"vue-meta": "^2.4.0",
"vuex": "^4.0.2"
}
},
@@ -2890,6 +2890,18 @@
"node": ">=0.10.0"
}
},
"node_modules/portal-vue": {
"version": "3.0.0-beta.0",
"resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-3.0.0-beta.0.tgz",
"integrity": "sha512-ktV+Q0fwlsjeF+2xGebMxrN6xH8yMdmbLzYbd2OfcgU4OmzSmkj6iP3kBQRGa+7A5WZlqCHWaFfecNs9Igsv9w==",
"dev": true,
"engines": {
"node": ">=14"
},
"peerDependencies": {
"vue": "^3.0.4"
}
},
"node_modules/postcss": {
"version": "8.4.14",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz",
@@ -3931,15 +3943,6 @@
"node": ">=8"
}
},
"node_modules/vue-meta": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-2.4.0.tgz",
"integrity": "sha512-XEeZUmlVeODclAjCNpWDnjgw+t3WA6gdzs6ENoIAgwO1J1d5p1tezDhtteLUFwcaQaTtayRrsx7GL6oXp/m2Jw==",
"dev": true,
"dependencies": {
"deepmerge": "^4.2.2"
}
},
"node_modules/vuex": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-4.0.2.tgz",
@@ -6269,6 +6272,13 @@
"integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==",
"dev": true
},
"portal-vue": {
"version": "3.0.0-beta.0",
"resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-3.0.0-beta.0.tgz",
"integrity": "sha512-ktV+Q0fwlsjeF+2xGebMxrN6xH8yMdmbLzYbd2OfcgU4OmzSmkj6iP3kBQRGa+7A5WZlqCHWaFfecNs9Igsv9w==",
"dev": true,
"requires": {}
},
"postcss": {
"version": "8.4.14",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz",
@@ -6973,15 +6983,6 @@
}
}
},
"vue-meta": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-2.4.0.tgz",
"integrity": "sha512-XEeZUmlVeODclAjCNpWDnjgw+t3WA6gdzs6ENoIAgwO1J1d5p1tezDhtteLUFwcaQaTtayRrsx7GL6oXp/m2Jw==",
"dev": true,
"requires": {
"deepmerge": "^4.2.2"
}
},
"vuex": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-4.0.2.tgz",

View File

@@ -32,17 +32,17 @@
"lodash": "^4.17.15",
"mitt": "^3.0.0",
"postcss": "^8.4.5",
"portal-vue": "^3.0.0-beta.0",
"resolve-url-loader": "^3.1.0",
"sass": "^1.53.0",
"sass-loader": "^8.0.0",
"tailwindcss": "^3.1.8",
"tippy.js": "^6.3.7",
"v-click-outside": "^3.1.2",
"v-click-outside": "^3.2.0",
"vite": "^3.0.2",
"vue": "^3.1.0",
"vue-clipboard2": "^0.3.1",
"vue-loader": "^16.0.0",
"vue-meta": "^2.4.0",
"vuex": "^4.0.2"
}
}

View File

@@ -303,7 +303,7 @@ export default {
}
},
beforeDestroy() {
beforeUnmount() {
this.clearPollingInterval();
}
}

View File

@@ -284,7 +284,7 @@ export default {
}
},
beforeDestroy(){
beforeUnmount(){
this.clearPollingInterval();
}
}

View File

@@ -322,7 +322,7 @@ export default {
}
},
beforeDestroy(){
beforeUnmount(){
this.clearPollingInterval();
}
}

View File

@@ -263,7 +263,7 @@ export default {
}
},
beforeDestroy() {
beforeUnmount() {
this.clearPollingInterval();
}
}

View File

@@ -275,7 +275,7 @@ export default {
}
},
beforeDestroy(){
beforeUnmount(){
this.clearPollingInterval();
}
}

View File

@@ -264,7 +264,7 @@ export default {
}
},
beforeDestroy(){
beforeUnmount(){
this.clearPollingInterval();
}
}

View File

@@ -227,7 +227,7 @@ export default {
},
},
beforeDestroy() {
beforeUnmount() {
this.clearTimeoutInterval();
}
}

View File

@@ -1,7 +1,8 @@
<template>
<ul class="md:-ml-4 space-y-1">
<li v-for="item in items" v-if="item">
<li v-for="item in items" >
<component
v-if="item"
:is="item.type && item.type === 'a' ? 'a' : 'inertia-link'"
:target="item.type && item.type === 'a' ? '_blank' : '_self'"
class="flex items-center h-10 px-4 font-medium text-medium-emphasis"

12
resources/js/app.js vendored
View File

@@ -2,8 +2,8 @@ import {createInertiaApp, InertiaLink} from '@inertiajs/inertia-vue3'
import {resolvePageComponent} from "laravel-vite-plugin/inertia-helpers";
import {createApp, h} from 'vue';
import {InertiaProgress} from '@inertiajs/progress'
import VueMeta from 'vue-meta'
import Store from '@/store';
import PortalVue from 'portal-vue'
import vClickOutside from 'v-click-outside'
import VueClipboard from 'vue-clipboard2'
import mixins from '@/mixins';
@@ -11,18 +11,22 @@ import axios from 'axios';
import forEach from 'lodash/forEach';
import mitt from 'mitt';
import '../sass/app.scss';
import Vue from 'vue'
Vue.configureCompat({ RENDER_FUNCTION: false, COMPONENT_V_MODEL: false });
createInertiaApp({
title: (title) => `${title} - ${appName}`,
resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
setup({el, app, props, plugin}) {
return createApp({render: () => h(app, props)})
setup({el, App, props, plugin}) {
createApp({
render: () => h(App, props),
})
.use(plugin)
.use(vClickOutside)
.use(VueMeta)
.use(VueClipboard)
.use(Store)
.use(PortalVue)
.mixin({methods: {route: window.route}})
.mixin(mixins)
.component('InertiaLink', InertiaLink)

View File

@@ -1,5 +1,5 @@
<template>
<div v-click-outside="close" ref="dropdown" class="relative">
<div ref="dropdown" class="relative">
<slot v-bind="{ isOpen, open, close, toggle, position }"></slot>
</div>
</template>
@@ -41,7 +41,7 @@ export default {
mounted() {
window.addEventListener('click', this.outsideClickListener)
},
beforeDestroy() {
beforeUnmount() {
window.removeEventListener('click', this.outsideClickListener)
},
}

View File

@@ -88,7 +88,7 @@ export default {
});
},
destroyed() {
unmounted() {
if (this.timeout) clearTimeout(this.timeout);
},

View File

@@ -2,9 +2,11 @@
<ul
class="inline-flex flex-row p-1 overflow-hidden overflow-x-auto whitespace-nowrap rounded bg-tab-bar"
>
<TabBarItem v-for="item in items" :key="item.title" :to="item.to" :active="item.active" v-if="item">
{{ item.title }}
</TabBarItem>
<template v-for="item in items">
<TabBarItem :key="item.title" :to="item.to" :active="item.active" v-if="item">
{{ item.title }}
</TabBarItem>
</template>
</ul>
</template>

View File

@@ -20,7 +20,7 @@
]"
:type="type"
:required="required"
:value="value"
:value="modelValue"
@input="updateValue($event.target.value)"
:disabled="loading || disabled"
:autofocus="autofocus"
@@ -69,7 +69,7 @@ export default {
placeholder: {
type: String,
},
value: {
modelValue: {
required: false,
default: '',
},
@@ -130,7 +130,7 @@ export default {
methods: {
updateValue(value) {
this.$emit('input', value);
this.$emit('update:modelValue', value);
},
copy() {
this.copied = true;

View File

@@ -7,7 +7,7 @@
loading ? 'cursor-wait' : '',
]" :id="id" :required="required" :placeholder="placeholder"
@input="updateValue($event.target.value)"
v-model="value">
v-model="modelValue">
<slot></slot>
</select>
<ErrorText v-if="errors">{{ errors[0] }}</ErrorText>
@@ -51,7 +51,7 @@ export default {
placeholder: {
type: String,
},
value: {
modelValue: {
required: false,
default: '',
},
@@ -83,7 +83,7 @@ export default {
methods: {
updateValue(value) {
this.$emit('input', value);
this.$emit('update:modelValue', value);
},
},
}

2
vite.config.js vendored
View File

@@ -23,7 +23,7 @@ export default defineConfig({
template: {
compilerOptions: {
compatConfig: {
MODE: 2,
MODE: 3,
}
},
transformAssetUrls: {