Add Device to Plugin Manager

This commit is contained in:
Ibnu Maksum 2024-08-08 15:35:40 +07:00
parent 7fccf95eb0
commit d19cdf3897
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
2 changed files with 133 additions and 81 deletions

View File

@ -329,7 +329,7 @@ switch ($action) {
File::copyFolder($folder, $DEVICE_PATH . DIRECTORY_SEPARATOR, ['README.md', 'LICENSE']); File::copyFolder($folder, $DEVICE_PATH . DIRECTORY_SEPARATOR, ['README.md', 'LICENSE']);
File::deleteFolder($folder); File::deleteFolder($folder);
unlink($file); unlink($file);
r2(U . "paymentgateway", 's', 'Payment Gateway ' . $plugin . ' has been installed'); r2(U . "settings/devices", 's', 'Device ' . $plugin . ' has been installed');
break; break;
} }
} }
@ -344,6 +344,7 @@ switch ($action) {
$ui->assign('zipExt', $zipExt); $ui->assign('zipExt', $zipExt);
$ui->assign('plugins', $json['plugins']); $ui->assign('plugins', $json['plugins']);
$ui->assign('pgs', $json['payment_gateway']); $ui->assign('pgs', $json['payment_gateway']);
$ui->assign('dvcs', $json['devices']);
$ui->display('plugin-manager.tpl'); $ui->display('plugin-manager.tpl');
} }

View File

@ -1,5 +1,10 @@
{include file="sections/header.tpl"} {include file="sections/header.tpl"}
{if empty($_c['github_token'])}
<p class="help-block">To download from private/paid repository, <a href="{$_url}settings/app#Github_Authentication">Set
your Github Authentication first</a></p>
{/if}
<form method="post" enctype="multipart/form-data" <form method="post" enctype="multipart/form-data"
onsubmit="return confirm('Warning, installing unknown source can damage your server, continue?')" onsubmit="return confirm('Warning, installing unknown source can damage your server, continue?')"
action="{$_url}pluginmanager/dlinstall"> action="{$_url}pluginmanager/dlinstall">
@ -7,9 +12,11 @@
<div class="panel-heading"> <div class="panel-heading">
{Lang::T('Plugin Installer')} {Lang::T('Plugin Installer')}
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<a class="btn btn-warning btn-xs" title="save" <a class="btn btn-warning btn-xs" title="info"
href="https://github.com/hotspotbilling/phpnuxbill/wiki/Installing-Plugin-or-Payment-Gateway" href="https://github.com/hotspotbilling/phpnuxbill/wiki/Installing-Plugin-or-Payment-Gateway"
target="_blank"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></a> target="_blank"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> info</a>
<a class="btn btn-success btn-xs" title="refresh cache" href="{$_url}pluginmanager/refresh"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> refresh</a>
</div> </div>
</div> </div>
<div class="panel-body row"> <div class="panel-body row">
@ -30,17 +37,21 @@
</div> </div>
</form> </form>
<p class="help-block">To download from private/paid repository, <a href="{$_url}settings/app#Github_Authentication">Set <div>
your Github Authentication first</a></p> <!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<div class="panel panel-primary panel-hovered"> <li role="presentation" class="active"><a href="#plugin" aria-controls="plugin" role="tab"
<div class="panel-heading">{Lang::T('Plugin')} data-toggle="tab">Plugin</a></li>
<div class="btn-group pull-right"> <li role="presentation"><a href="#pg" aria-controls="pg" role="tab" data-toggle="tab">Payment Gateway</a>
<a class="btn btn-success btn-xs" title="refresh cache" href="{$_url}pluginmanager/refresh"><span </li>
class="glyphicon glyphicon-refresh" aria-hidden="true"></span></a> <li role="presentation"><a href="#device" aria-controls="device" role="tab" data-toggle="tab">Devices</a>
</div> </li>
</div> </ul>
<div class="panel-body row"> <br>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="plugin">
<div class="row">
{foreach $plugins as $plugin} {foreach $plugins as $plugin}
<div class="col-md-4"> <div class="col-md-4">
<div class="box box-hovered mb20 box-primary"> <div class="box box-hovered mb20 box-primary">
@ -54,10 +65,12 @@
<center><small><i>@{$plugin['author']} Last update: {$plugin['last_update']}</i></small> <center><small><i>@{$plugin['author']} Last update: {$plugin['last_update']}</i></small>
</center> </center>
<div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$plugin['url']}" target="_blank" style="color: black;" class="btn btn-{if $plugin['ispaid']}warning{else}primary{/if}"><i <a href="{$plugin['url']}" target="_blank" style="color: black;"
class="glyphicon glyphicon-globe"></i> {if $plugin['ispaid']}Buy{else}Web{/if}</a> class="btn btn-{if $plugin['ispaid']}warning{else}primary{/if}"><i
<a href="{$plugin['github']}" target="_blank" style="color: black;" class="btn btn-info"><i class="glyphicon glyphicon-globe"></i>
class="glyphicon glyphicon-align-left"></i> Source</a> {if $plugin['ispaid']}Buy{else}Web{/if}</a>
<a href="{$plugin['github']}" target="_blank" style="color: black;"
class="btn btn-info"><i class="glyphicon glyphicon-align-left"></i> Source</a>
</div> </div>
<div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}pluginmanager/delete/plugin/{$plugin['id']}" <a href="{$_url}pluginmanager/delete/plugin/{$plugin['id']}"
@ -76,9 +89,8 @@
{/foreach} {/foreach}
</div> </div>
</div> </div>
<div class="panel panel-primary panel-hovered"> <div role="tabpanel" class="tab-pane" id="pg">
<div class="panel-heading">{Lang::T('Payment Gateway')}</div> <div class="row">
<div class="panel-body row">
{foreach $pgs as $pg} {foreach $pgs as $pg}
<div class="col-md-4"> <div class="col-md-4">
<div class="box box-hovered mb20 box-primary"> <div class="box box-hovered mb20 box-primary">
@ -89,7 +101,8 @@
<div style="max-height: 50px; min-height: 50px;">{$pg['description']}</div> <div style="max-height: 50px; min-height: 50px;">{$pg['description']}</div>
</div> </div>
<div class="box-footer "> <div class="box-footer ">
<center><small><i>@{$pg['author']} Last update: {$pg['last_update']}</i></small></center> <center><small><i>@{$pg['author']} Last update: {$pg['last_update']}</i></small>
</center>
<div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$pg['url']}" target="_blank" style="color: black;" <a href="{$pg['url']}" target="_blank" style="color: black;"
class="btn btn-{if $pg['ispaid']}warning{else}primary{/if}"><i class="btn btn-{if $pg['ispaid']}warning{else}primary{/if}"><i
@ -111,4 +124,42 @@
{/foreach} {/foreach}
</div> </div>
</div> </div>
<div role="tabpanel" class="tab-pane" id="device">
<div class="row">
{foreach $dvcs as $dvc}
<div class="col-md-4">
<div class="box box-hovered mb20 box-primary">
<div class="box-header">
<h3 class="box-title text1line">{$dvc['name']}</h3>
</div>
<div class="box-body" style="overflow-y: scroll;">
<div style="max-height: 50px; min-height: 50px;">{$dvc['description']}</div>
</div>
<div class="box-footer ">
<center><small><i>@{$dvc['author']} Last update: {$dvc['last_update']}</i></small>
</center>
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$dvc['url']}" target="_blank" style="color: black;"
class="btn btn-{if $dvc['ispaid']}warning{else}primary{/if}"><i
class="glyphicon glyphicon-globe"></i>
{if $dvc['ispaid']}Buy{else}Web{/if}
</a>
<a href="{$dvc['github']}" target="_blank" style="color: black;" class="btn btn-info"><i
class="glyphicon glyphicon-align-left"></i> Source</a>
<a {if $zipExt } href="{$_url}pluginmanager/install/device/{$dvc['id']}"
onclick="return confirm('Installing plugin will take some time to complete, do not close the page while it loading to install the plugin')"
{else} href="#" onclick="alert('PHP ZIP extension is not available')"
{/if}
style="color: black;" class="btn btn-success"><i
class="glyphicon glyphicon-circle-arrow-down"></i> Install</a>
</div>
</div>
</div>
</div>
{/foreach}
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"} {include file="sections/footer.tpl"}