Compare commits

...

8 Commits
1.6.2 ... 1.6.5

Author SHA1 Message Date
Dennis
59c65fe6ee prod 2021-07-18 10:12:47 +02:00
Dennis
087c042c14 Merge branch 'develop'
# Conflicts:
#	public/js/app.js
2021-07-18 10:12:15 +02:00
Dennis
d1ee488ffd fixes 2021-07-18 10:11:50 +02:00
Dennis
34100bc580 prod mix 2021-07-14 09:51:24 +02:00
Dennis
22d91517fb Merge branch 'develop'
# Conflicts:
#	public/js/app.js
2021-07-14 09:50:10 +02:00
Dennis
1c088bd4e0 Bugfixes and improvements 2021-07-14 09:50:00 +02:00
Dennis
fd5bbb7f5d Merge branch 'develop' 2021-07-13 14:49:03 +02:00
Dennis
426d39bec0 wip 2021-07-13 14:48:56 +02:00
20 changed files with 454 additions and 395 deletions

View File

@@ -45,8 +45,8 @@ class UserController extends Controller
$user->save(); $user->save();
} }
if ($package = $request->input('package')) { if ($request->input('package') && Package::find($request->input('package'))) {
$user->package_id = $package; $user->package_id = $request->input('package');
$user->save(); $user->save();
} }

View File

@@ -83,8 +83,12 @@ class PackageRequest extends FormRequest
$merge['price_monthly'] = 0.000; $merge['price_monthly'] = 0.000;
} }
if (!$this->price_yearly) {
$merge['price_yearly'] = 0.000;
}
// If we don't have the currency filled in, merge a default // If we don't have the currency filled in, merge a default
if (!$this->price_monthly) { if (!$this->price_monthly || !$this->price_yearly) {
$merge['currency'] = Package::CURRENCY_USD; $merge['currency'] = Package::CURRENCY_USD;
} }

View File

@@ -104,8 +104,8 @@ class Site extends Resource
} }
// TODO: Debugging purposes // TODO: Debugging purposes
if (!$response->getJson() || !$response->getJson()->data) { if (!$response->getJson() || !isset($response->getJson()->data)) {
info(json_encode($response->getJson())); throw new \Exception($response->getJson()->error ?? 'Unknown error has occured');
} }
// Set the id of the site // Set the id of the site

View File

@@ -15,7 +15,7 @@
"fideloper/proxy": "^4.2", "fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0", "fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.2|^7.0.1", "guzzlehttp/guzzle": "^6.2|^7.0.1",
"inertiajs/inertia-laravel": "^0.3.1", "inertiajs/inertia-laravel": "^v0.4.3",
"laravel/cashier": "^12.3", "laravel/cashier": "^12.3",
"laravel/framework": "^8.4", "laravel/framework": "^8.4",
"laravel/horizon": "^5.0", "laravel/horizon": "^5.0",
@@ -24,7 +24,7 @@
"league/glide": "^1.6", "league/glide": "^1.6",
"pragmarx/google2fa-laravel": "^1.3", "pragmarx/google2fa-laravel": "^1.3",
"predis/predis": "^1.1", "predis/predis": "^1.1",
"tightenco/ziggy": "^0.9.4" "tightenco/ziggy": "^1.3"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.3", "barryvdh/laravel-debugbar": "^3.3",

90
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "63ffd5a9b83c6ef0dd04be6c1651bc96", "content-hash": "04e74e8e51dc2b7b2decc4f1784c3154",
"packages": [ "packages": [
{ {
"name": "asm89/stack-cors", "name": "asm89/stack-cors",
@@ -1084,23 +1084,27 @@
}, },
{ {
"name": "inertiajs/inertia-laravel", "name": "inertiajs/inertia-laravel",
"version": "v0.3.6", "version": "v0.4.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/inertiajs/inertia-laravel.git", "url": "https://github.com/inertiajs/inertia-laravel.git",
"reference": "726b1e0d4fc399089dd29820a78e40d1c9aad2eb" "reference": "bfb6ddf0d3c1cc470f6d5b044631fffa48089c49"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/726b1e0d4fc399089dd29820a78e40d1c9aad2eb", "url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/bfb6ddf0d3c1cc470f6d5b044631fffa48089c49",
"reference": "726b1e0d4fc399089dd29820a78e40d1c9aad2eb", "reference": "bfb6ddf0d3c1cc470f6d5b044631fffa48089c49",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"laravel/framework": "^5.4|^6.0|^7.0|^8.0" "ext-json": "*",
"laravel/framework": "^5.4|^6.0|^7.0|^8.0",
"php": "^7.2|^8.0"
}, },
"require-dev": { "require-dev": {
"orchestra/testbench": "~3.0" "orchestra/testbench": "^4.0|^5.0|^6.0",
"phpunit/phpunit": "^8.0|^9.0",
"roave/security-advisories": "dev-master"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -1136,7 +1140,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/inertiajs/inertia-laravel/issues", "issues": "https://github.com/inertiajs/inertia-laravel/issues",
"source": "https://github.com/inertiajs/inertia-laravel/tree/v0.3.6" "source": "https://github.com/inertiajs/inertia-laravel/tree/v0.4.3"
}, },
"funding": [ "funding": [
{ {
@@ -1144,7 +1148,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-01-08T13:16:40+00:00" "time": "2021-07-12T14:09:58+00:00"
}, },
{ {
"name": "intervention/image", "name": "intervention/image",
@@ -1312,16 +1316,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v8.49.2", "version": "v8.50.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "d9b43ee080b4d51344b2e578aa667f85040471a2" "reference": "d892dbacbe3859cf9303ccda98ac8d782141d5ae"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/d9b43ee080b4d51344b2e578aa667f85040471a2", "url": "https://api.github.com/repos/laravel/framework/zipball/d892dbacbe3859cf9303ccda98ac8d782141d5ae",
"reference": "d9b43ee080b4d51344b2e578aa667f85040471a2", "reference": "d892dbacbe3859cf9303ccda98ac8d782141d5ae",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1331,7 +1335,7 @@
"ext-json": "*", "ext-json": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-openssl": "*", "ext-openssl": "*",
"league/commonmark": "^1.3", "league/commonmark": "^1.3|^2.0",
"league/flysystem": "^1.1", "league/flysystem": "^1.1",
"monolog/monolog": "^2.0", "monolog/monolog": "^2.0",
"nesbot/carbon": "^2.31", "nesbot/carbon": "^2.31",
@@ -1476,7 +1480,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2021-07-06T14:06:38+00:00" "time": "2021-07-13T12:41:53+00:00"
}, },
{ {
"name": "laravel/horizon", "name": "laravel/horizon",
@@ -3567,16 +3571,16 @@
}, },
{ {
"name": "stripe/stripe-php", "name": "stripe/stripe-php",
"version": "v7.87.0", "version": "v7.88.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/stripe/stripe-php.git", "url": "https://github.com/stripe/stripe-php.git",
"reference": "9392f03cb8d8803bf8273378ce42d5cbbf1e24fc" "reference": "7203d00ba9b09830c0c5d5c06a9558db43b8e0ea"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/9392f03cb8d8803bf8273378ce42d5cbbf1e24fc", "url": "https://api.github.com/repos/stripe/stripe-php/zipball/7203d00ba9b09830c0c5d5c06a9558db43b8e0ea",
"reference": "9392f03cb8d8803bf8273378ce42d5cbbf1e24fc", "reference": "7203d00ba9b09830c0c5d5c06a9558db43b8e0ea",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3622,9 +3626,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/stripe/stripe-php/issues", "issues": "https://github.com/stripe/stripe-php/issues",
"source": "https://github.com/stripe/stripe-php/tree/v7.87.0" "source": "https://github.com/stripe/stripe-php/tree/v7.88.0"
}, },
"time": "2021-06-30T18:22:47+00:00" "time": "2021-07-09T20:01:03+00:00"
}, },
{ {
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
@@ -5964,23 +5968,24 @@
}, },
{ {
"name": "tightenco/ziggy", "name": "tightenco/ziggy",
"version": "0.9.4", "version": "v1.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/tighten/ziggy.git", "url": "https://github.com/tighten/ziggy.git",
"reference": "82ea6ec6cb6ab3545b0245310b2a424316fe48d8" "reference": "01bf2a967a4a00d493dd578426a91c6e623b37f4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/tighten/ziggy/zipball/82ea6ec6cb6ab3545b0245310b2a424316fe48d8", "url": "https://api.github.com/repos/tighten/ziggy/zipball/01bf2a967a4a00d493dd578426a91c6e623b37f4",
"reference": "82ea6ec6cb6ab3545b0245310b2a424316fe48d8", "reference": "01bf2a967a4a00d493dd578426a91c6e623b37f4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"laravel/framework": ">=5.4@dev" "laravel/framework": ">=5.4@dev"
}, },
"require-dev": { "require-dev": {
"orchestra/testbench": "^5.0" "orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -6007,10 +6012,14 @@
{ {
"name": "Jake Bathman", "name": "Jake Bathman",
"email": "jake@tighten.co" "email": "jake@tighten.co"
},
{
"name": "Jacob Baker-Kretzmar",
"email": "jacob@tighten.co"
} }
], ],
"description": "Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.", "description": "Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.",
"homepage": "https://github.com/tightenco/ziggy", "homepage": "https://github.com/tighten/ziggy",
"keywords": [ "keywords": [
"Ziggy", "Ziggy",
"javascript", "javascript",
@@ -6019,9 +6028,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/tighten/ziggy/issues", "issues": "https://github.com/tighten/ziggy/issues",
"source": "https://github.com/tighten/ziggy/tree/0.9.4" "source": "https://github.com/tighten/ziggy/tree/v1.3.4"
}, },
"time": "2020-06-05T14:42:41+00:00" "time": "2021-07-06T21:58:30+00:00"
}, },
{ {
"name": "tijsverkoyen/css-to-inline-styles", "name": "tijsverkoyen/css-to-inline-styles",
@@ -6728,16 +6737,16 @@
}, },
{ {
"name": "facade/ignition", "name": "facade/ignition",
"version": "2.10.2", "version": "2.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/facade/ignition.git", "url": "https://github.com/facade/ignition.git",
"reference": "43688227bbf27c43bc1ad83af224f135b6ef0ff4" "reference": "dc6818335f50ccf0b90284784718ea9a82604286"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/facade/ignition/zipball/43688227bbf27c43bc1ad83af224f135b6ef0ff4", "url": "https://api.github.com/repos/facade/ignition/zipball/dc6818335f50ccf0b90284784718ea9a82604286",
"reference": "43688227bbf27c43bc1ad83af224f135b6ef0ff4", "reference": "dc6818335f50ccf0b90284784718ea9a82604286",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -6745,7 +6754,6 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"facade/flare-client-php": "^1.6", "facade/flare-client-php": "^1.6",
"facade/ignition-contracts": "^1.0.2", "facade/ignition-contracts": "^1.0.2",
"filp/whoops": "^2.4",
"illuminate/support": "^7.0|^8.0", "illuminate/support": "^7.0|^8.0",
"monolog/monolog": "^2.0", "monolog/monolog": "^2.0",
"php": "^7.2.5|^8.0", "php": "^7.2.5|^8.0",
@@ -6801,7 +6809,7 @@
"issues": "https://github.com/facade/ignition/issues", "issues": "https://github.com/facade/ignition/issues",
"source": "https://github.com/facade/ignition" "source": "https://github.com/facade/ignition"
}, },
"time": "2021-06-11T06:57:25+00:00" "time": "2021-07-12T15:55:51+00:00"
}, },
{ {
"name": "facade/ignition-contracts", "name": "facade/ignition-contracts",
@@ -6858,16 +6866,16 @@
}, },
{ {
"name": "filp/whoops", "name": "filp/whoops",
"version": "2.13.0", "version": "2.14.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/filp/whoops.git", "url": "https://github.com/filp/whoops.git",
"reference": "2edbc73a4687d9085c8f20f398eebade844e8424" "reference": "fdf92f03e150ed84d5967a833ae93abffac0315b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/2edbc73a4687d9085c8f20f398eebade844e8424", "url": "https://api.github.com/repos/filp/whoops/zipball/fdf92f03e150ed84d5967a833ae93abffac0315b",
"reference": "2edbc73a4687d9085c8f20f398eebade844e8424", "reference": "fdf92f03e150ed84d5967a833ae93abffac0315b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -6917,7 +6925,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/filp/whoops/issues", "issues": "https://github.com/filp/whoops/issues",
"source": "https://github.com/filp/whoops/tree/2.13.0" "source": "https://github.com/filp/whoops/tree/2.14.0"
}, },
"funding": [ "funding": [
{ {
@@ -6925,7 +6933,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-06-04T12:00:00+00:00" "time": "2021-07-13T12:00:00+00:00"
}, },
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",

1
public/js/2158.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/2254.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/2787.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/3469.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/4950.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/6624.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/6655.js vendored Normal file

File diff suppressed because one or more lines are too long

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -13,26 +13,38 @@
<PageBody> <PageBody>
<SettingsLayout> <SettingsLayout>
<template #nav> <template #nav>
<Tabs /> <Tabs/>
</template> </template>
<template #segments> <template #segments>
<SettingsSegment> <SettingsSegment>
<template #title>{{ __('Create') }}</template> <template #title>{{ __('Create') }}</template>
<template #subtitle> <template #subtitle>
{{ __('Create a new package here to attach to your users. You can create as many packages as you want, the advantage is that you are able to provide custom packages for your users.') }} {{
__('Create a new package here to attach to your users. You can create as many packages as you want, the advantage is that you are able to provide custom packages for your users.')
}}
</template> </template>
<template #form> <template #form>
<form class="space-y-4" @submit.prevent="submit"> <form class="space-y-4" @submit.prevent="submit">
<FormInput :label="__('Name')" :errors="$page.props.errors.name" v-model="form.name" /> <FormInput :label="__('Name')" :errors="$page.props.errors.name"
<FormInput :label="__('Maximum sites')" type="number" min="0" :errors="$page.props.errors.maximum_sites" v-model="form.maximum_sites" /> v-model="form.name"/>
<FormInput :label="__('Maximum servers')" type="number" min="0" :errors="$page.props.errors.maximum_servers" v-model="form.maximum_servers" /> <FormInput :label="__('Maximum sites')" type="number" min="0"
<FormInput :label="__('Plan ID')" :errors="$page.props.errors.plan_id" v-model="form.plan_id" /> :errors="$page.props.errors.maximum_sites"
v-model="form.maximum_sites"/>
<FormInput :label="__('Maximum servers')" type="number" min="0"
:errors="$page.props.errors.maximum_servers"
v-model="form.maximum_servers"/>
<FormInput :label="__('Plan ID')" :errors="$page.props.errors.plan_id"
v-model="form.plan_id"/>
<FormInput v-if="form.plan_id" :label="__('Monthly price')" <FormInput v-if="form.plan_id" :label="__('Monthly price')"
helper-text="Fill this in if you want it to be monthly payments" helper-text="Fill this in if you want it to be monthly payments"
:errors="$page.props.errors.price_monthly" v-model="form.price_monthly"/> :errors="$page.props.errors.price_monthly"
v-model="form.price_monthly"/>
<FormInput v-if="form.plan_id" :label="__('Yearly price')" <FormInput v-if="form.plan_id" :label="__('Yearly price')"
helper-text="Fill this in if you want it to be yearly payments" helper-text="Fill this in if you want it to be yearly payments"
:errors="$page.props.errors.price_yearly" v-model="form.price_yearly"/> <FormSelect :errors="$page.props.errors.currency" v-if="form.plan_id" :label="__('Currency')" v-model="form.currency"> :errors="$page.props.errors.price_yearly"
v-model="form.price_yearly"/>
<FormSelect :errors="$page.props.errors.currency" v-if="form.plan_id"
:label="__('Currency')" v-model="form.currency">
<option value="usd">{{ __('USD $') }}</option> <option value="usd">{{ __('USD $') }}</option>
<option value="eur">{{ __('Euro €') }}</option> <option value="eur">{{ __('Euro €') }}</option>
<option value="gbp">{{ __('GBP £') }}</option> <option value="gbp">{{ __('GBP £') }}</option>
@@ -44,12 +56,14 @@
</FormSelect> </FormSelect>
<div class="space-y-4"> <div class="space-y-4">
<h3 class="text-base leading-6 font-medium border-b border-dotted border-medium-emphasis pb-1">{{ __('Server permissions') }}</h3> <h3 class="text-base leading-6 font-medium border-b border-dotted border-medium-emphasis pb-1">
{{ __('Server permissions') }}</h3>
<div> <div>
<input id="server_create" class="form-checkbox" type="checkbox" <input id="server_create" class="form-checkbox" type="checkbox"
v-model="form.server_permissions['create']"> v-model="form.server_permissions['create']">
<label for="server_create" class="ml-2 text-sm">{{ __('Allow server creation') }}</label> <label for="server_create"
class="ml-2 text-sm">{{ __('Allow server creation') }}</label>
<p class="text-small mt-1 text-medium-emphasis"> <p class="text-small mt-1 text-medium-emphasis">
{{ __('This will allow users to create servers') }} {{ __('This will allow users to create servers') }}
</p> </p>
@@ -57,7 +71,8 @@
<div> <div>
<input id="server_update" class="form-checkbox" type="checkbox" <input id="server_update" class="form-checkbox" type="checkbox"
v-model="form.server_permissions['update']"> v-model="form.server_permissions['update']">
<label for="server_update" class="ml-2 text-sm">{{ __('Allow server updating') }}</label> <label for="server_update"
class="ml-2 text-sm">{{ __('Allow server updating') }}</label>
<p class="text-small mt-1 text-medium-emphasis"> <p class="text-small mt-1 text-medium-emphasis">
{{ __('This will allow users to update servers') }} {{ __('This will allow users to update servers') }}
</p> </p>
@@ -65,7 +80,8 @@
<div> <div>
<input id="server_delete" class="form-checkbox" type="checkbox" <input id="server_delete" class="form-checkbox" type="checkbox"
v-model="form.server_permissions['delete']"> v-model="form.server_permissions['delete']">
<label for="server_delete" class="ml-2 text-sm">{{ __('Allow server deletion') }}</label> <label for="server_delete"
class="ml-2 text-sm">{{ __('Allow server deletion') }}</label>
<p class="text-small mt-1 text-medium-emphasis"> <p class="text-small mt-1 text-medium-emphasis">
{{ __('This will allow users to delete servers') }} {{ __('This will allow users to delete servers') }}
</p> </p>
@@ -73,12 +89,14 @@
</div> </div>
<div class="space-y-2"> <div class="space-y-2">
<h3 class="text-base leading-6 font-medium border-b border-dotted border-medium-emphasis pb-1">{{ __('Site permissions') }}</h3> <h3 class="text-base leading-6 font-medium border-b border-dotted border-medium-emphasis pb-1">
{{ __('Site permissions') }}</h3>
<div> <div>
<input id="site_create" class="form-checkbox" type="checkbox" <input id="site_create" class="form-checkbox" type="checkbox"
v-model="form.site_permissions['create']"> v-model="form.site_permissions['create']">
<label for="site_create" class="ml-2 text-sm">{{ __('Allow site creation') }}</label> <label for="site_create"
class="ml-2 text-sm">{{ __('Allow site creation') }}</label>
<p class="text-small mt-1 text-medium-emphasis"> <p class="text-small mt-1 text-medium-emphasis">
{{ __('This will allow users to create sites') }} {{ __('This will allow users to create sites') }}
</p> </p>
@@ -86,7 +104,8 @@
<div> <div>
<input id="site_update" class="form-checkbox" type="checkbox" <input id="site_update" class="form-checkbox" type="checkbox"
v-model="form.site_permissions['update']"> v-model="form.site_permissions['update']">
<label for="site_update" class="ml-2 text-sm">{{ __('Allow site updating') }}</label> <label for="site_update"
class="ml-2 text-sm">{{ __('Allow site updating') }}</label>
<p class="text-small mt-1 text-medium-emphasis"> <p class="text-small mt-1 text-medium-emphasis">
{{ __('This will allow users to update sites') }} {{ __('This will allow users to update sites') }}
</p> </p>
@@ -94,7 +113,8 @@
<div> <div>
<input id="site_delete" class="form-checkbox" type="checkbox" <input id="site_delete" class="form-checkbox" type="checkbox"
v-model="form.site_permissions['delete']"> v-model="form.site_permissions['delete']">
<label for="site_delete" class="ml-2 text-sm">{{ __('Allow site deletion') }}</label> <label for="site_delete"
class="ml-2 text-sm">{{ __('Allow site deletion') }}</label>
<p class="text-small mt-1 text-medium-emphasis"> <p class="text-small mt-1 text-medium-emphasis">
{{ __('This will allow users to delete sites') }} {{ __('This will allow users to delete sites') }}
</p> </p>
@@ -102,10 +122,12 @@
</div> </div>
<div class="space-y-2"> <div class="space-y-2">
<h3 class="text-base leading-6 font-medium border-b border-dotted border-medium-emphasis pb-1">{{ __('Available server providers') }}</h3> <h3 class="text-base leading-6 font-medium border-b border-dotted border-medium-emphasis pb-1">
{{ __('Available server providers') }}</h3>
<div v-for="(name, id) in providers"> <div v-for="(name, id) in providers">
<input :id="`provider-${id}`" :value="id" v-model="form.providers" class="form-checkbox" type="checkbox"> <input :id="`provider-${id}`" :value="id" v-model="form.providers"
class="form-checkbox" type="checkbox">
<label :for="`provider-${id}`" class="ml-2 text-sm">{{ name }}</label> <label :for="`provider-${id}`" class="ml-2 text-sm">{{ name }}</label>
</div> </div>
</div> </div>
@@ -125,96 +147,96 @@
</template> </template>
<script> <script>
import TopBar from './../components/TopBar' import TopBar from './../components/TopBar'
import Container from '@/components/Container' import Container from '@/components/Container'
import Content from '@/components/Content' import Content from '@/components/Content'
import Page from '@/components/Page' import Page from '@/components/Page'
import PageHeader from '@/components/PageHeader' import PageHeader from '@/components/PageHeader'
import PageHeaderTitle from '@/components/PageHeaderTitle' import PageHeaderTitle from '@/components/PageHeaderTitle'
import PageBody from '@/components/PageBody' import PageBody from '@/components/PageBody'
import Button from '@/components/Button' import Button from '@/components/Button'
import List from '@/components/List' import List from '@/components/List'
import ListItem from '@/components/ListItem' import ListItem from '@/components/ListItem'
import StatusBubble from '@/components/StatusBubble' import StatusBubble from '@/components/StatusBubble'
import NotificationBadge from '@/components/NotificationBadge' import NotificationBadge from '@/components/NotificationBadge'
import MainLayout from '@/Layouts/MainLayout' import MainLayout from '@/Layouts/MainLayout'
import SettingsLayout from '@/components/layouts/SettingsLayout' import SettingsLayout from '@/components/layouts/SettingsLayout'
import SettingsSegment from '@/components/SettingsSegment' import SettingsSegment from '@/components/SettingsSegment'
import FormInput from '@/components/forms/FormInput' import FormInput from '@/components/forms/FormInput'
import FormSelect from '@/components/forms/FormSelect' import FormSelect from '@/components/forms/FormSelect'
import Form from '@/components/Form' import Form from '@/components/Form'
import FormActions from '@/components/FormActions' import FormActions from '@/components/FormActions'
import Tabs from './Tabs' import Tabs from './Tabs'
export default { export default {
metaInfo() { metaInfo() {
return { return {
title: `${this.__('Create package')}`, title: `${this.__('Create package')}`,
} }
}, },
layout: MainLayout, layout: MainLayout,
components: { components: {
TopBar, TopBar,
Container, Container,
Content, Content,
Page, Page,
PageHeader, PageHeader,
PageHeaderTitle, PageHeaderTitle,
PageBody, PageBody,
Button, Button,
List, List,
ListItem, ListItem,
StatusBubble, StatusBubble,
NotificationBadge, NotificationBadge,
FormInput, FormInput,
FormSelect, FormSelect,
SettingsLayout, SettingsLayout,
SettingsSegment, SettingsSegment,
Form, Form,
FormActions, FormActions,
Tabs, Tabs,
}, },
props: { props: {
providers: Object providers: [Array, Object]
}, },
data() { data() {
return { return {
sending: false, sending: false,
form: { form: {
name: null, name: null,
plan_id: null, plan_id: null,
currency: 'usd', currency: 'usd',
maximum_sites: 10, maximum_sites: 10,
maximum_servers: 1, maximum_servers: 1,
server_permissions: { server_permissions: {
create: false, create: false,
update: false, update: false,
delete: false, delete: false,
},
site_permissions: {
create: false,
update: false,
delete: false
},
price_monthly: null,
price_yearly: null,
providers: []
}, },
} site_permissions: {
}, create: false,
update: false,
delete: false
},
price_monthly: null,
price_yearly: null,
providers: []
},
}
},
methods: { methods: {
submit() { submit() {
this.sending = true this.$inertia.post(this.route('admin.packages.store'), this.form, {
onStart: () => this.sending = true,
this.$inertia.post(this.route('admin.packages.store'), this.form) onFinish: () => this.sending = false
.then(() => this.sending = false) })
}
} }
} }
}
</script> </script>

View File

@@ -118,7 +118,7 @@
useNotification, useNotification,
syncProvider (provider){ syncProvider (provider){
window.axios.post(this.route('admin.services.providers.sync', provider.id).url()) window.axios.post(this.route('admin.services.providers.sync', provider.id))
.then(() => { .then(() => {
useNotification({ useNotification({
variant: 'success', variant: 'success',

View File

@@ -13,19 +13,25 @@
<PageBody> <PageBody>
<SettingsLayout> <SettingsLayout>
<template #nav> <template #nav>
<Tabs /> <Tabs/>
</template> </template>
<template #segments> <template #segments>
<SettingsSegment> <SettingsSegment>
<template #title>{{ __('Edit') }}</template> <template #title>{{ __('Edit') }}</template>
<template #form> <template #form>
<form class="space-y-4" @submit.prevent="submit"> <form class="space-y-4" @submit.prevent="submit">
<FormInput :label="__('Name')" :errors="$page.props.errors.name" v-model="form.name" /> <FormInput :label="__('Name')" :errors="$page.props.errors.name"
<FormInput :label="__('IP address')" :errors="$page.props.errors.ip" v-model="form.ip" /> v-model="form.name"/>
<FormInput :label="__('Maximum sites')" :errors="$page.props.errors.maximum_sites" v-model="form.maximum_sites" /> <FormInput :label="__('IP address')" :errors="$page.props.errors.ip"
v-model="form.ip"/>
<FormInput :label="__('Maximum sites')"
:errors="$page.props.errors.maximum_sites"
v-model="form.maximum_sites"/>
<FormActions> <FormActions>
<Button>{{ __('Save changes') }}</Button> <Button>{{ __('Save changes') }}</Button>
<Button variant="danger" type="button" @click="confirmDelete">{{ __('Delete') }}</Button> <Button variant="danger" type="button" @click="confirmDelete">
{{ __('Delete') }}
</Button>
</FormActions> </FormActions>
</form> </form>
</template> </template>
@@ -35,7 +41,8 @@
<template #title>{{ __('Attached users') }}</template> <template #title>{{ __('Attached users') }}</template>
<template #form> <template #form>
<form class="space-y-4" @submit.prevent="attach"> <form class="space-y-4" @submit.prevent="attach">
<FormInput :label="__('Email')" :errors="$page.props.errors.email" v-model="formAttach.email"/> <FormInput :label="__('Email')" :errors="$page.props.errors.email"
v-model="formAttach.email"/>
<FormActions> <FormActions>
<Button>{{ __('Save changes') }}</Button> <Button>{{ __('Save changes') }}</Button>
</FormActions> </FormActions>
@@ -76,138 +83,138 @@
</template> </template>
<script> <script>
import TopBar from './../../components/TopBar' import TopBar from './../../components/TopBar'
import Container from '@/components/Container' import Container from '@/components/Container'
import Content from '@/components/Content' import Content from '@/components/Content'
import Page from '@/components/Page' import Page from '@/components/Page'
import PageHeader from '@/components/PageHeader' import PageHeader from '@/components/PageHeader'
import PageHeaderTitle from '@/components/PageHeaderTitle' import PageHeaderTitle from '@/components/PageHeaderTitle'
import PageBody from '@/components/PageBody' import PageBody from '@/components/PageBody'
import Button from '@/components/Button' import Button from '@/components/Button'
import List from '@/components/List' import List from '@/components/List'
import ListItem from '@/components/ListItem' import ListItem from '@/components/ListItem'
import StatusBubble from '@/components/StatusBubble' import StatusBubble from '@/components/StatusBubble'
import NotificationBadge from '@/components/NotificationBadge' import NotificationBadge from '@/components/NotificationBadge'
import MainLayout from '@/Layouts/MainLayout' import MainLayout from '@/Layouts/MainLayout'
import SettingsLayout from '@/components/layouts/SettingsLayout' import SettingsLayout from '@/components/layouts/SettingsLayout'
import SettingsSegment from '@/components/SettingsSegment' import SettingsSegment from '@/components/SettingsSegment'
import FormInput from '@/components/forms/FormInput' import FormInput from '@/components/forms/FormInput'
import FormTextarea from '@/components/forms/FormTextarea' import FormTextarea from '@/components/forms/FormTextarea'
import FormSelect from '@/components/forms/FormSelect' import FormSelect from '@/components/forms/FormSelect'
import Form from '@/components/Form' import Form from '@/components/Form'
import FormActions from '@/components/FormActions' import FormActions from '@/components/FormActions'
import { useConfirmDelete } from '@/hooks/confirm-delete' import {useConfirmDelete} from '@/hooks/confirm-delete'
import Tabs from './../Tabs' import Tabs from './../Tabs'
import Table from '@/components/Table' import Table from '@/components/Table'
import TableHead from '@/components/TableHead' import TableHead from '@/components/TableHead'
import TableHeader from '@/components/TableHeader' import TableHeader from '@/components/TableHeader'
import TableRow from '@/components/TableRow' import TableRow from '@/components/TableRow'
import TableBody from '@/components/TableBody' import TableBody from '@/components/TableBody'
import TableData from '@/components/TableData' import TableData from '@/components/TableData'
export default { export default {
layout: MainLayout, layout: MainLayout,
components: { components: {
TopBar, TopBar,
Container, Container,
Content, Content,
Page, Page,
PageHeader, PageHeader,
PageHeaderTitle, PageHeaderTitle,
PageBody, PageBody,
Button, Button,
List, List,
ListItem, ListItem,
StatusBubble, StatusBubble,
NotificationBadge, NotificationBadge,
FormInput, FormInput,
FormSelect, FormSelect,
SettingsLayout, SettingsLayout,
SettingsSegment, SettingsSegment,
Form, Form,
FormActions, FormActions,
Tabs, Tabs,
FormTextarea, FormTextarea,
Table, Table,
TableHead, TableHead,
TableHeader, TableHeader,
TableRow, TableRow,
TableBody, TableBody,
TableData, TableData,
}, },
data() { data() {
return { return {
sending: false, sending: false,
form: { form: {
name: this.server.name, name: this.server.name,
ip: this.server.ip, ip: this.server.ip,
maximum_sites: this.server.maximum_sites, maximum_sites: this.server.maximum_sites,
},
formAttach: {
email: null
}
}
},
props: {
server: Object,
users: [Object, Array]
},
methods: {
submit() {
this.sending = true
this.$inertia.patch(this.route('admin.services.servers.update', this.server.id), this.form)
.then(() => this.sending = false)
}, },
confirmDelete() { formAttach: {
useConfirmDelete({ email: null
title: this.__('Are you sure?'),
message: this.__('Are you sure you want to delete this server? Everything associated with this server will be detached.'),
onConfirm: () => this.delete(),
})
},
delete() {
this.sending = true
this.$inertia.delete(this.route('admin.services.servers.delete', this.server.id))
.then(() => this.sending = false)
},
attach() {
this.sending = true
this.$inertia.post(this.route('admin.services.servers.attach', this.server.id), this.formAttach)
.then(() => {
this.sending = false
if (!Object.keys(this.$page.props.errors).length) {
this.formAttach.email = null;
}
})
},
confirmDetach(userId) {
useConfirmDelete({
title: this.__('Are you sure?'),
message: this.__('Are you sure you want to detach this user from this server?'),
onConfirm: () => this.detach(userId),
})
},
detach(userId) {
this.sending = true
this.$inertia.delete(this.route('admin.services.servers.detach', [this.server.id, userId]))
.then(() => this.sending = false)
} }
} }
},
props: {
server: Object,
users: [Object, Array]
},
methods: {
submit() {
this.$inertia.patch(this.route('admin.services.servers.update', this.server.id), this.form, {
onStart: () => this.sending = true,
onFinish: () => this.sending = false
})
},
confirmDelete() {
useConfirmDelete({
title: this.__('Are you sure?'),
message: this.__('Are you sure you want to delete this server? Everything associated with this server will be detached.'),
onConfirm: () => this.delete(),
})
},
delete() {
this.$inertia.delete(this.route('admin.services.servers.delete', this.server.id), {
onStart: () => this.sending = true,
onFinish: () => this.sending = false
})
},
attach() {
this.$inertia.post(this.route('admin.services.servers.attach', this.server.id), this.formAttach, {
onStart: () => this.sending = true,
onFinish: () => {
this.sending = false
if (!Object.keys(this.$page.props.errors).length) {
this.formAttach.email = null;
}
}
})
},
confirmDetach(userId) {
useConfirmDelete({
title: this.__('Are you sure?'),
message: this.__('Are you sure you want to detach this user from this server?'),
onConfirm: () => this.detach(userId),
})
},
detach(userId) {
this.$inertia.delete(this.route('admin.services.servers.detach', [this.server.id, userId]), {
onStart: () => this.sending = true,
onFinish: () => this.sending = false
})
}
} }
}
</script> </script>

View File

@@ -118,7 +118,7 @@
useNotification, useNotification,
syncServer (server){ syncServer (server){
window.axios.post(this.route('admin.services.servers.sync').url(), server) window.axios.post(this.route('admin.services.servers.sync'), server)
.then(() => { .then(() => {
useNotification({ useNotification({
variant: 'success', variant: 'success',

View File

@@ -127,23 +127,23 @@
reply() { reply() {
this.loading = true; this.loading = true;
this.$inertia.post(this.route('admin.support.reply', this.ticket.id), this.form) this.$inertia.post(this.route('admin.support.reply', this.ticket.id), this.form, {
.then(response => { onStart: () => this.sending = true,
onFinish: () => {
this.loading = false; this.loading = false;
if (!Object.keys(this.$page.props.errors).length) { if (!Object.keys(this.$page.props.errors).length) {
this.form.content = null; this.form.content = null;
} }
}) }
});
}, },
close() { close() {
this.loading = true; this.$inertia.post(this.route('admin.support.close', this.ticket.id), {
onStart: () => this.loading = true,
this.$inertia.post(this.route('admin.support.close', this.ticket.id)) onFinish: () => this.loading = false
.then(response => { })
this.loading = false;
})
} }
}, },
} }

View File

@@ -142,10 +142,10 @@
methods: { methods: {
submit() { submit() {
this.sending = true this.$inertia.post(this.route('admin.users.store'), this.form, {
onStart: () => this.sending = true,
this.$inertia.post(this.route('admin.users.store'), this.form) onFinish: () => this.sending = false
.then(() => this.sending = false) })
} }
} }
} }

View File

@@ -13,16 +13,19 @@
<PageBody> <PageBody>
<SettingsLayout> <SettingsLayout>
<template #nav> <template #nav>
<Tabs /> <Tabs/>
</template> </template>
<template #segments> <template #segments>
<SettingsSegment> <SettingsSegment>
<template #title>{{ __('Edit') }}</template> <template #title>{{ __('Edit') }}</template>
<template #form> <template #form>
<form class="space-y-4" @submit.prevent="submit"> <form class="space-y-4" @submit.prevent="submit">
<FormInput :label="__('Name')" :errors="$page.props.errors.name" v-model="form.name" /> <FormInput :label="__('Name')" :errors="$page.props.errors.name"
<FormInput :label="__('Email')" :errors="$page.props.errors.email" type="email" v-model="form.email" /> v-model="form.name"/>
<FormTextarea :label="__('Notes')" :errors="$page.props.errors.notes" v-model="form.notes" /> <FormInput :label="__('Email')" :errors="$page.props.errors.email" type="email"
v-model="form.email"/>
<FormTextarea :label="__('Notes')" :errors="$page.props.errors.notes"
v-model="form.notes"/>
<FormSelect :label="__('Role')" v-model="form.role"> <FormSelect :label="__('Role')" v-model="form.role">
<option value="user">User</option> <option value="user">User</option>
<option value="admin">Administrator</option> <option value="admin">Administrator</option>
@@ -32,22 +35,30 @@
<option v-for="(name, id) in packages" :value="id" v-text="name"></option> <option v-for="(name, id) in packages" :value="id" v-text="name"></option>
</FormSelect> </FormSelect>
<FormSelect :label="__('Language')" v-model="form.language"> <FormSelect :label="__('Language')" v-model="form.language">
<option v-for="language in languages" :value="language" v-text="language"></option> <option v-for="language in languages" :value="language"
v-text="language"></option>
</FormSelect> </FormSelect>
<FormTextarea :label="__('Blocked')" :errors="$page.props.errors.blocked" rows="2" v-model="form.blocked" /> <FormTextarea :label="__('Blocked')" :errors="$page.props.errors.blocked"
rows="2" v-model="form.blocked"/>
<div> <div>
<input id="isolate_per_site_per_user" class="form-checkbox" type="checkbox" <input id="isolate_per_site_per_user" class="form-checkbox" type="checkbox"
v-model="form.requires_password_for_ftp"> v-model="form.requires_password_for_ftp">
<label for="isolate_per_site_per_user" class="ml-2 text-sm">{{ __('Require password to show FTP password') }}</label> <label for="isolate_per_site_per_user" class="ml-2 text-sm">{{
__('Require password to show FTP password')
}}</label>
<p class="text-small mt-1 text-medium-emphasis"> <p class="text-small mt-1 text-medium-emphasis">
{{ __('Disabling this will allow this user to get the FTP password right away.') }} {{
__('Disabling this will allow this user to get the FTP password right away.')
}}
</p> </p>
</div> </div>
<FormActions> <FormActions>
<Button>{{ __('Save changes') }}</Button> <Button>{{ __('Save changes') }}</Button>
<Button variant="danger" type="button" @click="confirmDelete">{{ __('Delete') }}</Button> <Button variant="danger" type="button" @click="confirmDelete">
{{ __('Delete') }}
</Button>
</FormActions> </FormActions>
</form> </form>
</template> </template>
@@ -61,106 +72,106 @@
</template> </template>
<script> <script>
import TopBar from './../components/TopBar' import TopBar from './../components/TopBar'
import Container from '@/components/Container' import Container from '@/components/Container'
import Content from '@/components/Content' import Content from '@/components/Content'
import Page from '@/components/Page' import Page from '@/components/Page'
import PageHeader from '@/components/PageHeader' import PageHeader from '@/components/PageHeader'
import PageHeaderTitle from '@/components/PageHeaderTitle' import PageHeaderTitle from '@/components/PageHeaderTitle'
import PageBody from '@/components/PageBody' import PageBody from '@/components/PageBody'
import Button from '@/components/Button' import Button from '@/components/Button'
import List from '@/components/List' import List from '@/components/List'
import ListItem from '@/components/ListItem' import ListItem from '@/components/ListItem'
import StatusBubble from '@/components/StatusBubble' import StatusBubble from '@/components/StatusBubble'
import NotificationBadge from '@/components/NotificationBadge' import NotificationBadge from '@/components/NotificationBadge'
import MainLayout from '@/Layouts/MainLayout' import MainLayout from '@/Layouts/MainLayout'
import SettingsLayout from '@/components/layouts/SettingsLayout' import SettingsLayout from '@/components/layouts/SettingsLayout'
import SettingsSegment from '@/components/SettingsSegment' import SettingsSegment from '@/components/SettingsSegment'
import FormInput from '@/components/forms/FormInput' import FormInput from '@/components/forms/FormInput'
import FormTextarea from '@/components/forms/FormTextarea' import FormTextarea from '@/components/forms/FormTextarea'
import FormSelect from '@/components/forms/FormSelect' import FormSelect from '@/components/forms/FormSelect'
import Form from '@/components/Form' import Form from '@/components/Form'
import FormActions from '@/components/FormActions' import FormActions from '@/components/FormActions'
import { useConfirmDelete } from '@/hooks/confirm-delete' import {useConfirmDelete} from '@/hooks/confirm-delete'
import Tabs from './Tabs' import Tabs from './Tabs'
export default { export default {
metaInfo() { metaInfo() {
return { return {
title: `${this.__('Edit user')}`, title: `${this.__('Edit user')}`,
} }
}, },
layout: MainLayout, layout: MainLayout,
components: { components: {
TopBar, TopBar,
Container, Container,
Content, Content,
Page, Page,
PageHeader, PageHeader,
PageHeaderTitle, PageHeaderTitle,
PageBody, PageBody,
Button, Button,
List, List,
ListItem, ListItem,
StatusBubble, StatusBubble,
NotificationBadge, NotificationBadge,
FormInput, FormInput,
FormSelect, FormSelect,
SettingsLayout, SettingsLayout,
SettingsSegment, SettingsSegment,
Form, Form,
FormActions, FormActions,
Tabs, Tabs,
FormTextarea FormTextarea
}, },
data() { data() {
return { return {
sending: false, sending: false,
form: { form: {
name: this.user.name, name: this.user.name,
email: this.user.email, email: this.user.email,
role: this.user.role, role: this.user.role,
package: this.user.package_id, package: this.user.package_id,
notes: this.user.notes, notes: this.user.notes,
language: this.user.language, language: this.user.language,
blocked: this.user.blocked, blocked: this.user.blocked,
requires_password_for_ftp: this.user.requires_password_for_ftp, requires_password_for_ftp: this.user.requires_password_for_ftp,
},
}
},
props: {
user: Object,
packages: Object,
languages: Array,
},
methods: {
submit() {
this.sending = true
this.$inertia.patch(this.route('admin.users.update', this.user.id), this.form)
.then(() => this.sending = false)
}, },
}
},
confirmDelete() { props: {
useConfirmDelete({ user: Object,
title: this.__('Are you sure?'), packages: Object,
message: `Are you sure you want to delete this user? Everything associated with this user will be detached.`, languages: Array,
onConfirm: () => this.delete(), },
})
},
delete() { methods: {
this.sending = true submit() {
this.$inertia.patch(this.route('admin.users.update', this.user.id), this.form, {
onStart: () => this.sending = true,
onFinish: () => this.sending = false
})
},
this.$inertia.delete(this.route('admin.users.destroy', this.user.id)) confirmDelete() {
.then(() => this.sending = false) useConfirmDelete({
} title: this.__('Are you sure?'),
message: `Are you sure you want to delete this user? Everything associated with this user will be detached.`,
onConfirm: () => this.delete(),
})
},
delete() {
this.sending = true
this.$inertia.delete(this.route('admin.users.destroy', this.user.id))
.then(() => this.sending = false)
} }
} }
}
</script> </script>