provider, enums, no timestamp

This commit is contained in:
2025-04-07 15:52:59 +01:00
parent 7f546c1678
commit 1e7d023b09
15 changed files with 30 additions and 29 deletions

View File

@@ -51,7 +51,6 @@ class GenerateJSEnums extends Command
}
$js = "// This is a generated file. \n";
$js .= '// Published at '.now()->format('Y-m-d H:i:s')."\n";
$js .= "\n";
$js .= 'export default ';
$js .= json_encode($enum::toArray(), JSON_PRETTY_PRINT)."\n";

View File

@@ -2,8 +2,12 @@
namespace App\Enums;
use App\Enums\Concerns\Arrayable;
enum FirewallRuleType: string
{
use Arrayable;
case ALLOW = 'allow';
case DENY = 'deny';
}

View File

@@ -25,6 +25,8 @@ class ServerController extends Controller
public function create(Request $request)
{
$organisation = Organisation::findOrFail($request->route('organisation'));
$locations = null;
$serverTypes = null;
$images = null;
@@ -47,6 +49,7 @@ class ServerController extends Controller
}
return inertia('servers/Create', [
'providers' => $organisation->providers,
'locations' => $locations,
'serverTypes' => $serverTypes,
'images' => $images,

View File

@@ -1,5 +1,4 @@
// This is a generated file.
// Published at 2025-04-06 16:01:50
export default {
"PENDING": "pending",

View File

@@ -1,9 +1,9 @@
// This is a generated file.
// Published at 2025-04-06 16:01:50
export default {
"NOT_APPLIED": "not-applied",
"APPLIED": "applied",
"FAILED": "failed"
"UNINSTALLED": "uninstalled",
"INSTALLED": "installed",
"FAILED": "failed",
"REMOVED": "removed"
}

View File

@@ -0,0 +1,7 @@
// This is a generated file.
export default {
"ALLOW": "allow",
"DENY": "deny"
}

View File

@@ -0,0 +1,7 @@
// This is a generated file.
export default {
"EXTERNAL": "external",
"INTERNAL": "internal"
}

View File

@@ -1,5 +1,4 @@
// This is a generated file.
// Published at 2025-04-06 16:01:50
export default {
"ADMIN": "admin",

View File

@@ -1,5 +1,4 @@
// This is a generated file.
// Published at 2025-04-06 16:01:50
export default {
"HETZNER": "hetzner",

View File

@@ -1,5 +1,4 @@
// This is a generated file.
// Published at 2025-04-06 16:01:50
export default {
"GIT": "git"

View File

@@ -1,5 +1,4 @@
// This is a generated file.
// Published at 2025-04-06 16:01:50
export default {
"WAITING_FOR_PROVIDER": "waiting-for-provider",

View File

@@ -1,5 +1,4 @@
// This is a generated file.
// Published at 2025-04-06 16:01:50
export default {
"DATABASE": "database",

View File

@@ -1,5 +1,4 @@
// This is a generated file.
// Published at 2025-04-06 16:01:50
export default {
"NOT_INSTALLED": "not-installed",

View File

@@ -1,5 +1,4 @@
// This is a generated file.
// Published at 2025-04-06 16:01:50
export default {
"FRANKENPHP": "frankenphp",

View File

@@ -6,6 +6,7 @@ import { Head, router, useForm } from '@inertiajs/vue3';
import { watch } from 'vue';
const props = defineProps({
providers: Array,
locations: Array,
serverTypes: Array,
images: Array,
@@ -18,18 +19,6 @@ const form = useForm({
image: null,
});
const serverProviders = [
{
name: 'Hetzner',
value: 'hetzner',
},
{
name: 'Digital Ocean',
value: 'digital-ocean',
disabled: true,
},
];
watch(
() => form.provider,
(provider) => {
@@ -92,13 +81,13 @@ function loadServerTypes() {
<div class="flex h-full flex-1 flex-col gap-4 rounded-xl p-4">
<div class="flex flex-wrap gap-2">
<RadioButton
v-for="serverProvider in serverProviders"
v-for="provider in providers"
v-model="form.provider"
:value="serverProvider.value"
:disabled="serverProvider.disabled"
:value="provider.value"
:disabled="provider.disabled"
name="server-provider"
>
{{ serverProvider.name }}
{{ provider.name }}
</RadioButton>
</div>
<div v-if="form.provider" class="flex flex-wrap gap-2">