blessing-skin-server/resources/views/admin/update.tpl

194 lines
9.6 KiB
PHP
Raw Normal View History

2016-08-09 13:18:27 +08:00
@extends('admin.master')
2016-09-25 10:02:40 +08:00
@section('title', trans('general.check-update'))
2016-08-09 13:18:27 +08:00
2016-08-27 16:29:20 +08:00
@section('style')
<style type="text/css">
.description { margin: 7px 0 0 0; color: #555; }
.description a { color: #3c8dbc; }
</style>
@endsection
2016-08-09 13:18:27 +08:00
@section('content')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
2016-09-25 10:02:40 +08:00
{{ trans('general.check-update') }}
2016-08-09 13:18:27 +08:00
<small>Check Update</small>
</h1>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-6">
<div class="box box-primary">
<div class="box-header with-border">
2016-12-30 15:01:34 +08:00
<h3 class="box-title">{{ trans('admin.update.update-info') }}</h3>
2016-08-09 13:18:27 +08:00
</div><!-- /.box-header -->
<div class="box-body">
@if ($info['new_version_available'])
2016-12-30 15:01:34 +08:00
<div class="callout callout-info">{{ trans('admin.update.update-available') }}</div>
2016-08-09 13:18:27 +08:00
<table class="table">
<tbody>
<tr>
2016-12-30 15:01:34 +08:00
<td class="key">{{ trans('admin.update.latest-version') }}</td>
2016-08-09 13:18:27 +08:00
<td class="value">
v{{ $info['latest_version'] }}
2016-08-09 13:18:27 +08:00
</td>
</tr>
<tr>
2016-12-30 15:01:34 +08:00
<td class="key">{{ trans('admin.update.current-version') }}</td>
2016-08-09 13:18:27 +08:00
<td class="value">
v{{ $info['current_version'] }}
2016-08-09 13:18:27 +08:00
</td>
</tr>
<tr>
2016-12-30 15:01:34 +08:00
<td class="key">{{ trans('admin.update.release-time') }}</td>
2016-08-09 13:18:27 +08:00
<td class="value">
{{ Utils::getTimeFormatted($info['release_time']) }}
2016-08-09 13:18:27 +08:00
</td>
</tr>
<tr>
2016-12-30 15:01:34 +08:00
<td class="key">{{ trans('admin.update.change-log') }}</td>
2016-08-09 13:18:27 +08:00
<td class="value">
2016-12-30 15:01:34 +08:00
{!! nl2br($info['release_note']) ?: "{{ trans('admin.update.no-log') }}" !!}
2016-08-09 13:18:27 +08:00
</td>
</tr>
<tr>
2016-12-30 15:01:34 +08:00
<td class="key">{{ trans('admin.update.download-link') }}</td>
2016-08-09 13:18:27 +08:00
<td class="value">
2016-12-30 15:01:34 +08:00
<a href="{!! $info['release_url'] !!}">{{ trans('admin.update.download-full') }}</a>
2016-08-09 13:18:27 +08:00
</td>
</tr>
@if($info['pre_release'])
2016-12-30 15:01:34 +08:00
<div class="callout callout-warning">{{ trans('admin.update.pre-release-warning') }}</div>
@endif
2016-08-09 13:18:27 +08:00
</tbody>
</table>
@else
2016-12-30 15:01:34 +08:00
<div class="callout callout-success">{{ trans('admin.update.latest-now') }}</div>
2016-08-09 13:18:27 +08:00
<table class="table">
<tbody>
<tr>
2016-12-30 15:01:34 +08:00
<td class="key">{{ trans('admin.update.current-version') }}</td>
2016-08-09 13:18:27 +08:00
<td class="value">
v{{ $info['current_version'] }}
2016-08-09 13:18:27 +08:00
</td>
</tr>
<tr>
2016-12-30 15:01:34 +08:00
<td class="key">{{ trans('admin.update.release-time') }}</td>
2016-08-09 13:18:27 +08:00
<td class="value">
@if (isset($info['release_time']))
{{ Utils::getTimeFormatted($info['release_time']) }}
@else
2016-12-30 15:01:34 +08:00
{{ trans('admin.update.pre-release') }}
@endif
2016-08-09 13:18:27 +08:00
</td>
</tr>
</tbody>
</table>
@endif
</div><!-- /.box-body -->
<div class="box-footer">
2016-12-30 15:01:34 +08:00
<a class="btn btn-primary" id="update-button" {!! !$info['new_version_available'] ? 'disabled="disabled"' : 'href="javascript:downloadUpdates();"' !!}>{{ trans('admin.update.button') }}</a>
<a href="{{ trans('admin.update.forum-url') }}" style="float: right;" class="btn btn-default">{{ trans('admin.update.check-forum') }}</a>
2016-08-09 13:18:27 +08:00
</div>
</div>
<div class="box box-default">
<div class="box-header with-border">
2016-12-30 15:01:34 +08:00
<h3 class="box-title">{{ trans('admin.update.caution') }}</h3>
2016-08-09 13:18:27 +08:00
</div><!-- /.box-header -->
<div class="box-body">
2016-12-30 15:01:34 +08:00
<p>{{ trans('admin.update.choose-source') }}</p>
<p>{{ trans('admin.update.choose-wrong') }}</p>
2016-08-09 13:18:27 +08:00
</div><!-- /.box-body -->
</div>
</div>
<div class="col-md-6">
<div class="box box-default">
<div class="box-header with-border">
2016-12-30 15:01:34 +08:00
<h3 class="box-title">{{ trans('admin.update.update-options') }}</h3>
2016-08-09 13:18:27 +08:00
</div><!-- /.box-header -->
2016-09-10 17:02:47 +08:00
<form method="post">
2016-08-27 16:29:20 +08:00
<div class="box-body">
<?php
if (isset($_POST['submit'])) {
$_POST['check_update'] = isset($_POST['check_update']) ? $_POST['check_update'] : "0";
foreach ($_POST as $key => $value) {
if ($key != "option" && $key != "submit")
Option::set($key, $value);
}
2016-12-30 15:01:34 +08:00
echo '<div class="callout callout-success">{{ trans('admin.update.config-saved') }}</div>';
}
2016-08-27 16:29:20 +08:00
try {
$response = file_get_contents(option('update_source'));
} catch (Exception $e) {
2016-12-30 15:01:34 +08:00
echo '<div class="callout callout-danger">{{ trans('admin.update.connection-error') }}'.$e->getMessage().'</div>';
}
2016-08-27 16:29:20 +08:00
?>
<table class="table">
<tbody>
2016-08-27 16:29:20 +08:00
<tr>
2016-12-30 15:01:34 +08:00
<td class="key">{{ trans('admin.update.check-update') }}</td>
2016-08-27 16:29:20 +08:00
<td class="value">
<label for="check_update">
2016-12-30 15:01:34 +08:00
<input {{ (option('check_update') == '1') ? 'checked="true"' : '' }} type="checkbox" id="check_update" name="check_update" value="1"> {{ trans('admin.update.auto-check') }}
2016-08-27 16:29:20 +08:00
</label>
</td>
</tr>
<tr>
2016-12-30 15:01:34 +08:00
<td class="key">{{ trans('admin.update.source') }}</td>
2016-08-27 16:29:20 +08:00
<td class="value">
<input type="text" class="form-control" name="update_source" value="{{ option('update_source') }}">
2016-12-30 15:01:34 +08:00
<p class="description">{{ trans('admin.update.source-list') }}<a href="https://github.com/printempw/blessing-skin-server/wiki/%E6%9B%B4%E6%96%B0%E6%BA%90%E5%88%97%E8%A1%A8">@GitHub Wiki</a></p>
2016-08-27 16:29:20 +08:00
</td>
</tr>
</tbody>
</table>
</div><!-- /.box-body -->
<div class="box-footer">
2016-12-30 15:01:34 +08:00
<button type="submit" name="submit" class="btn btn-primary">{{ trans('general.submit') }}</button>
2016-08-27 16:29:20 +08:00
</div>
</form>
2016-08-09 13:18:27 +08:00
</div>
</div>
</div>
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<div id="modal-start-download" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
2016-12-30 15:01:34 +08:00
<h4 class="modal-title">{{ trans('admin.update.downloading') }}</h4>
</div>
<div class="modal-body">
2016-12-30 15:01:34 +08:00
<p>{{ trans('admin.update.size') }}<span id="file-size">0</span> Bytes</p>
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
<span id="imported-progress">0</span>%
</div>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
2016-08-27 16:29:20 +08:00
@endsection