LinkStack/resources/views/backup.blade.php

63 lines
2.5 KiB
PHP
Raw Normal View History

2023-06-15 19:51:40 +02:00
<title>{{__('messages.Backup.title')}}</title>
2022-08-06 12:20:28 +02:00
@extends('layouts.updater')
@Push('updater-body')
<div class="container">
@if($_SERVER['QUERY_STRING'] === '')
<?php //landing page ?>
<div class="logo-container fadein">
2023-05-01 12:51:54 +02:00
<img class="logo-img" src="{{ asset('assets/linkstack/images/logo.svg') }}" alt="Logo">
2022-08-06 12:20:28 +02:00
<div class="logo-centered">l</div>
</div>
2023-06-15 19:51:40 +02:00
<h1>{{__('messages.Backup')}}</h1>
<h4 class="">{{__('messages.You can back up your entire instance:')}}</h4>
<h5 class="">{{__('messages.The backup system wont save more than two backups at a time')}}</h5>
2022-08-06 12:20:28 +02:00
<br><div class="row">
2023-06-15 19:51:40 +02:00
&ensp;<a class="btn" href="{{url()->current()}}/?backup"><button><i class="fa-solid fa-floppy-disk"></i> {{__('messages.Backup Instance')}}</button></a>&ensp;
&ensp;<a class="btn" href="{{ route('showBackups') }}"><button><i class="fa-solid fa-box-archive"></i> {{__('messages.All Backups')}}</button></a>&ensp;
2022-08-06 12:20:28 +02:00
</div>
@endif
@if($_SERVER['QUERY_STRING'] === 'backup')
<?php //creating backup... ?>
@Push('updater-head')
<meta http-equiv="refresh" content="2; URL={{url()->current()}}/?backups" />
@endpush
<div class="logo-container fadein">
2023-05-01 12:51:54 +02:00
<img class="logo-img" src="{{ asset('assets/linkstack/images/logo-loading.svg') }}" alt="Logo">
2022-08-06 12:20:28 +02:00
</div>
2023-06-15 19:51:40 +02:00
<h1 class="loadingtxt">{{__('messages.Creating backup')}}</h1>
2022-08-06 12:20:28 +02:00
@endif
@if($_SERVER['QUERY_STRING'] === 'backups')
2023-03-09 22:15:45 +01:00
<?php
try {Artisan::call('backup:clean');}
catch (exception $e) {}
2022-08-06 12:20:28 +02:00
Artisan::call('backup:run', ['--only-files' => true]);
$tst = base_path('backups/');
file_put_contents($tst.'CANUPDATE', '');
$URL = Route::current()->getName();
header("Location: ".$URL."?success");
exit(); ?>
@endif
@if($_SERVER['QUERY_STRING'] === 'success')
<?php //after successfully updating ?>
<div class="logo-container fadein">
2023-05-01 12:51:54 +02:00
<img class="logo-img" src="{{ asset('assets/linkstack/images/logo.svg') }}" alt="Logo">
2022-08-06 12:20:28 +02:00
</div>
2023-06-15 19:51:40 +02:00
<h1>{{__('messages.Success!')}}</h1>
<h4 class="">{{__('messages.The backup was successful')}}</h4>
2022-08-06 12:20:28 +02:00
<br><div class="row">
2023-06-15 19:51:40 +02:00
&ensp;<a class="btn" href="{{ url('dashboard') }}"><button><i class="fa-solid fa-house-laptop btn"></i> {{__('messages.Admin Panel')}}</button></a>&ensp;
&ensp;<a class="btn" href="{{ url('admin/config#4') }}"><button><i class="fa-solid fa-box-archive"></i> {{__('messages.All Backups')}}</button></a>&ensp;
2022-08-06 12:20:28 +02:00
</div>
@endif
</div>
@endpush