Add Admin\Extensions page
This commit is contained in:
parent
3be1dc4181
commit
95aa1fa7bf
11 changed files with 349 additions and 3 deletions
|
@ -838,6 +838,12 @@ class Routing
|
|||
'AdminAntispam:view',
|
||||
'AdminAntispam'
|
||||
);
|
||||
$r->add(
|
||||
$r::GET,
|
||||
'/admin/extensions',
|
||||
'AdminExtensions:info',
|
||||
'AdminExtensions'
|
||||
);
|
||||
}
|
||||
|
||||
$uri = $_SERVER['REQUEST_URI'];
|
||||
|
|
|
@ -82,6 +82,7 @@ abstract class Admin extends Page
|
|||
'uploads' => [$r->link('AdminUploads'), 'Uploads'],
|
||||
'antispam' => [$r->link('AdminAntispam'), 'Antispam'],
|
||||
'logs' => [$r->link('AdminLogs'), 'Logs'],
|
||||
'extensions' => [$r->link('AdminExtensions'), 'Extensions'],
|
||||
'maintenance' => [$r->link('AdminMaintenance'), 'Maintenance'],
|
||||
];
|
||||
}
|
||||
|
|
33
app/Models/Pages/Admin/Extensions.php
Normal file
33
app/Models/Pages/Admin/Extensions.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of the ForkBB <https://github.com/forkbb>.
|
||||
*
|
||||
* @copyright (c) Visman <mio.visman@yandex.ru, https://github.com/MioVisman>
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ForkBB\Models\Pages\Admin;
|
||||
|
||||
use ForkBB\Models\Page;
|
||||
use ForkBB\Models\Pages\Admin;
|
||||
use Throwable;
|
||||
use function \ForkBB\__;
|
||||
|
||||
class Extensions extends Admin
|
||||
{
|
||||
/**
|
||||
* Подготавливает данные для шаблона
|
||||
*/
|
||||
public function info(): Page
|
||||
{
|
||||
$this->c->Lang->load('admin_extensions');
|
||||
|
||||
$this->nameTpl = 'admin/extensions';
|
||||
$this->aIndex = 'extensions';
|
||||
$this->extensions = $this->c->extensions->repository;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
|
@ -953,6 +953,12 @@ class Update extends Admin
|
|||
'attachments'
|
||||
);
|
||||
|
||||
$coreConfig->add(
|
||||
'multiple=>AdminExtensions',
|
||||
'\\ForkBB\\Models\\Pages\\Admin\\Extensions::class',
|
||||
'AdminAntispam'
|
||||
);
|
||||
|
||||
$coreConfig->save();
|
||||
|
||||
// extensions
|
||||
|
|
|
@ -411,6 +411,7 @@ return [
|
|||
'AdminLogs' => \ForkBB\Models\Pages\Admin\Logs::class,
|
||||
'AdminUploads' => \ForkBB\Models\Pages\Admin\Uploads::class,
|
||||
'AdminAntispam' => \ForkBB\Models\Pages\Admin\Antispam::class,
|
||||
'AdminExtensions' => \ForkBB\Models\Pages\Admin\Extensions::class,
|
||||
|
||||
'AdminListModel' => \ForkBB\Models\AdminList\AdminList::class,
|
||||
'BanListModel' => \ForkBB\Models\BanList\BanList::class,
|
||||
|
|
|
@ -86,3 +86,6 @@ msgstr "Antispam"
|
|||
|
||||
msgid "Maintenance only"
|
||||
msgstr "Available only in maintenance mode."
|
||||
|
||||
msgid "Extensions"
|
||||
msgstr "Расширения"
|
||||
|
|
61
app/lang/en/admin_extensions.po
Normal file
61
app/lang/en/admin_extensions.po
Normal file
|
@ -0,0 +1,61 @@
|
|||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"Project-Id-Version: ForkBB\n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: ForkBB <mio.visman@yandex.ru>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: en\n"
|
||||
|
||||
msgid "Details"
|
||||
msgstr "Details"
|
||||
|
||||
msgid "Name"
|
||||
msgstr "Name of package"
|
||||
|
||||
msgid "Description"
|
||||
msgstr "Description"
|
||||
|
||||
msgid "Release date"
|
||||
msgstr "Release date"
|
||||
|
||||
msgid "Homepage"
|
||||
msgstr "Homepage"
|
||||
|
||||
msgid "Licence"
|
||||
msgstr "Licence"
|
||||
|
||||
msgid "Requirements"
|
||||
msgstr "Requirements"
|
||||
|
||||
msgid "Authors"
|
||||
msgstr "Author(s)"
|
||||
|
||||
msgid "php"
|
||||
msgstr "PHP version"
|
||||
|
||||
msgid "forkbb"
|
||||
msgstr "ForkBB revision"
|
||||
|
||||
msgid "Not installed"
|
||||
msgstr "Not installed"
|
||||
|
||||
msgid "Disabled"
|
||||
msgstr "Disabled"
|
||||
|
||||
msgid "Disabled, package changed"
|
||||
msgstr "Disabled, package changed"
|
||||
|
||||
msgid "Enabled"
|
||||
msgstr "Enabled"
|
||||
|
||||
msgid "Enabled, package changed"
|
||||
msgstr "Enabled, but package changed!"
|
||||
|
||||
msgid "Crash"
|
||||
msgstr "Crash, package not found!"
|
|
@ -86,3 +86,6 @@ msgstr "Антиспам"
|
|||
|
||||
msgid "Maintenance only"
|
||||
msgstr "Доступно только в режиме обслуживания."
|
||||
|
||||
msgid "Extensions"
|
||||
msgstr "Расширения"
|
||||
|
|
61
app/lang/ru/admin_extensions.po
Normal file
61
app/lang/ru/admin_extensions.po
Normal file
|
@ -0,0 +1,61 @@
|
|||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"Project-Id-Version: ForkBB\n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: ForkBB <mio.visman@yandex.ru>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ru\n"
|
||||
|
||||
msgid "Details"
|
||||
msgstr "Подробности"
|
||||
|
||||
msgid "Name"
|
||||
msgstr "Имя пакета"
|
||||
|
||||
msgid "Description"
|
||||
msgstr "Описание"
|
||||
|
||||
msgid "Release date"
|
||||
msgstr "Дата выпуска"
|
||||
|
||||
msgid "Homepage"
|
||||
msgstr "Домашняя страница"
|
||||
|
||||
msgid "Licence"
|
||||
msgstr "Лицензия"
|
||||
|
||||
msgid "Requirements"
|
||||
msgstr "Требования"
|
||||
|
||||
msgid "Authors"
|
||||
msgstr "Автор(ы)"
|
||||
|
||||
msgid "php"
|
||||
msgstr "Версия PHP"
|
||||
|
||||
msgid "forkbb"
|
||||
msgstr "Ревизия ForkBB"
|
||||
|
||||
msgid "Not installed"
|
||||
msgstr "Не установлено"
|
||||
|
||||
msgid "Disabled"
|
||||
msgstr "Выключено"
|
||||
|
||||
msgid "Disabled, package changed"
|
||||
msgstr "Выключено, пакет изменен"
|
||||
|
||||
msgid "Enabled"
|
||||
msgstr "Включено"
|
||||
|
||||
msgid "Enabled, package changed"
|
||||
msgstr "Включено, но пакет изменен!"
|
||||
|
||||
msgid "Crash"
|
||||
msgstr "Сломано, пакет не найден!"
|
113
app/templates/_default/admin/extensions.forkbb.php
Normal file
113
app/templates/_default/admin/extensions.forkbb.php
Normal file
|
@ -0,0 +1,113 @@
|
|||
@extends ('layouts/admin')
|
||||
@isset ($p->extensions)
|
||||
<section id="fork-extsinfo" class="f-admin">
|
||||
<h2>{!! __('Extensions') !!}</h2>
|
||||
<div>
|
||||
<fieldset>
|
||||
<ol>
|
||||
@foreach ($p->extensions as $ext)
|
||||
<li class="f-extli f-ext-status{{ $ext->status }}">
|
||||
<details class="f-extdtl">
|
||||
<summary class="f-extsu">
|
||||
<span>{{ $ext->dispalyName }}</span>
|
||||
-
|
||||
<span>{{ $ext->version }}</span>
|
||||
<span>/
|
||||
@switch ($ext->status)
|
||||
@case ($ext::NOT_INSTALLED)
|
||||
{!! __('Not installed') !!}
|
||||
@break
|
||||
@case ($ext::DISABLED)
|
||||
{!! __('Disabled') !!}
|
||||
@break
|
||||
@case ($ext::DISABLED_DOWN)
|
||||
@case ($ext::DISABLED_UP)
|
||||
{!! __('Disabled, package changed') !!}
|
||||
@break
|
||||
@case ($ext::ENABLED)
|
||||
{!! __('Enabled') !!}
|
||||
@break
|
||||
@case ($ext::ENABLED_DOWN)
|
||||
@case ($ext::ENABLED_UP)
|
||||
{!! __('Enabled, package changed') !!}
|
||||
@break
|
||||
@case ($ext::CRASH)
|
||||
{!! __('Crash') !!}
|
||||
@break
|
||||
@endswitch
|
||||
/<span>
|
||||
</summary>
|
||||
<div class="f-extdata f-fdiv">
|
||||
<fieldset class="f-extfs-details">
|
||||
<legend class="f-fleg">{!! __('Details') !!}</legend>
|
||||
<dl>
|
||||
<dt>{!! __('Name') !!}</dt>
|
||||
<dd>{{ $ext->name }}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{!! __('Description') !!}</dt>
|
||||
<dd>{{ $ext->description }}</dd>
|
||||
</dl>
|
||||
@if ($ext->time)
|
||||
<dl>
|
||||
<dt>{!! __('Release date') !!}</dt>
|
||||
<dd>{{ $ext->time }}</dd>
|
||||
</dl>
|
||||
@endif
|
||||
@if ($ext->homepage)
|
||||
<dl>
|
||||
<dt>{!! __('Homepage') !!}</dt>
|
||||
<dd><a href="{{ url($ext->homepage) }}">{{ $ext->homepage }}</a></dd>
|
||||
</dl>
|
||||
@endif
|
||||
@if ($ext->license)
|
||||
<dl>
|
||||
<dt>{!! __('Licence') !!}</dt>
|
||||
<dd>{{ $ext->license }}</dd>
|
||||
</dl>
|
||||
@endif
|
||||
</fieldset>
|
||||
<fieldset class="f-extfs-requirements">
|
||||
<legend class="f-fleg">{!! __('Requirements') !!}</legend>
|
||||
@foreach ($ext->requirements as $k => $v)
|
||||
<dl>
|
||||
<dt>{!! __($k) !!}</dt>
|
||||
<dd>{{ $v }}</dd>
|
||||
</dl>
|
||||
@endforeach
|
||||
</fieldset>
|
||||
<fieldset class="f-extfs-authors">
|
||||
<legend class="f-fleg">{!! __('Authors') !!}</legend>
|
||||
@foreach ($ext->authors as $author)
|
||||
<dl>
|
||||
<dd class="f-extdd-author">
|
||||
<span>{{ $author['name'] }}</span>
|
||||
@if (! empty($author['email']) || ! empty($author['homepage']))
|
||||
(
|
||||
@if ($author['email'])
|
||||
<a href="{{ url('mailto:'.$author['email']) }}">{{ $author['email'] }}</a>
|
||||
@endif
|
||||
@if ($author['homepage'])
|
||||
@if ($author['email'])
|
||||
|
|
||||
@endif
|
||||
<a href="{{ url($author['homepage']) }}">{{ $author['homepage'] }}</a>
|
||||
@endif
|
||||
)
|
||||
@endif
|
||||
@if ($author['role'])
|
||||
[ {{ $author['role'] }} ]
|
||||
@endif
|
||||
</dd>
|
||||
</dl>
|
||||
@endforeach
|
||||
</fieldset>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
@endforeach
|
||||
</ol>
|
||||
</fieldset>
|
||||
</div>
|
||||
</section>
|
||||
@endisset
|
|
@ -1,5 +1,5 @@
|
|||
#forka {
|
||||
--c-log-in-c: hsl(220,5%,12%);
|
||||
--c-log-in-c: hsl(0,0%,0%);
|
||||
}
|
||||
|
||||
/******************/
|
||||
|
@ -1056,9 +1056,9 @@
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
#fork #fork-logview summary.f-lgsu {
|
||||
/*#fork #fork-logview summary.f-lgsu {
|
||||
margin: 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
#fork #fork-logview summary.f-lgsu::after {
|
||||
content: none;
|
||||
|
@ -1269,3 +1269,61 @@
|
|||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************/
|
||||
/* Админка/РАсширения */
|
||||
/****************************************/
|
||||
#fork #fork-extsinfo summary.f-extsu::after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-extli:first-child {
|
||||
border-top: 0.0625rem dotted var(--br-fprimary);
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-extli {
|
||||
border-bottom: 0.0625rem dotted var(--br-fprimary);
|
||||
padding: 0.625rem;
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-extsu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-extdata {
|
||||
color: var(--c-fprimary);
|
||||
border: 0.0625rem solid var(--br-fprimary);
|
||||
padding: 0.3125rem;
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-extdd-author {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-ext-status0 {
|
||||
color: var(--c-log-in-c);
|
||||
background-color: #90CAF9;
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-ext-status4,
|
||||
#fork-extsinfo .f-ext-status5,
|
||||
#fork-extsinfo .f-ext-status6 {
|
||||
color: var(--c-log-in-c);
|
||||
background-color: #1976D2;
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-ext-status8 {
|
||||
color: var(--c-log-in-c);
|
||||
background-color: #4CAF50;
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-ext-status9,
|
||||
#fork-extsinfo .f-ext-status10 {
|
||||
color: var(--c-log-in-c);
|
||||
background-color: #FF5722;
|
||||
}
|
||||
|
||||
#fork-extsinfo .f-ext-status12 {
|
||||
color: var(--c-log-in-c);
|
||||
background-color: #B71C1C;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue