diff --git a/app/Http/Controllers/Admin/AdminFailedReleasesController.php b/app/Http/Controllers/Admin/AdminFailedReleasesController.php index 710a43909..ca55812e0 100644 --- a/app/Http/Controllers/Admin/AdminFailedReleasesController.php +++ b/app/Http/Controllers/Admin/AdminFailedReleasesController.php @@ -10,18 +10,11 @@ class AdminFailedReleasesController extends BasePageController /** * @throws \Exception */ - public function index(): void + public function index() { - $this->setAdminPrefs(); + $title = 'Failed Releases List'; + $releaselist = Release::getFailedRange(); - $meta_title = $title = 'Failed Releases List'; - - $frellist = Release::getFailedRange(); - $this->smarty->assign('releaselist', $frellist); - - $content = $this->smarty->fetch('failrel-list.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - $this->adminrender(); + return view('admin.failrel-list', compact('title', 'releaselist')); } } diff --git a/app/Http/Controllers/Admin/AdminGroupController.php b/app/Http/Controllers/Admin/AdminGroupController.php index 6480da18d..00c6b07be 100644 --- a/app/Http/Controllers/Admin/AdminGroupController.php +++ b/app/Http/Controllers/Admin/AdminGroupController.php @@ -11,66 +11,42 @@ class AdminGroupController extends BasePageController /** * @throws \Exception */ - public function index(Request $request): void + public function index(Request $request) { - $this->setAdminPrefs(); + $groupname = $request->input('groupname') ?? ''; + $grouplist = UsenetGroup::getGroupsRange($groupname); + $title = 'Group List'; - $groupName = $request->input('groupname') ?? ''; - - $this->smarty->assign( - [ - 'groupname' => $groupName, - 'grouplist' => UsenetGroup::getGroupsRange($groupName), - ] - ); - - $meta_title = $title = 'Group List'; - $content = $this->smarty->fetch('group-list.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.group-list', compact('title', 'groupname', 'grouplist')); } /** * @throws \Exception */ - public function createBulk(Request $request): void + public function createBulk(Request $request) { - $this->setAdminPrefs(); - // set the current action $action = $request->input('action') ?? 'view'; + $groupmsglist = ''; if ($action === 'submit') { if ($request->has('groupfilter') && ! empty($request->input('groupfilter'))) { - $msgs = UsenetGroup::addBulk($request->input('groupfilter'), $request->input('active'), $request->input('backfill')); + $groupmsglist = UsenetGroup::addBulk($request->input('groupfilter'), $request->input('active'), $request->input('backfill')); } - } else { - $msgs = ''; } - $this->smarty->assign('groupmsglist', $msgs); - $this->smarty->assign('yesno_ids', [1, 0]); - $this->smarty->assign('yesno_names', ['Yes', 'No']); + $title = 'Bulk Add Newsgroups'; - $meta_title = $title = 'Bulk Add Newsgroups'; - $content = $this->smarty->fetch('group-bulk.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.group-bulk', compact('title', 'groupmsglist')); } /** - * @return \Illuminate\Http\RedirectResponse|void + * @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View * * @throws \Exception */ public function edit(Request $request) { - $this->setAdminPrefs(); - // Set the current action. $action = $request->input('action') ?? 'view'; @@ -105,82 +81,51 @@ class AdminGroupController extends BasePageController case 'view': default: - $meta_title = $title = 'Group Edit'; + $title = 'Group Edit'; if ($request->has('id')) { - $meta_title = $title = 'Newsgroup Edit'; + $title = 'Newsgroup Edit'; $id = $request->input('id'); $group = UsenetGroup::getGroupByID($id); } else { - $meta_title = $title = 'Newsgroup Add'; + $title = 'Newsgroup Add'; } break; } - $this->smarty->assign('yesno_ids', [1, 0]); - $this->smarty->assign('yesno_names', ['Yes', 'No']); - - $this->smarty->assign('group', $group); - - $content = $this->smarty->fetch('group-edit.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.group-edit', compact('title', 'group')); } /** * @throws \Exception */ - public function active(Request $request): void + public function active(Request $request) { - $this->setAdminPrefs(); $gname = ''; if (! empty($request->input('groupname'))) { $gname = $request->input('groupname'); } $groupname = ! empty($request->input('groupname')) ? $request->input('groupname') : ''; - - $this->smarty->assign('groupname', $groupname); - $grouplist = UsenetGroup::getGroupsRange($gname, true); + $title = 'Active Groups'; - $this->smarty->assign('grouplist', $grouplist); - - $meta_title = $title = 'Group List'; - - $content = $this->smarty->fetch('group-list.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.group-list', compact('title', 'groupname', 'grouplist')); } /** * @throws \Exception */ - public function inactive(Request $request): void + public function inactive(Request $request) { - $this->setAdminPrefs(); $gname = ''; if (! empty($request->input('groupname'))) { $gname = $request->input('groupname'); } $groupname = ! empty($request->input('groupname')) ? $request->input('groupname') : ''; - - $this->smarty->assign('groupname', $groupname); - $grouplist = UsenetGroup::getGroupsRange($gname, false); + $title = 'Inactive Groups'; - $this->smarty->assign('grouplist', $grouplist); - - $meta_title = $title = 'Group List'; - - $content = $this->smarty->fetch('group-list.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.group-list', compact('title', 'groupname', 'grouplist')); } } diff --git a/resources/views/admin/failrel-list.blade.php b/resources/views/admin/failrel-list.blade.php new file mode 100644 index 000000000..f6af3cca7 --- /dev/null +++ b/resources/views/admin/failrel-list.blade.php @@ -0,0 +1,160 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Failed Releases List') + +@section('content') +
+
+
+

{{ $title }}

+ + View All Releases + +
+
+ +
+
+
+
+
+ + +
+
+
+
+ + @if($releaselist && $releaselist->count() > 0) +
+ + + + + + + + + + + + + + + @foreach($releaselist as $release) + + + + + + + + + + + @endforeach + +
NameCategorySizeFilesPost DateAdd DateGrabsActions
+ + {{ $release->searchname }} + + + {{ $release->category_name ?? 'Unknown' }} + + {{ human_filesize($release->size) }} + + + {{ $release->totalpart ?? 0 }} + + +
+ + {{ \Carbon\Carbon::parse($release->postdate)->format('Y-m-d H:i') }} +
+
+
+ + {{ \Carbon\Carbon::parse($release->adddate)->format('Y-m-d H:i') }} +
+
+ + {{ $release->grabs ?? 0 }} + + +
+ + + + @if($release->guid) + + + + @endif + + + +
+
+
+ @else +
+ No failed releases available. +
+ @endif +
+ + @if($releaselist && $releaselist->count() > 0) + + @endif +
+ + + + +@endsection + diff --git a/resources/views/admin/group-bulk.blade.php b/resources/views/admin/group-bulk.blade.php new file mode 100644 index 000000000..132e0fb7b --- /dev/null +++ b/resources/views/admin/group-bulk.blade.php @@ -0,0 +1,186 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Bulk Add Newsgroups') + +@section('content') +
+
+
+

{{ $title }}

+ + View All Groups + +
+
+ +
+ @if(!empty($groupmsglist)) +
+ + The following groups have been processed. You can now view them in the group list. +
+ +
+ + + + + + + + + @foreach($groupmsglist as $group) + + + + + @endforeach + +
GroupStatus
+
+ + {{ $group['group'] }} +
+
+ @if(strpos($group['msg'], 'Error') !== false) + + {{ $group['msg'] }} + + @elseif(strpos($group['msg'], 'exists') !== false) + + {{ $group['msg'] }} + + @else + + {{ $group['msg'] }} + + @endif +
+
+ @else +
+ + Enter a regular expression to match multiple groups for bulk addition to the system. +
+ +
+ @csrf +
+
+ +
+
+
+ + +
+ + A regular expression to match against group names. Separate multiple patterns with the pipe symbol (|). +
Example: alt.binaries.cd.image.linux|alt.binaries.warez.linux +
+
+
+ +
+
+ +
+
+
+ + +
+
+ + +
+
+ Inactive groups will not have headers downloaded for them. +
+
+
+ +
+
+ +
+
+
+ + +
+
+ + +
+
+ Inactive groups will not have backfill headers downloaded for them. +
+
+
+
+ @endif +
+ + +
+ + + + +@endsection + diff --git a/resources/views/admin/group-edit.blade.php b/resources/views/admin/group-edit.blade.php new file mode 100644 index 000000000..3c77b80f3 --- /dev/null +++ b/resources/views/admin/group-edit.blade.php @@ -0,0 +1,189 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Group Edit') + +@section('content') +
+
+
+

{{ $title }}

+ + Back to Groups + +
+
+ + @if(isset($error) && $error != '') +
+ {{ $error }} +
+ @endif + +
+
+ @csrf + + +
+
+ +
+
+
+ + +
+ Changing the name to an invalid group will break things. +
+
+ +
+
+ +
+
+
+ + +
+ Brief explanation of this group's content +
+
+ +
+
+ +
+
+
+ + +
+ Number of days to attempt to backfill this group. Adjust as necessary. +
+
+ +
+
+ +
+
+
+ + +
+ The minimum number of files to make a release. If left blank, will use the site wide setting. +
+
+ +
+
+ +
+
+
+ + +
+ The minimum total size in bytes to make a release. If left blank, will use the site wide setting. +
+
+ +
+
+ +
+
+
+ + +
+ The oldest record number for the group. +
+
+ +
+
+ +
+
+
+ + +
+ The newest record number for the group. +
+
+ +
+
+ +
+
+
+ + +
+
+ + +
+
+ Inactive groups will not have headers downloaded for them. +
+
+
+ +
+
+ +
+
+
+ + +
+
+ + +
+
+ If set to No, backfill will ignore this group. This works even if the above setting is No. +
+
+
+
+
+ + +
+ + +@endsection + diff --git a/resources/views/admin/group-list.blade.php b/resources/views/admin/group-list.blade.php new file mode 100644 index 000000000..20c65bb36 --- /dev/null +++ b/resources/views/admin/group-list.blade.php @@ -0,0 +1,373 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Group List') + +@section('content') +
+
+ +
+ +
+
+ + Below is a list of all usenet groups available to be indexed. Click 'Activate' to start indexing a group. + Backfill works independently of active. +
+ + @if(isset($msg) && $msg != '') +
{{ $msg }}
+ @endif + + @if($grouplist && $grouplist->count() > 0) +
+
+
+
+ + + +
+
+
+
+
+ {{ $grouplist->onEachSide(5)->links() }} +
+
+
+
+ + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + @foreach($grouplist as $group) + + + + + + + + + + + + + + @endforeach + +
GroupFirst PostLast PostLast UpdatedStatusBackfillReleasesMin FilesMin SizeBackfill DaysActions
+ {{ str_replace('alt.binaries', 'a.b', $group->name) }} + @if($group->description) +
{{ $group->description }}
+ @endif +
+
+ {{ $group->first_record_postdate }} + {{ \Carbon\Carbon::parse($group->first_record_postdate)->diffForHumans() }} +
+
{{ $group->last_record_postdate }} + {{ \Carbon\Carbon::parse($group->last_updated)->diffForHumans() }} + + @if($group->active == 1) + + @else + + @endif + + @if($group->backfill == 1) + + @else + + @endif + + {{ $group->num_releases ?? 0 }} + + @if(empty($group->minfilestoformrelease)) + n/a + @else + {{ $group->minfilestoformrelease }} + @endif + + @if(empty($group->minsizetoformrelease)) + n/a + @else + {{ human_filesize($group->minsizetoformrelease) }} + @endif + + {{ $group->backfill_target }} + +
+ + + + + + +
+
+
+ @else +
+ No groups available (eg. none have been added). +
+ @endif +
+ + @if($grouplist && $grouplist->count() > 0) + + @endif +
+ + + + + + + + +@endsection + diff --git a/resources/views/partials/admin-menu.blade.php b/resources/views/partials/admin-menu.blade.php index 7123e3c7f..f0f4f2220 100644 --- a/resources/views/partials/admin-menu.blade.php +++ b/resources/views/partials/admin-menu.blade.php @@ -47,7 +47,7 @@ @@ -82,6 +82,23 @@ + +
+ + +
+