mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
net/relayd: use ControllerBase; status tooltips
This commit is contained in:
parent
3d852798e8
commit
b17d57ef3d
3 changed files with 7 additions and 5 deletions
|
|
@ -3,6 +3,6 @@ PLUGIN_VERSION= 2.0.d
|
|||
PLUGIN_DEPENDS= relayd
|
||||
PLUGIN_COMMENT= Relayd Load Balancer
|
||||
PLUGIN_MAINTAINER= frank.brendel@eurolog.com
|
||||
PLUGIN_REVISION= 1
|
||||
PLUGIN_REVISION= 2
|
||||
|
||||
.include "../../Mk/plugins.mk"
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
namespace OPNsense\Relayd\Api;
|
||||
|
||||
use \OPNsense\Base\ApiMutableModelControllerBase;
|
||||
use \OPNsense\Base\ApiControllerBase;
|
||||
use \OPNsense\Core\Config;
|
||||
use \OPNsense\Relayd\Relayd;
|
||||
use \OPNsense\Base\UIModelGrid;
|
||||
|
|
@ -39,7 +39,7 @@ use \OPNsense\Base\UIModelGrid;
|
|||
* Class SettingsController
|
||||
* @package OPNsense\Relayd
|
||||
*/
|
||||
class SettingsController extends ApiMutableModelControllerBase
|
||||
class SettingsController extends ApiControllerBase
|
||||
{
|
||||
|
||||
static protected $internalModelName = 'relayd';
|
||||
|
|
|
|||
|
|
@ -101,10 +101,12 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
if (status.substring(0, 6) === 'active' || status === 'up') {
|
||||
statusClass += "btn-success glyphicon-play";
|
||||
controlClass += "glyphicon-stop";
|
||||
controlTitle = "Stop this " + nodeType;
|
||||
action = 'onclick="toggleNode(\'' + nodeType + '\', ' + id + ', \'disable\')""';
|
||||
} else if (status === 'disabled') {
|
||||
statusClass += "btn-danger glyphicon-stop";
|
||||
controlClass += "glyphicon-play";
|
||||
controlTitle = "Start this " + nodeType;
|
||||
action = 'onclick="toggleNode(\'' + nodeType + '\', ' + id + ', \'enable\')"';
|
||||
} else {
|
||||
statusClass += "btn-danger glyphicon-stop";
|
||||
|
|
@ -115,8 +117,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
if (nodeType === 'relay') {
|
||||
action = 'disabled="disabled"';
|
||||
}
|
||||
var html = '<span class="' + statusClass + '"> </span> ';
|
||||
html += '<span ' + action + ' class="' + controlClass + '"> </span> ';
|
||||
var html = '<span class="' + statusClass + '" style="cursor: default;"> </span> ';
|
||||
html += '<span ' + action + ' class="' + controlClass + '" title="' + controlTitle + '"> </span> ';
|
||||
return html;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue