Plugin Manager, install belum

This commit is contained in:
Ibnu Maksum 2023-01-31 14:26:49 +07:00
parent d526ceb6bc
commit 976300bac7
No known key found for this signature in database
GPG key ID: 7FC82848810579E5
4 changed files with 96 additions and 3 deletions

View file

@ -0,0 +1,33 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', $_L['Plugin Manager']);
$ui->assign('_system_menu', 'settings');
$action = $routes['1'];
$admin = Admin::_info();
$ui->assign('_admin', $admin);
if ($admin['user_type'] != 'Admin') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
switch ($action) {
default:
$cache = 'system/cache/plugin_repository.json';
if (file_exists($cache) && time() - filemtime($cache) > (24 * 60 * 60)) {
$json = json_decode(file_get_contents($cache), true);
}
$data = file_get_contents('https://hotspotbilling.github.io/Plugin-Repository/repository.json');
file_put_contents($cache, $data);
$json = json_decode($data, true);
$ui->assign('plugins', $json['plugins']);
$ui->assign('pgs', $json['payment_gateway']);
$ui->display('plugin-manager.tpl');
}

View file

@ -306,3 +306,6 @@ $_L['Verification_Code'] = 'Verification Code';
$_L['SMS_Verification_Code'] = 'SMS Verification Code';
$_L['Please_enter_your_email_address'] = 'Please enter your email address';
$_L['Failed_to_create_Paypal_transaction'] = 'Failed to create Paypal transaction.';
$_L['Plugin'] = 'Plugin';
$_L['Plugin_Manager'] = 'Plugin Manager';
$_L['Plugin_Manager'] = 'Plugin Manager';

55
ui/ui/plugin-manager.tpl Normal file
View file

@ -0,0 +1,55 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel panel-primary panel-hovered">
<div class="panel-heading">{Lang::T('Plugin')}</div>
<div class="panel-body row">
{foreach $plugins as $plugin}
<div class="col-md-4">
<div class="box box-hovered mb20 box-primary">
<div class="box-header">
<h3 class="box-title">{$plugin['name']}</h3>
</div>
<div class="box-body">{$plugin['description']}<br><small><i>@{$plugin['author']} Last update: {$plugin['last_update']}</i></small></div>
<div class="box-footer ">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$plugin['url']}" target="_blank"
class="btn btn-primary"><i class="ion ion-chatboxes"></i> Website</a>
<a href="{$plugin['github']}" target="_blank"
class="btn btn-success"><i class="ion ion-chatboxes"></i> Github</a>
<a href="{$_url}pluginmanager/?install={$plugin['id']}"
class="btn btn-warning"><i class="ion ion-chatboxes"></i> Install</a>
</div>
</div>
</div>
</div>
{/foreach}
</div>
</div>
<div class="panel panel-primary panel-hovered">
<div class="panel-heading">{Lang::T('Payment Gateway')}</div>
<div class="panel-body row">
{foreach $pgs as $pg}
<div class="col-md-4">
<div class="box box-hovered mb20 box-primary">
<div class="box-header">
<h3 class="box-title">{$pg['name']}</h3>
</div>
<div class="box-body">{$pg['description']}<br><small><i>@{$plugin['author']} Last update: {$plugin['last_update']}</i></small></div>
<div class="box-footer ">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$pg['url']}" target="_blank"
class="btn btn-primary"><i class="ion ion-chatboxes"></i> Website</a>
<a href="{$pg['github']}" target="_blank"
class="btn btn-success"><i class="ion ion-chatboxes"></i> Github</a>
<a href="{$_url}pluginmanager/?install={$pg['id']}"
class="btn btn-warning"><i class="ion ion-chatboxes"></i> Install</a>
</div>
</div>
</div>
</div>
{/foreach}
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View file

@ -163,7 +163,7 @@
{$_MENU_AFTER_REPORTS}
{/if}
{if $_admin['user_type'] eq 'Admin'}
<li class="{if $_system_menu eq 'network'}active{/if} treeview">
<li class="{if $_system_menu eq 'network'}active{/if} treeview">
<a href="#">
<i class="ion ion-network"></i> <span>{$_L['Network']}</span>
<span class="pull-right-container">
@ -215,6 +215,8 @@
href="{$_url}settings/users">{$_L['Administrator_Users']}</a></li>
<li {if $_routes[1] eq 'dbstatus'}class="active" {/if}><a
href="{$_url}settings/dbstatus">{$_L['Backup_Restore']}</a></li>
<li {if $_routes[1] eq 'dbstatus'}class="active" {/if}><a
href="{$_url}pluginmanager">{Lang::T('Plugin Manager')}</a></li>
{$_MENU_SETTINGS}
</ul>
</li>
@ -240,9 +242,9 @@
<div class="content-wrapper">
<section class="content-header">
<h1>
{$_title}
{$_title}
</h1>
</section>
<section class="content">
{if isset($notify)}{$notify}{/if}
{if isset($notify)}{$notify}{/if}