mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:35:13 +00:00
one click updates
This commit is contained in:
parent
297aa52014
commit
595b5a3f20
2 changed files with 57 additions and 47 deletions
|
@ -44,6 +44,10 @@ class Admin extends Controller
|
|||
if (argc() > 1) {
|
||||
$this->sm->call('init');
|
||||
}
|
||||
if ($_GET['upgrade']) {
|
||||
exec("util/udall > upgrade.log");
|
||||
goaway(z_root() . '/admin');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -165,7 +169,7 @@ class Admin extends Controller
|
|||
$vrelease = get_repository_version('release');
|
||||
$vdev = get_repository_version('dev');
|
||||
$upgrade = ((version_compare(STD_VERSION, $vrelease) < 0) ? t('Your software should be updated') : '');
|
||||
|
||||
$git_cmd = exec('which git');
|
||||
$t = Theme::get_template('admin_summary.tpl');
|
||||
return replace_macros($t, [
|
||||
'$title' => t('Administration'),
|
||||
|
@ -180,6 +184,8 @@ class Admin extends Controller
|
|||
'$vmaster' => [t('Repository version (release)'), $vrelease],
|
||||
'$vdev' => [t('Repository version (dev)'), $vdev],
|
||||
'$upgrade' => $upgrade,
|
||||
'$update' => t('Update'),
|
||||
'$can_upgrade' => is_dir('.git') && $git_cmd,
|
||||
'$build' => Config::Get('system', 'db_version')
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1,51 +1,55 @@
|
|||
<div class="generic-content-wrapper" id='adminpage'>
|
||||
<div class="section-title-wrapper"><h1>{{$title}} - {{$page}}</h1></div>
|
||||
<div class="section-content-wrapper">
|
||||
<div class="section-title-wrapper"><h1>{{$title}} - {{$page}}</h1></div>
|
||||
<div class="section-content-wrapper">
|
||||
{{if $adminalertmsg}}
|
||||
<p class="alert alert-warning" role="alert">{{$adminalertmsg}}</p>
|
||||
<p class="alert alert-warning" role="alert">{{$adminalertmsg}}</p>
|
||||
{{/if}}
|
||||
{{if $upgrade}}
|
||||
<p class="alert alert-warning" role="alert">{{$upgrade}}</p>
|
||||
{{/if}}
|
||||
<dl>
|
||||
<dt>{{$queues.label}}</dt>
|
||||
<dd>{{$queues.queue}}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{{$accounts.0}}</dt>
|
||||
<dd>{{foreach from=$accounts.1 item=acc name=account}}<span title="{{$acc.label}}">{{$acc.val}} {{$acc.label}}</span>{{if !$smarty.foreach.account.last}} / {{/if}}{{/foreach}}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{{$pending.0}}</dt>
|
||||
<dd>{{$pending.1}}</dt>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{{$channels.0}}</dt>
|
||||
<dd>{{foreach from=$channels.1 item=ch name=chan}}<span title="{{$ch.label}}">{{$ch.val}} {{$ch.label}}</span>{{if !$smarty.foreach.chan.last}} / {{/if}}{{/foreach}}</dd>
|
||||
</dl>
|
||||
{{if $plugins}}
|
||||
<dl>
|
||||
<dt>{{$plugins.0}}</dt>
|
||||
<dd>
|
||||
{{foreach $plugins.1 as $p}} {{$p}} {{/foreach}}
|
||||
</dd>
|
||||
</dl>
|
||||
{{/if}}
|
||||
<dl>
|
||||
<dt>{{$version.0}}</dt>
|
||||
<dd>{{$version.1}} - {{$build}}</dd>
|
||||
</dl>
|
||||
{{if $vmaster.1}}
|
||||
<dl>
|
||||
<dt>{{$vmaster.0}}</dt>
|
||||
<dd>{{$vmaster.1}}</dd>
|
||||
</dl>
|
||||
{{/if}}
|
||||
{{if $vdev.1}}
|
||||
<dl>
|
||||
<dt>{{$vdev.0}}</dt>
|
||||
<dd>{{$vdev.1}}</dd>
|
||||
</dl>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="alert alert-warning" role="alert">{{$upgrade}}</div>
|
||||
{{if $can_upgrade}}
|
||||
<center><a href="admin?upgrade=true" class="btn btn-std btn-primary" style="color: #FFF;">{{$update}}</a></center>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<dl>
|
||||
<dt>{{$queues.label}}</dt>
|
||||
<dd>{{$queues.queue}}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{{$accounts.0}}</dt>
|
||||
<dd>{{foreach from=$accounts.1 item=acc name=account}}<span title="{{$acc.label}}">{{$acc.val}} {{$acc.label}}</span>{{if !$smarty.foreach.account.last}} / {{/if}}{{/foreach}}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{{$pending.0}}</dt>
|
||||
<dd>{{$pending.1}}</dt>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{{$channels.0}}</dt>
|
||||
<dd>{{foreach from=$channels.1 item=ch name=chan}}<span title="{{$ch.label}}">{{$ch.val}} {{$ch.label}}</span>{{if !$smarty.foreach.chan.last}} / {{/if}}{{/foreach}}</dd>
|
||||
</dl>
|
||||
{{if $plugins}}
|
||||
<dl>
|
||||
<dt>{{$plugins.0}}</dt>
|
||||
<dd>
|
||||
{{foreach $plugins.1 as $p}} {{$p}} {{/foreach}}
|
||||
</dd>
|
||||
</dl>
|
||||
{{/if}}
|
||||
<dl>
|
||||
<dt>{{$version.0}}</dt>
|
||||
<dd>{{$version.1}} - {{$build}}</dd>
|
||||
</dl>
|
||||
{{if $vmaster.1}}
|
||||
<dl>
|
||||
<dt>{{$vmaster.0}}</dt>
|
||||
<dd>{{$vmaster.1}}</dd>
|
||||
</dl>
|
||||
{{/if}}
|
||||
{{if $vdev.1}}
|
||||
<dl>
|
||||
<dt>{{$vdev.0}}</dt>
|
||||
<dd>{{$vdev.1}}</dd>
|
||||
</dl>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in a new issue