Skip to content

Commit 11a69a7

Browse files
committed
Update update.blade.php
1 parent a0a1e65 commit 11a69a7

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

resources/views/update.blade.php

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="container">
55

66
<?php // Requests newest version from server and sets it as variable
7-
$Vgit = file_get_contents("https://version.littlelink-custom.com/");
7+
$Vgit = file_get_contents("https://julianprieber.github.io/littlelink-custom/version.json");
88
99
// Requests current version from the local version file and sets it as variable
1010
$Vlocal = file_get_contents(base_path("version.json"));
@@ -42,7 +42,7 @@
4242
@endif
4343
<br><div class="row">
4444
@if(env('SKIP_UPDATE_BACKUP') == true)
45-
&ensp;<a class="btn" href="{{url()->current()}}/?updating"><button><i class="fa-solid fa-user-gear btn"></i> Update automatically</button></a>&ensp;
45+
&ensp;<a class="btn" href="{{url()->current()}}/?preparing"><button><i class="fa-solid fa-user-gear btn"></i> Update automatically</button></a>&ensp;
4646
@else
4747
&ensp;<a class="btn" href="{{url()->current()}}/?backup"><button><i class="fa-solid fa-user-gear btn"></i> Update automatically</button></a>&ensp;
4848
@endif
@@ -61,7 +61,7 @@
6161
</div>
6262
<h1 class="loadingtxt">Updating</h1>
6363
@Push('updater-head')
64-
<meta http-equiv="refresh" content="2; URL={{url()->current()}}/?updating-windows-bat" />
64+
<meta http-equiv="refresh" content="2; URL={{url()->current()}}/?preparing" />
6565
@endpush
6666
@endif
6767

@@ -121,10 +121,35 @@
121121
$tst = base_path('backups/');
122122
file_put_contents($tst.'CANUPDATE', '');
123123
$URL = Route::current()->getName();
124-
header("Location: ".$URL."?updating");
124+
header("Location: ".$URL."?preparing");
125125
exit(); ?>
126126
@endif
127127

128+
@if($_SERVER['QUERY_STRING'] === 'preparing')
129+
<?php //preparing update ?>
130+
<div class="logo-container fadein">
131+
<img class="logo-img loading" src="{{ asset('littlelink/images/just-gear.svg') }}" alt="Logo">
132+
<div class="logo-centered">l</div>
133+
</div>
134+
<h1 class="loadingtxt">Preparing update</h1>
135+
136+
<?php // Get update preperation script from GitHub
137+
try {
138+
$file = file_get_contents('https://raw.githubusercontent.com/JulianPrieber/littlelink-custom/main/resources/views/components/pre-update.blade.php');
139+
$newfile = base_path('resources/views/components/pre-update.blade.php');
140+
file_put_contents($newfile, $file);
141+
} catch (exception $e) {}
142+
?>
143+
144+
@include('components.pre-update')
145+
146+
@if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
147+
<meta http-equiv="refresh" content="2; URL={{url()->current()}}/?updating-windows-bat" />
148+
@else
149+
<?php echo "<meta http-equiv=\"refresh\" content=\"0; " . url()->current() . "?updating\" />" ?>
150+
@endif
151+
@endif
152+
128153
@if($_SERVER['QUERY_STRING'] === 'updating' and (file_exists(base_path("backups/CANUPDATE")) or env('SKIP_UPDATE_BACKUP') == true))
129154
<?php //updating... ?>
130155
<div class="logo-container fadein">
@@ -211,6 +236,6 @@
211236
@endif
212237

213238
@if("8" > phpversion()) <br><br><a style="background-color:tomato;color:#fff;border-radius:5px;" class="nav-link" href="{{ url('/studio/profile') }}" target=""><i class="bi bi-exclamation-circle-fill"></i> <strong>You are using an outdated version of PHP! Official support for this version will end soon.</strong></a> @endif
214-
</div>
215239

240+
</div>
216241
@endpush

0 commit comments

Comments
 (0)