coolify/resources/views/components/layout.blade.php

133 lines
4.3 KiB
PHP
Raw Normal View History

2023-03-20 13:04:22 +01:00
<!DOCTYPE html>
2023-05-18 13:26:35 +02:00
<html data-theme="coollabs" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
2023-03-20 13:04:22 +01:00
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
2023-05-12 15:39:07 +02:00
<link rel="preconnect" href="https://api.fonts.coollabs.io" crossorigin>
<link href="https://api.fonts.coollabs.io/css2?family=Inter&display=swap" rel="stylesheet">
2023-05-04 08:33:06 +02:00
@env('local')
<title>Coolify - localhost</title>
2023-05-17 09:08:32 +02:00
<link rel="icon" href="{{ asset('favicon-dev.png') }}" type="image/x-icon" />
2023-05-04 08:33:06 +02:00
@endenv
@env('production')
2023-05-17 09:08:32 +02:00
<link rel="icon" href="{{ asset('favicon.png') }}" type="image/x-icon" />
2023-03-20 13:04:22 +01:00
<title>{{ $title ?? 'Coolify' }}</title>
2023-05-04 08:33:06 +02:00
@endenv
2023-03-20 13:04:22 +01:00
<meta name="csrf-token" content="{{ csrf_token() }}">
@vite(['resources/js/app.js', 'resources/css/app.css'])
2023-04-25 10:06:45 +02:00
<style>
2023-07-05 21:26:21 +02:00
[x-cloak] {
display: none !important;
}
2023-04-25 10:06:45 +02:00
</style>
2023-03-20 13:04:22 +01:00
@livewireStyles
</head>
2023-05-18 13:26:35 +02:00
<body>
2023-05-08 21:56:44 +02:00
@livewireScripts
2023-04-27 11:29:02 +02:00
@auth
2023-07-05 21:26:21 +02:00
<x-toaster-hub />
<x-navbar />
<div class="fixed top-3 left-4" id="vue">
<magic-bar></magic-bar>
</div>
<main class="main">
{{ $slot }}
</main>
<x-version class="fixed left-2 bottom-1" />
<script>
let checkHealthInterval = null;
let checkIfIamDeadInterval = null;
2023-06-15 11:55:17 +02:00
2023-07-05 21:26:21 +02:00
function changePasswordFieldType(event) {
const element = event.target.parentElement.parentElement.children[0];
if (element.nodeName === 'INPUT') {
if (element.type === 'password') {
element.type = 'text';
} else {
element.type = 'password';
}
}
if (element.nodeName === 'DIV') {
if (element.children[0].type === 'password') {
element.children[0].type = 'text';
} else {
element.children[0].type = 'password';
}
}
if (element.nodeName === 'svg') {
if (element.parentElement.parentElement.children[0].type === 'password') {
element.parentElement.parentElement.children[0].type = 'text';
} else {
element.parentElement.parentElement.children[0].type = 'password';
}
}
}
function revive() {
if (checkHealthInterval) return true;
console.log('Checking server\'s health...')
checkHealthInterval = setInterval(() => {
fetch('/api/health')
.then(response => {
if (response.ok) {
Toaster.success('Coolify is back online. Reloading...')
if (checkHealthInterval) clearInterval(checkHealthInterval);
setTimeout(() => {
window.location.reload();
}, 5000)
2023-06-16 12:00:36 +02:00
} else {
2023-07-05 21:26:21 +02:00
console.log('Waiting for server to come back from dead...');
2023-06-16 12:00:36 +02:00
}
2023-07-05 21:26:21 +02:00
})
return;
}, 2000);
}
function upgrade() {
if (checkIfIamDeadInterval) return true;
console.log('Update initiated.')
checkIfIamDeadInterval = setInterval(() => {
fetch('/api/health')
.then(response => {
if (response.ok) {
console.log('It\'s alive. Waiting for server to be dead...');
2023-06-16 15:06:37 +02:00
} else {
2023-07-05 21:26:21 +02:00
Toaster.success('Update done, restarting Coolify!')
console.log('It\'s dead. Reviving... Standby... Bzz... Bzz...')
if (checkIfIamDeadInterval) clearInterval(checkIfIamDeadInterval);
revive();
2023-06-16 15:06:37 +02:00
}
2023-07-05 21:26:21 +02:00
})
return;
}, 2000);
}
2023-06-15 11:55:17 +02:00
2023-07-05 21:26:21 +02:00
function copyToClipboard(text) {
navigator.clipboard.writeText(text);
Livewire.emit('message', 'Copied to clipboard.');
}
Livewire.on('reloadWindow', () => {
window.location.reload();
})
Livewire.on('info', (message) => {
if (message) Toaster.info(message)
})
Livewire.on('error', (message) => {
if (message) Toaster.error(message)
})
Livewire.on('warning', (message) => {
if (message) Toaster.warning(message)
})
Livewire.on('success', (message) => {
if (message) Toaster.success(message)
})
</script>
2023-04-28 11:54:01 +02:00
@endauth
2023-06-16 10:32:29 +02:00
@guest
2023-07-05 21:26:21 +02:00
{{ $slot }}
2023-06-16 10:32:29 +02:00
@endguest
2023-03-20 13:04:22 +01:00
</body>
2023-07-05 21:26:21 +02:00
</html>