Refactoring of WANavigation and i,plementation of Service Status
This commit is contained in:
parent
e201f9ce4c
commit
b115a9cb4f
14 changed files with 101 additions and 91 deletions
|
|
@ -7,6 +7,7 @@ body{
|
||||||
/*margin-bottom: 30px; /* Margin bottom by footer height */
|
/*margin-bottom: 30px; /* Margin bottom by footer height */
|
||||||
}
|
}
|
||||||
table{
|
table{
|
||||||
|
font-family: sans-serif;
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="col-md-12"><div class="panel panel-default">
|
<div class="col-md-12"><div class="panel panel-default">
|
||||||
<div class="panel-heading">Service Status</div>
|
<div class="panel-heading">Service Status</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<table class="table small hdd-detail">
|
<table class="table hdd-detail">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
<th data-field="service">Service</th>
|
<th data-field="service">Service</th>
|
||||||
<th data-field="status">Status</th>
|
<th data-field="status">Status</th>
|
||||||
|
|
@ -9,14 +9,14 @@
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
{{#services}}
|
{{#services}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{.name}}</td>
|
<td>{{.getName()}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{#.isRunning()}}<span class="label label-success">Running</span>{{/.isRunning()}}
|
{{#.isRunning()}}<span class="label label-success">Running</span>{{/.isRunning()}}
|
||||||
{{#.isUnresponsive()}}<span class="label label-warning">Unresponsive</span>{{/.isUnresponsive()}}
|
{{#.isUnresponsive()}}<span class="label label-warning">Unresponsive</span>{{/.isUnresponsive()}}
|
||||||
{{#.isStopped()}}<span class="label label-danger">Stopped</span>{{/.isStopped()}}
|
{{#.isStopped()}}<span class="label label-danger">Stopped</span>{{/.isStopped()}}
|
||||||
{{#.isUnknown()}}<span class="label label-default">Unknown</span>{{/.isUnknown()}}
|
{{#.isUnknown()}}<span class="label label-default">Unknown</span>{{/.isUnknown()}}
|
||||||
</td>
|
</td>
|
||||||
<td><input type="checkbox" class="switch" checked></td>
|
<td><input type="checkbox" class="switch" data-size="mini" checked></td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/services}}
|
{{/services}}
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@
|
||||||
<script src="js/bootstrap-switch.min.js"></script>
|
<script src="js/bootstrap-switch.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$.(function(){
|
$(function() {
|
||||||
$("input .switch[type='checkbox']").bootstrapSwitch();
|
$(".switch[type='checkbox']").bootstrapSwitch();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
@ -30,21 +30,21 @@
|
||||||
<a class="navbar-brand" href="#">{{title}}</a>
|
<a class="navbar-brand" href="#">{{title}}</a>
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
{{#top-nav}}
|
{{#top-nav}}
|
||||||
{{^.sub_navs.length}}
|
{{^.subNav.length}}
|
||||||
<li><a href="{{.url}}">{{.name}}</a></li>
|
<li><a href="{{.url}}">{{.name}}</a></li>
|
||||||
{{/.sub_navs.length}}
|
{{/.subNav.length}}
|
||||||
{{#.sub_navs.length}}
|
{{#.subNav.length}}
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||||
{{.name}} <b class="caret"></b>
|
{{.name}} <b class="caret"></b>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
{{#.sub_navs}}
|
{{#.subNav}}
|
||||||
<li><a href="{{.url}}">{{.name}}</a></li>
|
<li><a href="{{.url}}">{{.name}}</a></li>
|
||||||
{{/.sub_navs}}
|
{{/.subNav}}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{{/.sub_navs.length}}
|
{{/.subNav.length}}
|
||||||
{{/top-nav}}
|
{{/top-nav}}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
@ -55,21 +55,21 @@
|
||||||
<div id="side-bar" class="col-md-2">
|
<div id="side-bar" class="col-md-2">
|
||||||
<ul class="side-menu nav nav-pills nav-stacked">
|
<ul class="side-menu nav nav-pills nav-stacked">
|
||||||
{{#side-nav}}
|
{{#side-nav}}
|
||||||
{{^.sub_navs.length}}
|
{{^.subNavs.length}}
|
||||||
<li><a href="{{.url}}">{{.name}}</a></li>
|
<li><a href="{{.url}}">{{.name}}</a></li>
|
||||||
{{/.sub_navs.length}}
|
{{/.subNavs.length}}
|
||||||
{{#.sub_nav.length}}
|
{{#.subNav.length}}
|
||||||
<li class="">
|
<li class="">
|
||||||
<a data-toggle="collapse" data-parent="#side-bar" href="#{{.name}}_collapse">
|
<a data-toggle="collapse" data-parent="#side-bar" href="#{{.name}}_collapse">
|
||||||
{{.name}} <b class="caret"></b>
|
{{.name}} <b class="caret"></b>
|
||||||
</a>
|
</a>
|
||||||
<ul id="{{.name}}_collapse" class="side-sub-menu collapse nav nav-pills nav-stacked ">
|
<ul id="{{.name}}_collapse" class="side-sub-menu collapse nav nav-pills nav-stacked ">
|
||||||
{{#.sub_navs}}
|
{{#.subNavs}}
|
||||||
<li><a href="{{.url}}">{{.name}}</a></li>
|
<li><a href="{{.url}}">{{.name}}</a></li>
|
||||||
{{/.sub_navs}}
|
{{/.subNavs}}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{{/.sub_nav.length}}
|
{{/.subNav.length}}
|
||||||
{{/side-nav}}
|
{{/side-nav}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -46,7 +46,7 @@ import java.util.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class WAAbstractPage implements HttpPage{
|
public class WAAbstractPage implements HttpPage{
|
||||||
private static final Logger log = LogUtil.getLogger();
|
private static final Logger log = LogUtil.getLogger();
|
||||||
private static final String TMPL_FILE = "WebContent/index.tmpl";
|
private static final String TMPL_FILE = "WebContent/page/index.tmpl";
|
||||||
|
|
||||||
private List<WAPage> pages;
|
private List<WAPage> pages;
|
||||||
private Templator tmpl;
|
private Templator tmpl;
|
||||||
|
|
@ -100,7 +100,7 @@ public class WAAbstractPage implements HttpPage{
|
||||||
tmpl.set("top-nav", context.getNavigation());
|
tmpl.set("top-nav", context.getNavigation());
|
||||||
tmpl.set("side-nav-show", true);
|
tmpl.set("side-nav-show", true);
|
||||||
if(breadcrumb.size() >= 1)
|
if(breadcrumb.size() >= 1)
|
||||||
tmpl.set("side-nav", breadcrumb.get(0).getSubNav());
|
tmpl.set("side-nav", breadcrumb.get(0).getSubNavs());
|
||||||
tmpl.set("breadcrumb", breadcrumb);
|
tmpl.set("breadcrumb", breadcrumb);
|
||||||
tmpl.set("alerts", context.getAlerts());
|
tmpl.set("alerts", context.getAlerts());
|
||||||
//tmpl.set("footer", null);
|
//tmpl.set("footer", null);
|
||||||
|
|
@ -109,7 +109,8 @@ public class WAAbstractPage implements HttpPage{
|
||||||
if(page != null)
|
if(page != null)
|
||||||
content = page.htmlResponse(context, client_info, session, cookie, request);
|
content = page.htmlResponse(context, client_info, session, cookie, request);
|
||||||
if(content != null) {
|
if(content != null) {
|
||||||
content.set("nav", context.getBreadcrumb().get(1));
|
if(!breadcrumb.isEmpty())
|
||||||
|
content.set("nav", breadcrumb.get(breadcrumb.size() - 1));
|
||||||
tmpl.set("content", content.compile());
|
tmpl.set("content", content.compile());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ import wa.server.page.struct.WAAlert;
|
||||||
import wa.server.page.struct.WANavigation;
|
import wa.server.page.struct.WANavigation;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -44,7 +43,7 @@ public class WAContext {
|
||||||
nav = WANavigation.getRootNav();
|
nav = WANavigation.getRootNav();
|
||||||
|
|
||||||
// Breadcrumb
|
// Breadcrumb
|
||||||
breadcrumb = WANavigation.getNavResource(request);
|
breadcrumb = WANavigation.getNavBreadcrumb(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,21 +48,25 @@ public class ServicePage implements WAPage {
|
||||||
private static final String TMPL_FILE = "WebContent/page/ServicePage.tmpl";
|
private static final String TMPL_FILE = "WebContent/page/ServicePage.tmpl";
|
||||||
|
|
||||||
private ArrayList<WAService> services;
|
private ArrayList<WAService> services;
|
||||||
private ArrayList<ServiceStatusPage> statuses;
|
private ServiceStatusPage rootStatusPage;
|
||||||
|
private ArrayList<ServiceStatusPage> statusPages;
|
||||||
|
|
||||||
public ServicePage(PluginManager pluginManager){
|
public ServicePage(PluginManager pluginManager){
|
||||||
this.services = pluginManager.toArray(WAService.class);
|
this.services = pluginManager.toArray(WAService.class);
|
||||||
this.statuses = new ArrayList<>();
|
this.rootStatusPage = new ServiceStatusPage(pluginManager);
|
||||||
|
this.statusPages = new ArrayList<>();
|
||||||
|
|
||||||
WANavigation nav = new WANavigation(NAVIGATION_NAME, this);
|
WANavigation nav = WANavigation.getRootNav(NAVIGATION_NAME);
|
||||||
|
nav.setResource(this);
|
||||||
for(WAService plugin : services) {
|
for(WAService plugin : services) {
|
||||||
statuses.add(new ServiceStatusPage(plugin.getStatus()));
|
statusPages.add(new ServiceStatusPage(plugin.getStatus()));
|
||||||
nav.addSubNav(new WANavigation(plugin.getName(), plugin));
|
|
||||||
for(WAServiceConfig conf : plugin.getConfigurations()){
|
|
||||||
|
|
||||||
|
WANavigation serviceNav = nav.getSubNav(plugin.getName());
|
||||||
|
serviceNav.setResource(plugin);
|
||||||
|
for(WAServiceConfig conf : plugin.getConfigurations()){
|
||||||
|
//serviceNav.getSubNav(conf.getName()).setResource(conf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WANavigation.addRootNav(nav);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -74,16 +78,20 @@ public class ServicePage implements WAPage {
|
||||||
Map<String, String> request) {
|
Map<String, String> request) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int index = services.indexOf(context.getBreadcrumb().get(1).getResource());
|
|
||||||
if(index < 0)
|
|
||||||
return null;
|
|
||||||
WAService obj = services.get(index);
|
|
||||||
ServiceStatusPage statusPage = statuses.get(index);
|
|
||||||
|
|
||||||
Templator tmpl = new Templator(FileUtil.find(TMPL_FILE));
|
int index = services.indexOf(context.getBreadcrumb().get(1).getResource());
|
||||||
tmpl.set("service_status",
|
if (index >= 0) {
|
||||||
statusPage.htmlResponse(context, client_info, session, cookie, request).compile());
|
WAService obj = services.get(index);
|
||||||
return tmpl;
|
ServiceStatusPage statusPage = statusPages.get(index);
|
||||||
|
|
||||||
|
Templator tmpl = new Templator(FileUtil.find(TMPL_FILE));
|
||||||
|
tmpl.set("service_status",
|
||||||
|
statusPage.htmlResponse(context, client_info, session, cookie, request).compile());
|
||||||
|
return tmpl;
|
||||||
|
}
|
||||||
|
else{ // root page
|
||||||
|
return rootStatusPage.htmlResponse(context, client_info, session, cookie, request);
|
||||||
|
}
|
||||||
|
|
||||||
}catch (IOException e){
|
}catch (IOException e){
|
||||||
log.log(Level.SEVERE, null, e);
|
log.log(Level.SEVERE, null, e);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ import zutil.parser.DataNode;
|
||||||
import zutil.parser.Templator;
|
import zutil.parser.Templator;
|
||||||
import zutil.plugin.PluginManager;
|
import zutil.plugin.PluginManager;
|
||||||
|
|
||||||
import javax.xml.crypto.Data;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -57,8 +56,8 @@ public class ServiceStatusPage implements WAPage {
|
||||||
public ServiceStatusPage(PluginManager pluginManager){
|
public ServiceStatusPage(PluginManager pluginManager){
|
||||||
this.services = pluginManager.toArray(WAServiceStatus.class);
|
this.services = pluginManager.toArray(WAServiceStatus.class);
|
||||||
|
|
||||||
WANavigation.getRootNav(ServicePage.NAVIGATION_NAME).addSubNav(
|
WANavigation nav = WANavigation.getRootNav(ServicePage.NAVIGATION_NAME).getSubNav(NAVIGATION_NAME);
|
||||||
new WANavigation(NAVIGATION_NAME, this));
|
nav.setResource(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,10 @@ public class StatusPage implements WAPage {
|
||||||
public StatusPage(PluginManager pluginManager){
|
public StatusPage(PluginManager pluginManager){
|
||||||
this.plugins = pluginManager.toArray(WAStatus.class);
|
this.plugins = pluginManager.toArray(WAStatus.class);
|
||||||
|
|
||||||
WANavigation nav = new WANavigation(NAVIGATION_NAME, this);
|
WANavigation nav = WANavigation.getRootNav(NAVIGATION_NAME);
|
||||||
|
nav.setResource(this);
|
||||||
for(WAStatus plugin : plugins)
|
for(WAStatus plugin : plugins)
|
||||||
nav.addSubNav(new WANavigation(plugin.getName(), plugin));
|
nav.getSubNav(plugin.getName()).setResource(plugin);
|
||||||
WANavigation.addRootNav(nav);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,46 +27,49 @@ import java.util.*;
|
||||||
/**
|
/**
|
||||||
* Created by Ziver on 2015-04-02.
|
* Created by Ziver on 2015-04-02.
|
||||||
*/
|
*/
|
||||||
public class WANavigation {
|
public class WANavigation implements Iterable{
|
||||||
private static int nextId;
|
private static int nextId = 0;
|
||||||
private static List<WANavigation> root_nav = new ArrayList<WANavigation>();
|
private static HashMap<Integer, WANavigation> navMap = new HashMap<Integer, WANavigation>();
|
||||||
private static HashMap<Integer, WANavigation> nav_map = new HashMap<Integer, WANavigation>();
|
private static WANavigation rootNav = new WANavigation(null);
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
private String url;
|
private String url;
|
||||||
private String name;
|
private String name;
|
||||||
private ArrayList<WANavigation> sub_navs;
|
private ArrayList<WANavigation> subNav;
|
||||||
|
|
||||||
private WANavigation parent_nav;
|
private WANavigation parentNav;
|
||||||
private Object resource;
|
private Object resource;
|
||||||
|
|
||||||
|
|
||||||
public WANavigation(String name) {
|
private WANavigation(String name) {
|
||||||
this.id = nextId++;
|
this.id = nextId++;
|
||||||
this.nav_map.put(this.id, this);
|
this.navMap.put(this.id, this);
|
||||||
this.url = "?i="+this.id;
|
this.url = "?i="+this.id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.sub_navs = new ArrayList<>();
|
this.subNav = new ArrayList<>();
|
||||||
}
|
|
||||||
public WANavigation(String name, Object resource) {
|
|
||||||
this(name);
|
|
||||||
this.setResource(resource);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addSubNav(WANavigation subNav) {
|
@Override
|
||||||
this.sub_navs.add(subNav);
|
public Iterator iterator() {
|
||||||
|
return subNav.iterator();
|
||||||
|
}
|
||||||
|
public List<WANavigation> getSubNavs() {
|
||||||
|
return subNav;
|
||||||
|
}
|
||||||
|
public WANavigation getSubNav(String name) {
|
||||||
|
for(WANavigation nav : subNav) {
|
||||||
|
if(nav.equals(name))
|
||||||
|
return nav;
|
||||||
|
}
|
||||||
|
WANavigation nav = new WANavigation(name);
|
||||||
|
this.addSubNav(nav);
|
||||||
|
return nav;
|
||||||
|
}
|
||||||
|
private void addSubNav(WANavigation subNav) {
|
||||||
|
this.subNav.add(subNav);
|
||||||
subNav.setParentNav(this );
|
subNav.setParentNav(this );
|
||||||
}
|
}
|
||||||
public List<WANavigation> getSubNav() {
|
|
||||||
return sub_navs;
|
|
||||||
}
|
|
||||||
public Object getSubNav(String name) {
|
|
||||||
int index = sub_navs.indexOf(name);
|
|
||||||
if(index >= 0)
|
|
||||||
return sub_navs.get(index);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName(){
|
public String getName(){
|
||||||
return name;
|
return name;
|
||||||
|
|
@ -79,9 +82,10 @@ public class WANavigation {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setParentNav(WANavigation nav){
|
private void setParentNav(WANavigation nav){
|
||||||
this.parent_nav = nav;
|
this.parentNav = nav;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(Object o){
|
public boolean equals(Object o){
|
||||||
if(o instanceof String)
|
if(o instanceof String)
|
||||||
return this.name.equals(o);
|
return this.name.equals(o);
|
||||||
|
|
@ -90,27 +94,20 @@ public class WANavigation {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void addRootNav(WANavigation nav){
|
|
||||||
getRootNav().add(nav);
|
|
||||||
}
|
|
||||||
public static List<WANavigation> getRootNav(){
|
public static List<WANavigation> getRootNav(){
|
||||||
return root_nav;
|
return rootNav.getSubNavs();
|
||||||
}
|
}
|
||||||
public static WANavigation getRootNav(String name){
|
public static WANavigation getRootNav(String name){
|
||||||
for(WANavigation nav : root_nav){
|
return rootNav.getSubNav(name);
|
||||||
if(nav.getName().equals(name))
|
|
||||||
return nav;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<WANavigation> getNavResource(Map<String, String> request) {
|
public static List<WANavigation> getNavBreadcrumb(Map<String, String> request) {
|
||||||
LinkedList list = new LinkedList();
|
LinkedList list = new LinkedList();
|
||||||
if(request.containsKey("i")){
|
if(request.containsKey("i")){
|
||||||
WANavigation current = nav_map.get(Integer.parseInt(request.get("i")));
|
WANavigation current = navMap.get(Integer.parseInt(request.get("i")));
|
||||||
while(current != null){
|
while(current != null && current != rootNav){
|
||||||
list.addFirst(current);
|
list.addFirst(current);
|
||||||
current = current.parent_nav;
|
current = current.parentNav;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ public class ApacheConfig implements WAServiceConfig {
|
||||||
vhosts = new LinkedList<ApacheConfigVirtualHost>();
|
vhosts = new LinkedList<ApacheConfigVirtualHost>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read() throws SQLException {
|
public void read() throws SQLException {
|
||||||
DBConnection db = WAConstants.getDB();
|
DBConnection db = WAConstants.getDB();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ import java.util.logging.Logger;
|
||||||
|
|
||||||
public class ApacheStatus extends WAServiceStatus {
|
public class ApacheStatus extends WAServiceStatus {
|
||||||
private static final Logger log = LogUtil.getLogger();
|
private static final Logger log = LogUtil.getLogger();
|
||||||
private static final String PID_FILE = "/var/run/apache2.pid";
|
private static final String PID_FILE_PATH = "/var/run/apache2.pid";
|
||||||
|
|
||||||
private static OSAbstractionLayer os = OSAbstractionLayer.getInstance();
|
private static OSAbstractionLayer os = OSAbstractionLayer.getInstance();
|
||||||
|
|
||||||
|
|
@ -58,11 +58,14 @@ public class ApacheStatus extends WAServiceStatus {
|
||||||
@Override
|
@Override
|
||||||
public ServiceStatusType getStatus() {
|
public ServiceStatusType getStatus() {
|
||||||
try {
|
try {
|
||||||
int pid = Integer.parseInt(
|
File pidFile = new File(PID_FILE_PATH);
|
||||||
FileUtil.getContent(new File(PID_FILE)));
|
if(pidFile.exists()) {
|
||||||
if(Ps.isRunning(pid))
|
int pid = Integer.parseInt(
|
||||||
return ServiceStatusType.RUNNING;
|
FileUtil.getContent(pidFile));
|
||||||
return ServiceStatusType.STOPPED;
|
if (Ps.isRunning(pid))
|
||||||
|
return ServiceStatusType.RUNNING;
|
||||||
|
return ServiceStatusType.STOPPED;
|
||||||
|
}
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
log.log(Level.WARNING, null, e);
|
log.log(Level.WARNING, null, e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"name": "Apache Web Server",
|
"name": "Apache Web Server",
|
||||||
"interfaces": {
|
"interfaces": {
|
||||||
"wa.server.plugin.WAService": "wa.server.plugin.apache.ApacheService"
|
"wa.server.plugin.WAService": "wa.server.plugin.apache.ApacheService",
|
||||||
|
"wa.server.plugin.WAServiceStatus": "wa.server.plugin.apache.ApacheStatus"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -103,7 +103,9 @@ function updateNet(){
|
||||||
$(element).find(".net-total-tx").html(byteToString(net.total_tx));
|
$(element).find(".net-total-tx").html(byteToString(net.total_tx));
|
||||||
$(element).find(".net-dropped").html(net.dropped);
|
$(element).find(".net-dropped").html(net.dropped);
|
||||||
$(element).find(".net-error").html(net.error);
|
$(element).find(".net-error").html(net.error);
|
||||||
$(element).find(".net-up").html( (net.up ? "<b class='green'>UP</b>" : "<b class='red'>DOWN</b>") );
|
$(element).find(".net-up").html( (net.up ?
|
||||||
|
"<span class='label label-success'>UP</span>" :
|
||||||
|
"<span class='label label-danger'>DOWN</span>") );
|
||||||
$(element).find(".net-ip").html(net.ip);
|
$(element).find(".net-ip").html(net.ip);
|
||||||
$(element).find(".net-netmask").html(net.netmask);
|
$(element).find(".net-netmask").html(net.netmask);
|
||||||
$(element).find(".net-mac").html(net.mac);
|
$(element).find(".net-mac").html(net.mac);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue