wip
This commit is contained in:
@@ -25,6 +25,25 @@
|
||||
|
||||
<x-confirm-modal />
|
||||
@livewireScripts
|
||||
@auth
|
||||
<script>
|
||||
Livewire.on('updateInitiated', () => {
|
||||
let checkStatus = null;
|
||||
console.log('Update initiated')
|
||||
setInterval(async () => {
|
||||
const res = await fetch('/api/health');
|
||||
if (res.ok) {
|
||||
console.log('Server is back online')
|
||||
clearInterval(checkStatus);
|
||||
window.location.reload();
|
||||
} else {
|
||||
console.log('Waiting for server to come back online...');
|
||||
}
|
||||
return;
|
||||
}, 2000);
|
||||
})
|
||||
</script>
|
||||
@endauth
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -3,14 +3,12 @@
|
||||
<div wire:loading wire:target="checkUpdate">
|
||||
Checking for updates...
|
||||
</div>
|
||||
@env('production')
|
||||
@if (auth()->user()->teams->contains(0))
|
||||
<button wire:click='forceUpgrade'>Force Upgrade</button>
|
||||
<div wire:loading wire:target="forceUpgrade">
|
||||
Updating Coolify...
|
||||
</div>
|
||||
@endif
|
||||
@endenv
|
||||
@if ($updateAvailable)
|
||||
Update available
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user