-
-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1693 from RaspAP/feat/plugin-architecture
Plugin architecture to support user add-ons
- Loading branch information
Showing
9 changed files
with
322 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ node_modules | |
yarn-error.log | ||
*.swp | ||
includes/config.php | ||
plugins/ | ||
rootCA.pem | ||
vendor | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,15 @@ | ||
<div class="row g-0"> | ||
<div class="col-4 ms-2 sidebar-brand-icon"> | ||
<img src="app/img/raspAP-logo.php" class="navbar-logo" width="60" height="60"> | ||
</div> | ||
<div class="col ml-2"> | ||
<div class="ml-1 sb-status">Status</div> | ||
<div class="info-item-xs"><span class="icon"> | ||
<i class="fas fa-circle <?php echo ($hostapd_led); ?>"></i></span> <?php echo _("Hotspot").' '. _($hostapd_status); ?> | ||
</div> | ||
<div class="info-item-xs"><span class="icon"> | ||
<i class="fas fa-circle <?php echo ($memused_led); ?>"></i></span> <?php echo _("Mem Use").': '. htmlspecialchars(strval($memused), ENT_QUOTES); ?>% | ||
</div> | ||
<div class="info-item-xs"><span class="icon"> | ||
<i class="fas fa-circle <?php echo ($cputemp_led); ?>"></i></span> <?php echo _("CPU").': '. htmlspecialchars($cputemp, ENT_QUOTES); ?>°C | ||
</div> | ||
</div> | ||
</div> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="wlan0_info"><i class="sb-nav-link-icon fa-solid fa-gauge-high fa-fw mr-2"></i><span class="nav-label"><?php echo _("Dashboard"); ?></span></a> | ||
</div> | ||
<?php if (RASPI_HOTSPOT_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="hostapd_conf"><i class="sb-nav-link-icon far fa-dot-circle fa-fw mr-2"></i><span class="nav-label"><?php echo _("Hotspot"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_DHCP_ENABLED && !$_SESSION["bridgedEnabled"]) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="dhcpd_conf"><i class="sb-nav-link-icon fas fa-exchange-alt fa-fw mr-2"></i><span class="nav-label"><?php echo _("DHCP Server"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_ADBLOCK_ENABLED && !$_SESSION["bridgedEnabled"]) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="adblock_conf"><i class="sb-nav-link-icon far fa-hand-paper fa-fw mr-2"></i><span class="nav-label"><?php echo _("Ad Blocking"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_NETWORK_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="network_conf"><i class="sb-nav-link-icon fas fa-network-wired fa-fw mr-2"></i><span class="nav-label"><?php echo _("Networking"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_WIFICLIENT_ENABLED && !$_SESSION["bridgedEnabled"]) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="wpa_conf"><i class="sb-nav-link-icon fas fa-wifi fa-fw mr-2"></i><span class="nav-label"><?php echo _("WiFi client"); ?></span></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_OPENVPN_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="openvpn_conf"><i class="sb-nav-link-icon fas fa-key fa-fw mr-2"></i><span class="nav-label"><?php echo _("OpenVPN"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_WIREGUARD_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="wg_conf"><i class="sb-nav-link-icon ra-wireguard mr-2"></i><span class="nav-label"><?php echo _("WireGuard"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_VPN_PROVIDER_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="provider_conf"><i class="sb-nav-link-icon fas fa-shield-alt fa-fw mr-2"></i><span class="nav-label"><?php echo _(getProviderValue($_SESSION["providerID"], "name")); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_TORPROXY_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="torproxy_conf"><i class="sb-nav-link-icon fas fa-eye-slash fa-fw mr-2"></i><span class="nav-label"><?php echo _("TOR proxy"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_CONFAUTH_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="auth_conf"><i class="sb-nav-link-icon fas fa-user-lock fa-fw mr-2"></i><span class="nav-label"><?php echo _("Authentication"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_VNSTAT_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="data_use"><i class="sb-nav-link-icon fas fa-chart-area fa-fw mr-2"></i><span class="nav-label"><?php echo _("Data usage"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_RESTAPI_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="restapi_conf"><i class="sb-nav-link-icon fas fa-puzzle-piece mr-2"></i><span class="nav-label"><?php echo _("RestAPI"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<?php if (RASPI_SYSTEM_ENABLED) : ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="system_info"><i class="sb-nav-link-icon fas fa-cube fa-fw mr-2"></i><span class="nav-label"><?php echo _("System"); ?></a> | ||
</div> | ||
<?php endif; ?> | ||
<div class="sb-nav-link-icon px-2"> | ||
<a class="nav-link" href="about"><i class="sb-nav-link-icon fas fa-info-circle fa-fw mr-2"></i><span class="nav-label"><?php echo _("About RaspAP"); ?></a> | ||
</div> | ||
<?php | ||
|
||
use RaspAP\Plugins\PluginManager; | ||
|
||
$pluginManager = PluginManager::getInstance(); | ||
|
||
// Display logo and status LEDs | ||
renderStatus($hostapd_led, $hostapd_status, | ||
$memused_led, $memused, | ||
$cputemp_led, $cputemp); | ||
|
||
// Render sidebar via the PluginManager | ||
$sidebar = $pluginManager->getSidebar(); | ||
$sidebar->render(); | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* Plugin Interface | ||
* | ||
* @description Basic plugin interface for RaspAP | ||
* @author Bill Zimmerman <billzimmerman@gmail.com> | ||
* @license https://github.com/raspap/raspap-webgui/blob/master/LICENSE | ||
* @see | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace RaspAP\Plugins; | ||
|
||
use RaspAP\UI\Sidebar; | ||
|
||
interface PluginInterface | ||
{ | ||
/** | ||
* Initialize the plugin | ||
* @param Sidebar $sidebar Sidebar instance for adding items | ||
*/ | ||
public function initialize(Sidebar $sidebar): void; | ||
|
||
/** | ||
* Render a template within the plugin's template directory | ||
* @param string $templateName | ||
* @param array $__data | ||
* @return string | ||
*/ | ||
public function renderTemplate(string $templateName, array $__data = []): string; | ||
} | ||
|
Oops, something went wrong.