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

127 lines
4.5 KiB
PHP
Raw Normal View History

2023-03-20 12:04:22 +00:00
<!DOCTYPE html>
2023-05-18 11:26:35 +00:00
<html data-theme="coollabs" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
2023-03-20 12:04:22 +00:00
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
2023-05-12 13:39:07 +00: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 06:33:06 +00:00
@env('local')
2023-08-11 18:19:42 +00:00
<title>Coolify - localhost</title>
<link rel="icon" href="{{ asset('favicon-dev.png') }}" type="image/x-icon" />
2023-08-15 14:15:30 +00:00
@else
2023-08-11 18:19:42 +00:00
<title>{{ $title ?? 'Coolify' }}</title>
2023-08-16 13:47:04 +00:00
<link rel="icon" href="{{ asset('coolify-transparent.png') }}" type="image/x-icon" />
2023-05-04 06:33:06 +00:00
@endenv
2023-03-20 12:04:22 +00:00
<meta name="csrf-token" content="{{ csrf_token() }}">
@vite(['resources/js/app.js', 'resources/css/app.css'])
2023-04-25 08:06:45 +00:00
<style>
2023-07-13 11:16:24 +00:00
[x-cloak] {
display: none !important;
}
2023-04-25 08:06:45 +00:00
</style>
2023-03-20 12:04:22 +00:00
@livewireStyles
</head>
2023-05-18 11:26:35 +00:00
<body>
2023-08-11 18:19:42 +00:00
@livewireScripts
@auth
<x-toaster-hub />
<x-navbar />
<div class="fixed top-3 left-4" id="vue">
<magic-bar></magic-bar>
</div>
<main class="main max-w-screen-2xl">
{{ $slot }}
</main>
<x-version class="fixed left-2 bottom-1" />
<script>
let checkHealthInterval = null;
let checkIfIamDeadInterval = null;
2023-07-05 19:26:21 +00:00
2023-08-11 18:19:42 +00:00
function changePasswordFieldType(event) {
let element = event.target
for (let i = 0; i < 10; i++) {
if (element.className === "relative") {
break;
}
element = element.parentElement;
2023-07-13 11:16:24 +00:00
}
2023-08-11 18:19:42 +00:00
element = element.children[1];
if (element.nodeName === 'INPUT') {
if (element.type === 'password') {
element.type = 'text';
} else {
element.type = 'password';
}
2023-07-13 11:16:24 +00:00
}
}
2023-08-11 18:19:42 +00:00
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)
} else {
console.log('Waiting for server to come back from dead...');
}
})
2023-06-15 09:55:17 +00:00
2023-08-11 18:19:42 +00:00
}, 2000);
}
2023-07-13 11:16:24 +00:00
2023-08-11 18:19:42 +00:00
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...');
} else {
Toaster.success('Update done, restarting Coolify!')
console.log('It\'s dead. Reviving... Standby... Bzz... Bzz...')
if (checkIfIamDeadInterval) clearInterval(checkIfIamDeadInterval);
revive();
}
})
2023-08-11 18:19:42 +00:00
}, 2000);
}
2023-08-11 18:19:42 +00:00
function copyToClipboard(text) {
navigator.clipboard.writeText(text);
Livewire.emit('message', 'Copied to clipboard.');
}
2023-08-11 18:19:42 +00:00
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>
@endauth
@guest
{{ $slot }}
@endguest
2023-03-20 12:04:22 +00:00
</body>
2023-07-13 11:16:24 +00:00
</html>