Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59c65fe6ee | ||
|
|
087c042c14 | ||
|
|
d1ee488ffd | ||
|
|
34100bc580 | ||
|
|
22d91517fb | ||
|
|
1c088bd4e0 |
@@ -45,8 +45,8 @@ class UserController extends Controller
|
||||
$user->save();
|
||||
}
|
||||
|
||||
if ($package = $request->input('package')) {
|
||||
$user->package_id = $package;
|
||||
if ($request->input('package') && Package::find($request->input('package'))) {
|
||||
$user->package_id = $request->input('package');
|
||||
$user->save();
|
||||
}
|
||||
|
||||
|
||||
@@ -83,8 +83,12 @@ class PackageRequest extends FormRequest
|
||||
$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 (!$this->price_monthly) {
|
||||
if (!$this->price_monthly || !$this->price_yearly) {
|
||||
$merge['currency'] = Package::CURRENCY_USD;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class Site extends Resource
|
||||
|
||||
// TODO: Debugging purposes
|
||||
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
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"fideloper/proxy": "^4.2",
|
||||
"fruitcake/laravel-cors": "^1.0",
|
||||
"guzzlehttp/guzzle": "^6.2|^7.0.1",
|
||||
"inertiajs/inertia-laravel": "^0.3.1",
|
||||
"inertiajs/inertia-laravel": "^v0.4.3",
|
||||
"laravel/cashier": "^12.3",
|
||||
"laravel/framework": "^8.4",
|
||||
"laravel/horizon": "^5.0",
|
||||
@@ -24,7 +24,7 @@
|
||||
"league/glide": "^1.6",
|
||||
"pragmarx/google2fa-laravel": "^1.3",
|
||||
"predis/predis": "^1.1",
|
||||
"tightenco/ziggy": "^0.9.4"
|
||||
"tightenco/ziggy": "^1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.3",
|
||||
|
||||
90
composer.lock
generated
90
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "63ffd5a9b83c6ef0dd04be6c1651bc96",
|
||||
"content-hash": "04e74e8e51dc2b7b2decc4f1784c3154",
|
||||
"packages": [
|
||||
{
|
||||
"name": "asm89/stack-cors",
|
||||
@@ -1084,23 +1084,27 @@
|
||||
},
|
||||
{
|
||||
"name": "inertiajs/inertia-laravel",
|
||||
"version": "v0.3.6",
|
||||
"version": "v0.4.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/inertiajs/inertia-laravel.git",
|
||||
"reference": "726b1e0d4fc399089dd29820a78e40d1c9aad2eb"
|
||||
"reference": "bfb6ddf0d3c1cc470f6d5b044631fffa48089c49"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/726b1e0d4fc399089dd29820a78e40d1c9aad2eb",
|
||||
"reference": "726b1e0d4fc399089dd29820a78e40d1c9aad2eb",
|
||||
"url": "https://api.github.com/repos/inertiajs/inertia-laravel/zipball/bfb6ddf0d3c1cc470f6d5b044631fffa48089c49",
|
||||
"reference": "bfb6ddf0d3c1cc470f6d5b044631fffa48089c49",
|
||||
"shasum": ""
|
||||
},
|
||||
"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": {
|
||||
"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",
|
||||
"extra": {
|
||||
@@ -1136,7 +1140,7 @@
|
||||
],
|
||||
"support": {
|
||||
"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": [
|
||||
{
|
||||
@@ -1144,7 +1148,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-01-08T13:16:40+00:00"
|
||||
"time": "2021-07-12T14:09:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "intervention/image",
|
||||
@@ -1312,16 +1316,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v8.49.2",
|
||||
"version": "v8.50.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "d9b43ee080b4d51344b2e578aa667f85040471a2"
|
||||
"reference": "d892dbacbe3859cf9303ccda98ac8d782141d5ae"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/d9b43ee080b4d51344b2e578aa667f85040471a2",
|
||||
"reference": "d9b43ee080b4d51344b2e578aa667f85040471a2",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/d892dbacbe3859cf9303ccda98ac8d782141d5ae",
|
||||
"reference": "d892dbacbe3859cf9303ccda98ac8d782141d5ae",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1331,7 +1335,7 @@
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-openssl": "*",
|
||||
"league/commonmark": "^1.3",
|
||||
"league/commonmark": "^1.3|^2.0",
|
||||
"league/flysystem": "^1.1",
|
||||
"monolog/monolog": "^2.0",
|
||||
"nesbot/carbon": "^2.31",
|
||||
@@ -1476,7 +1480,7 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"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",
|
||||
@@ -3567,16 +3571,16 @@
|
||||
},
|
||||
{
|
||||
"name": "stripe/stripe-php",
|
||||
"version": "v7.87.0",
|
||||
"version": "v7.88.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/stripe/stripe-php.git",
|
||||
"reference": "9392f03cb8d8803bf8273378ce42d5cbbf1e24fc"
|
||||
"reference": "7203d00ba9b09830c0c5d5c06a9558db43b8e0ea"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/9392f03cb8d8803bf8273378ce42d5cbbf1e24fc",
|
||||
"reference": "9392f03cb8d8803bf8273378ce42d5cbbf1e24fc",
|
||||
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/7203d00ba9b09830c0c5d5c06a9558db43b8e0ea",
|
||||
"reference": "7203d00ba9b09830c0c5d5c06a9558db43b8e0ea",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3622,9 +3626,9 @@
|
||||
],
|
||||
"support": {
|
||||
"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",
|
||||
@@ -5964,23 +5968,24 @@
|
||||
},
|
||||
{
|
||||
"name": "tightenco/ziggy",
|
||||
"version": "0.9.4",
|
||||
"version": "v1.3.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tighten/ziggy.git",
|
||||
"reference": "82ea6ec6cb6ab3545b0245310b2a424316fe48d8"
|
||||
"reference": "01bf2a967a4a00d493dd578426a91c6e623b37f4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/tighten/ziggy/zipball/82ea6ec6cb6ab3545b0245310b2a424316fe48d8",
|
||||
"reference": "82ea6ec6cb6ab3545b0245310b2a424316fe48d8",
|
||||
"url": "https://api.github.com/repos/tighten/ziggy/zipball/01bf2a967a4a00d493dd578426a91c6e623b37f4",
|
||||
"reference": "01bf2a967a4a00d493dd578426a91c6e623b37f4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"laravel/framework": ">=5.4@dev"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "^5.0"
|
||||
"orchestra/testbench": "^6.0",
|
||||
"phpunit/phpunit": "^9.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
@@ -6007,10 +6012,14 @@
|
||||
{
|
||||
"name": "Jake Bathman",
|
||||
"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.",
|
||||
"homepage": "https://github.com/tightenco/ziggy",
|
||||
"homepage": "https://github.com/tighten/ziggy",
|
||||
"keywords": [
|
||||
"Ziggy",
|
||||
"javascript",
|
||||
@@ -6019,9 +6028,9 @@
|
||||
],
|
||||
"support": {
|
||||
"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",
|
||||
@@ -6728,16 +6737,16 @@
|
||||
},
|
||||
{
|
||||
"name": "facade/ignition",
|
||||
"version": "2.10.2",
|
||||
"version": "2.11.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facade/ignition.git",
|
||||
"reference": "43688227bbf27c43bc1ad83af224f135b6ef0ff4"
|
||||
"reference": "dc6818335f50ccf0b90284784718ea9a82604286"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/facade/ignition/zipball/43688227bbf27c43bc1ad83af224f135b6ef0ff4",
|
||||
"reference": "43688227bbf27c43bc1ad83af224f135b6ef0ff4",
|
||||
"url": "https://api.github.com/repos/facade/ignition/zipball/dc6818335f50ccf0b90284784718ea9a82604286",
|
||||
"reference": "dc6818335f50ccf0b90284784718ea9a82604286",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -6745,7 +6754,6 @@
|
||||
"ext-mbstring": "*",
|
||||
"facade/flare-client-php": "^1.6",
|
||||
"facade/ignition-contracts": "^1.0.2",
|
||||
"filp/whoops": "^2.4",
|
||||
"illuminate/support": "^7.0|^8.0",
|
||||
"monolog/monolog": "^2.0",
|
||||
"php": "^7.2.5|^8.0",
|
||||
@@ -6801,7 +6809,7 @@
|
||||
"issues": "https://github.com/facade/ignition/issues",
|
||||
"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",
|
||||
@@ -6858,16 +6866,16 @@
|
||||
},
|
||||
{
|
||||
"name": "filp/whoops",
|
||||
"version": "2.13.0",
|
||||
"version": "2.14.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/filp/whoops.git",
|
||||
"reference": "2edbc73a4687d9085c8f20f398eebade844e8424"
|
||||
"reference": "fdf92f03e150ed84d5967a833ae93abffac0315b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/filp/whoops/zipball/2edbc73a4687d9085c8f20f398eebade844e8424",
|
||||
"reference": "2edbc73a4687d9085c8f20f398eebade844e8424",
|
||||
"url": "https://api.github.com/repos/filp/whoops/zipball/fdf92f03e150ed84d5967a833ae93abffac0315b",
|
||||
"reference": "fdf92f03e150ed84d5967a833ae93abffac0315b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -6917,7 +6925,7 @@
|
||||
],
|
||||
"support": {
|
||||
"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": [
|
||||
{
|
||||
@@ -6925,7 +6933,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-06-04T12:00:00+00:00"
|
||||
"time": "2021-07-13T12:00:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
|
||||
1
public/js/2158.js
vendored
Normal file
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
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
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
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
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
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
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
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -13,26 +13,38 @@
|
||||
<PageBody>
|
||||
<SettingsLayout>
|
||||
<template #nav>
|
||||
<Tabs />
|
||||
<Tabs/>
|
||||
</template>
|
||||
<template #segments>
|
||||
<SettingsSegment>
|
||||
<template #title>{{ __('Create') }}</template>
|
||||
<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 #form>
|
||||
<form class="space-y-4" @submit.prevent="submit">
|
||||
<FormInput :label="__('Name')" :errors="$page.props.errors.name" v-model="form.name" />
|
||||
<FormInput :label="__('Maximum sites')" type="number" min="0" :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 :label="__('Name')" :errors="$page.props.errors.name"
|
||||
v-model="form.name"/>
|
||||
<FormInput :label="__('Maximum sites')" type="number" min="0"
|
||||
: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')"
|
||||
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')"
|
||||
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="eur">{{ __('Euro €') }}</option>
|
||||
<option value="gbp">{{ __('GBP £') }}</option>
|
||||
@@ -44,12 +56,14 @@
|
||||
</FormSelect>
|
||||
|
||||
<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>
|
||||
<input id="server_create" class="form-checkbox" type="checkbox"
|
||||
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">
|
||||
{{ __('This will allow users to create servers') }}
|
||||
</p>
|
||||
@@ -57,7 +71,8 @@
|
||||
<div>
|
||||
<input id="server_update" class="form-checkbox" type="checkbox"
|
||||
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">
|
||||
{{ __('This will allow users to update servers') }}
|
||||
</p>
|
||||
@@ -65,7 +80,8 @@
|
||||
<div>
|
||||
<input id="server_delete" class="form-checkbox" type="checkbox"
|
||||
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">
|
||||
{{ __('This will allow users to delete servers') }}
|
||||
</p>
|
||||
@@ -73,12 +89,14 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<input id="site_create" class="form-checkbox" type="checkbox"
|
||||
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">
|
||||
{{ __('This will allow users to create sites') }}
|
||||
</p>
|
||||
@@ -86,7 +104,8 @@
|
||||
<div>
|
||||
<input id="site_update" class="form-checkbox" type="checkbox"
|
||||
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">
|
||||
{{ __('This will allow users to update sites') }}
|
||||
</p>
|
||||
@@ -94,7 +113,8 @@
|
||||
<div>
|
||||
<input id="site_delete" class="form-checkbox" type="checkbox"
|
||||
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">
|
||||
{{ __('This will allow users to delete sites') }}
|
||||
</p>
|
||||
@@ -102,10 +122,12 @@
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -125,96 +147,96 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TopBar from './../components/TopBar'
|
||||
import Container from '@/components/Container'
|
||||
import Content from '@/components/Content'
|
||||
import Page from '@/components/Page'
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PageHeaderTitle from '@/components/PageHeaderTitle'
|
||||
import PageBody from '@/components/PageBody'
|
||||
import Button from '@/components/Button'
|
||||
import List from '@/components/List'
|
||||
import ListItem from '@/components/ListItem'
|
||||
import StatusBubble from '@/components/StatusBubble'
|
||||
import NotificationBadge from '@/components/NotificationBadge'
|
||||
import MainLayout from '@/Layouts/MainLayout'
|
||||
import SettingsLayout from '@/components/layouts/SettingsLayout'
|
||||
import SettingsSegment from '@/components/SettingsSegment'
|
||||
import FormInput from '@/components/forms/FormInput'
|
||||
import FormSelect from '@/components/forms/FormSelect'
|
||||
import Form from '@/components/Form'
|
||||
import FormActions from '@/components/FormActions'
|
||||
import Tabs from './Tabs'
|
||||
import TopBar from './../components/TopBar'
|
||||
import Container from '@/components/Container'
|
||||
import Content from '@/components/Content'
|
||||
import Page from '@/components/Page'
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PageHeaderTitle from '@/components/PageHeaderTitle'
|
||||
import PageBody from '@/components/PageBody'
|
||||
import Button from '@/components/Button'
|
||||
import List from '@/components/List'
|
||||
import ListItem from '@/components/ListItem'
|
||||
import StatusBubble from '@/components/StatusBubble'
|
||||
import NotificationBadge from '@/components/NotificationBadge'
|
||||
import MainLayout from '@/Layouts/MainLayout'
|
||||
import SettingsLayout from '@/components/layouts/SettingsLayout'
|
||||
import SettingsSegment from '@/components/SettingsSegment'
|
||||
import FormInput from '@/components/forms/FormInput'
|
||||
import FormSelect from '@/components/forms/FormSelect'
|
||||
import Form from '@/components/Form'
|
||||
import FormActions from '@/components/FormActions'
|
||||
import Tabs from './Tabs'
|
||||
|
||||
export default {
|
||||
metaInfo() {
|
||||
return {
|
||||
title: `${this.__('Create package')}`,
|
||||
}
|
||||
},
|
||||
export default {
|
||||
metaInfo() {
|
||||
return {
|
||||
title: `${this.__('Create package')}`,
|
||||
}
|
||||
},
|
||||
|
||||
layout: MainLayout,
|
||||
layout: MainLayout,
|
||||
|
||||
components: {
|
||||
TopBar,
|
||||
Container,
|
||||
Content,
|
||||
Page,
|
||||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
PageBody,
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
StatusBubble,
|
||||
NotificationBadge,
|
||||
FormInput,
|
||||
FormSelect,
|
||||
SettingsLayout,
|
||||
SettingsSegment,
|
||||
Form,
|
||||
FormActions,
|
||||
Tabs,
|
||||
},
|
||||
components: {
|
||||
TopBar,
|
||||
Container,
|
||||
Content,
|
||||
Page,
|
||||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
PageBody,
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
StatusBubble,
|
||||
NotificationBadge,
|
||||
FormInput,
|
||||
FormSelect,
|
||||
SettingsLayout,
|
||||
SettingsSegment,
|
||||
Form,
|
||||
FormActions,
|
||||
Tabs,
|
||||
},
|
||||
|
||||
props: {
|
||||
providers: Object
|
||||
},
|
||||
props: {
|
||||
providers: [Array, Object]
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
sending: false,
|
||||
data() {
|
||||
return {
|
||||
sending: false,
|
||||
|
||||
form: {
|
||||
name: null,
|
||||
plan_id: null,
|
||||
currency: 'usd',
|
||||
maximum_sites: 10,
|
||||
maximum_servers: 1,
|
||||
server_permissions: {
|
||||
create: false,
|
||||
update: false,
|
||||
delete: false,
|
||||
},
|
||||
site_permissions: {
|
||||
create: false,
|
||||
update: false,
|
||||
delete: false
|
||||
},
|
||||
price_monthly: null,
|
||||
price_yearly: null,
|
||||
providers: []
|
||||
form: {
|
||||
name: null,
|
||||
plan_id: null,
|
||||
currency: 'usd',
|
||||
maximum_sites: 10,
|
||||
maximum_servers: 1,
|
||||
server_permissions: {
|
||||
create: false,
|
||||
update: false,
|
||||
delete: false,
|
||||
},
|
||||
}
|
||||
},
|
||||
site_permissions: {
|
||||
create: false,
|
||||
update: false,
|
||||
delete: false
|
||||
},
|
||||
price_monthly: null,
|
||||
price_yearly: null,
|
||||
providers: []
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
this.sending = true
|
||||
|
||||
this.$inertia.post(this.route('admin.packages.store'), this.form)
|
||||
.then(() => this.sending = false)
|
||||
}
|
||||
methods: {
|
||||
submit() {
|
||||
this.$inertia.post(this.route('admin.packages.store'), this.form, {
|
||||
onStart: () => this.sending = true,
|
||||
onFinish: () => this.sending = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
useNotification,
|
||||
|
||||
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(() => {
|
||||
useNotification({
|
||||
variant: 'success',
|
||||
|
||||
@@ -13,19 +13,25 @@
|
||||
<PageBody>
|
||||
<SettingsLayout>
|
||||
<template #nav>
|
||||
<Tabs />
|
||||
<Tabs/>
|
||||
</template>
|
||||
<template #segments>
|
||||
<SettingsSegment>
|
||||
<template #title>{{ __('Edit') }}</template>
|
||||
<template #form>
|
||||
<form class="space-y-4" @submit.prevent="submit">
|
||||
<FormInput :label="__('Name')" :errors="$page.props.errors.name" v-model="form.name" />
|
||||
<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" />
|
||||
<FormInput :label="__('Name')" :errors="$page.props.errors.name"
|
||||
v-model="form.name"/>
|
||||
<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>
|
||||
<Button>{{ __('Save changes') }}</Button>
|
||||
<Button variant="danger" type="button" @click="confirmDelete">{{ __('Delete') }}</Button>
|
||||
<Button variant="danger" type="button" @click="confirmDelete">
|
||||
{{ __('Delete') }}
|
||||
</Button>
|
||||
</FormActions>
|
||||
</form>
|
||||
</template>
|
||||
@@ -35,7 +41,8 @@
|
||||
<template #title>{{ __('Attached users') }}</template>
|
||||
<template #form>
|
||||
<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>
|
||||
<Button>{{ __('Save changes') }}</Button>
|
||||
</FormActions>
|
||||
@@ -76,138 +83,138 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TopBar from './../../components/TopBar'
|
||||
import Container from '@/components/Container'
|
||||
import Content from '@/components/Content'
|
||||
import Page from '@/components/Page'
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PageHeaderTitle from '@/components/PageHeaderTitle'
|
||||
import PageBody from '@/components/PageBody'
|
||||
import Button from '@/components/Button'
|
||||
import List from '@/components/List'
|
||||
import ListItem from '@/components/ListItem'
|
||||
import StatusBubble from '@/components/StatusBubble'
|
||||
import NotificationBadge from '@/components/NotificationBadge'
|
||||
import MainLayout from '@/Layouts/MainLayout'
|
||||
import SettingsLayout from '@/components/layouts/SettingsLayout'
|
||||
import SettingsSegment from '@/components/SettingsSegment'
|
||||
import FormInput from '@/components/forms/FormInput'
|
||||
import FormTextarea from '@/components/forms/FormTextarea'
|
||||
import FormSelect from '@/components/forms/FormSelect'
|
||||
import Form from '@/components/Form'
|
||||
import FormActions from '@/components/FormActions'
|
||||
import { useConfirmDelete } from '@/hooks/confirm-delete'
|
||||
import Tabs from './../Tabs'
|
||||
import Table from '@/components/Table'
|
||||
import TableHead from '@/components/TableHead'
|
||||
import TableHeader from '@/components/TableHeader'
|
||||
import TableRow from '@/components/TableRow'
|
||||
import TableBody from '@/components/TableBody'
|
||||
import TableData from '@/components/TableData'
|
||||
import TopBar from './../../components/TopBar'
|
||||
import Container from '@/components/Container'
|
||||
import Content from '@/components/Content'
|
||||
import Page from '@/components/Page'
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PageHeaderTitle from '@/components/PageHeaderTitle'
|
||||
import PageBody from '@/components/PageBody'
|
||||
import Button from '@/components/Button'
|
||||
import List from '@/components/List'
|
||||
import ListItem from '@/components/ListItem'
|
||||
import StatusBubble from '@/components/StatusBubble'
|
||||
import NotificationBadge from '@/components/NotificationBadge'
|
||||
import MainLayout from '@/Layouts/MainLayout'
|
||||
import SettingsLayout from '@/components/layouts/SettingsLayout'
|
||||
import SettingsSegment from '@/components/SettingsSegment'
|
||||
import FormInput from '@/components/forms/FormInput'
|
||||
import FormTextarea from '@/components/forms/FormTextarea'
|
||||
import FormSelect from '@/components/forms/FormSelect'
|
||||
import Form from '@/components/Form'
|
||||
import FormActions from '@/components/FormActions'
|
||||
import {useConfirmDelete} from '@/hooks/confirm-delete'
|
||||
import Tabs from './../Tabs'
|
||||
import Table from '@/components/Table'
|
||||
import TableHead from '@/components/TableHead'
|
||||
import TableHeader from '@/components/TableHeader'
|
||||
import TableRow from '@/components/TableRow'
|
||||
import TableBody from '@/components/TableBody'
|
||||
import TableData from '@/components/TableData'
|
||||
|
||||
export default {
|
||||
layout: MainLayout,
|
||||
export default {
|
||||
layout: MainLayout,
|
||||
|
||||
components: {
|
||||
TopBar,
|
||||
Container,
|
||||
Content,
|
||||
Page,
|
||||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
PageBody,
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
StatusBubble,
|
||||
NotificationBadge,
|
||||
FormInput,
|
||||
FormSelect,
|
||||
SettingsLayout,
|
||||
SettingsSegment,
|
||||
Form,
|
||||
FormActions,
|
||||
Tabs,
|
||||
FormTextarea,
|
||||
Table,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
TableBody,
|
||||
TableData,
|
||||
},
|
||||
components: {
|
||||
TopBar,
|
||||
Container,
|
||||
Content,
|
||||
Page,
|
||||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
PageBody,
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
StatusBubble,
|
||||
NotificationBadge,
|
||||
FormInput,
|
||||
FormSelect,
|
||||
SettingsLayout,
|
||||
SettingsSegment,
|
||||
Form,
|
||||
FormActions,
|
||||
Tabs,
|
||||
FormTextarea,
|
||||
Table,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
TableBody,
|
||||
TableData,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
sending: false,
|
||||
data() {
|
||||
return {
|
||||
sending: false,
|
||||
|
||||
form: {
|
||||
name: this.server.name,
|
||||
ip: this.server.ip,
|
||||
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)
|
||||
form: {
|
||||
name: this.server.name,
|
||||
ip: this.server.ip,
|
||||
maximum_sites: this.server.maximum_sites,
|
||||
},
|
||||
|
||||
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.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)
|
||||
formAttach: {
|
||||
email: null
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
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>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
useNotification,
|
||||
|
||||
syncServer (server){
|
||||
window.axios.post(this.route('admin.services.servers.sync').url(), server)
|
||||
window.axios.post(this.route('admin.services.servers.sync'), server)
|
||||
.then(() => {
|
||||
useNotification({
|
||||
variant: 'success',
|
||||
|
||||
@@ -127,23 +127,23 @@
|
||||
reply() {
|
||||
this.loading = true;
|
||||
|
||||
this.$inertia.post(this.route('admin.support.reply', this.ticket.id), this.form)
|
||||
.then(response => {
|
||||
this.$inertia.post(this.route('admin.support.reply', this.ticket.id), this.form, {
|
||||
onStart: () => this.sending = true,
|
||||
onFinish: () => {
|
||||
this.loading = false;
|
||||
|
||||
if (!Object.keys(this.$page.props.errors).length) {
|
||||
this.form.content = null;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
close() {
|
||||
this.loading = true;
|
||||
|
||||
this.$inertia.post(this.route('admin.support.close', this.ticket.id))
|
||||
.then(response => {
|
||||
this.loading = false;
|
||||
})
|
||||
this.$inertia.post(this.route('admin.support.close', this.ticket.id), {
|
||||
onStart: () => this.loading = true,
|
||||
onFinish: () => this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -142,10 +142,10 @@
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
this.sending = true
|
||||
|
||||
this.$inertia.post(this.route('admin.users.store'), this.form)
|
||||
.then(() => this.sending = false)
|
||||
this.$inertia.post(this.route('admin.users.store'), this.form, {
|
||||
onStart: () => this.sending = true,
|
||||
onFinish: () => this.sending = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,16 +13,19 @@
|
||||
<PageBody>
|
||||
<SettingsLayout>
|
||||
<template #nav>
|
||||
<Tabs />
|
||||
<Tabs/>
|
||||
</template>
|
||||
<template #segments>
|
||||
<SettingsSegment>
|
||||
<template #title>{{ __('Edit') }}</template>
|
||||
<template #form>
|
||||
<form class="space-y-4" @submit.prevent="submit">
|
||||
<FormInput :label="__('Name')" :errors="$page.props.errors.name" v-model="form.name" />
|
||||
<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" />
|
||||
<FormInput :label="__('Name')" :errors="$page.props.errors.name"
|
||||
v-model="form.name"/>
|
||||
<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">
|
||||
<option value="user">User</option>
|
||||
<option value="admin">Administrator</option>
|
||||
@@ -32,22 +35,30 @@
|
||||
<option v-for="(name, id) in packages" :value="id" v-text="name"></option>
|
||||
</FormSelect>
|
||||
<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>
|
||||
<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>
|
||||
<input id="isolate_per_site_per_user" class="form-checkbox" type="checkbox"
|
||||
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">
|
||||
{{ __('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>
|
||||
</div>
|
||||
|
||||
<FormActions>
|
||||
<Button>{{ __('Save changes') }}</Button>
|
||||
<Button variant="danger" type="button" @click="confirmDelete">{{ __('Delete') }}</Button>
|
||||
<Button variant="danger" type="button" @click="confirmDelete">
|
||||
{{ __('Delete') }}
|
||||
</Button>
|
||||
</FormActions>
|
||||
</form>
|
||||
</template>
|
||||
@@ -61,106 +72,106 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TopBar from './../components/TopBar'
|
||||
import Container from '@/components/Container'
|
||||
import Content from '@/components/Content'
|
||||
import Page from '@/components/Page'
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PageHeaderTitle from '@/components/PageHeaderTitle'
|
||||
import PageBody from '@/components/PageBody'
|
||||
import Button from '@/components/Button'
|
||||
import List from '@/components/List'
|
||||
import ListItem from '@/components/ListItem'
|
||||
import StatusBubble from '@/components/StatusBubble'
|
||||
import NotificationBadge from '@/components/NotificationBadge'
|
||||
import MainLayout from '@/Layouts/MainLayout'
|
||||
import SettingsLayout from '@/components/layouts/SettingsLayout'
|
||||
import SettingsSegment from '@/components/SettingsSegment'
|
||||
import FormInput from '@/components/forms/FormInput'
|
||||
import FormTextarea from '@/components/forms/FormTextarea'
|
||||
import FormSelect from '@/components/forms/FormSelect'
|
||||
import Form from '@/components/Form'
|
||||
import FormActions from '@/components/FormActions'
|
||||
import { useConfirmDelete } from '@/hooks/confirm-delete'
|
||||
import Tabs from './Tabs'
|
||||
import TopBar from './../components/TopBar'
|
||||
import Container from '@/components/Container'
|
||||
import Content from '@/components/Content'
|
||||
import Page from '@/components/Page'
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PageHeaderTitle from '@/components/PageHeaderTitle'
|
||||
import PageBody from '@/components/PageBody'
|
||||
import Button from '@/components/Button'
|
||||
import List from '@/components/List'
|
||||
import ListItem from '@/components/ListItem'
|
||||
import StatusBubble from '@/components/StatusBubble'
|
||||
import NotificationBadge from '@/components/NotificationBadge'
|
||||
import MainLayout from '@/Layouts/MainLayout'
|
||||
import SettingsLayout from '@/components/layouts/SettingsLayout'
|
||||
import SettingsSegment from '@/components/SettingsSegment'
|
||||
import FormInput from '@/components/forms/FormInput'
|
||||
import FormTextarea from '@/components/forms/FormTextarea'
|
||||
import FormSelect from '@/components/forms/FormSelect'
|
||||
import Form from '@/components/Form'
|
||||
import FormActions from '@/components/FormActions'
|
||||
import {useConfirmDelete} from '@/hooks/confirm-delete'
|
||||
import Tabs from './Tabs'
|
||||
|
||||
export default {
|
||||
metaInfo() {
|
||||
return {
|
||||
title: `${this.__('Edit user')}`,
|
||||
}
|
||||
},
|
||||
export default {
|
||||
metaInfo() {
|
||||
return {
|
||||
title: `${this.__('Edit user')}`,
|
||||
}
|
||||
},
|
||||
|
||||
layout: MainLayout,
|
||||
layout: MainLayout,
|
||||
|
||||
components: {
|
||||
TopBar,
|
||||
Container,
|
||||
Content,
|
||||
Page,
|
||||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
PageBody,
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
StatusBubble,
|
||||
NotificationBadge,
|
||||
FormInput,
|
||||
FormSelect,
|
||||
SettingsLayout,
|
||||
SettingsSegment,
|
||||
Form,
|
||||
FormActions,
|
||||
Tabs,
|
||||
FormTextarea
|
||||
},
|
||||
components: {
|
||||
TopBar,
|
||||
Container,
|
||||
Content,
|
||||
Page,
|
||||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
PageBody,
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
StatusBubble,
|
||||
NotificationBadge,
|
||||
FormInput,
|
||||
FormSelect,
|
||||
SettingsLayout,
|
||||
SettingsSegment,
|
||||
Form,
|
||||
FormActions,
|
||||
Tabs,
|
||||
FormTextarea
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
sending: false,
|
||||
data() {
|
||||
return {
|
||||
sending: false,
|
||||
|
||||
form: {
|
||||
name: this.user.name,
|
||||
email: this.user.email,
|
||||
role: this.user.role,
|
||||
package: this.user.package_id,
|
||||
notes: this.user.notes,
|
||||
language: this.user.language,
|
||||
blocked: this.user.blocked,
|
||||
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)
|
||||
form: {
|
||||
name: this.user.name,
|
||||
email: this.user.email,
|
||||
role: this.user.role,
|
||||
package: this.user.package_id,
|
||||
notes: this.user.notes,
|
||||
language: this.user.language,
|
||||
blocked: this.user.blocked,
|
||||
requires_password_for_ftp: this.user.requires_password_for_ftp,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
confirmDelete() {
|
||||
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(),
|
||||
})
|
||||
},
|
||||
props: {
|
||||
user: Object,
|
||||
packages: Object,
|
||||
languages: Array,
|
||||
},
|
||||
|
||||
delete() {
|
||||
this.sending = true
|
||||
methods: {
|
||||
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))
|
||||
.then(() => this.sending = false)
|
||||
}
|
||||
confirmDelete() {
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user