2015-04-09 21:22:47 +00:00
|
|
|
package wa.server;
|
|
|
|
|
|
|
|
|
|
import wa.server.page.StatusPage;
|
|
|
|
|
import zutil.io.file.FileUtil;
|
|
|
|
|
import zutil.log.CompactLogFormatter;
|
|
|
|
|
import zutil.log.LogUtil;
|
|
|
|
|
import zutil.net.http.HttpServer;
|
|
|
|
|
import zutil.net.http.pages.HttpFilePage;
|
|
|
|
|
import zutil.plugin.PluginManager;
|
|
|
|
|
|
|
|
|
|
import java.util.logging.Level;
|
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
|
|
|
|
public class WebAdminServer {
|
|
|
|
|
private static Logger log = LogUtil.getLogger();
|
|
|
|
|
|
|
|
|
|
private PluginManager pluginManager;
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args){
|
|
|
|
|
LogUtil.setGlobalLevel(Level.FINEST);
|
|
|
|
|
LogUtil.setGlobalFormatter(new CompactLogFormatter());
|
|
|
|
|
|
|
|
|
|
new WebAdminServer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public WebAdminServer(){
|
|
|
|
|
try {
|
|
|
|
|
pluginManager = new PluginManager();
|
|
|
|
|
|
|
|
|
|
HttpServer http = new HttpServer(80);
|
2015-04-25 15:22:44 +00:00
|
|
|
http.setPage("/", new WAAbstractPage(pluginManager));
|
2015-06-03 15:08:41 +00:00
|
|
|
//http.setPage("status", new StatusPage(pluginManager));
|
|
|
|
|
//http.setPage("service", new ServicePage(pluginManager));
|
|
|
|
|
//http.setPage("servicestatus", new ServiceStatusPage(pluginManager));
|
2015-07-28 12:06:51 +00:00
|
|
|
//http.setPage("config", new ConfigPage(pluginManager));
|
2015-04-09 21:22:47 +00:00
|
|
|
http.setDefaultPage(new HttpFilePage(FileUtil.find("WebContent/")));
|
|
|
|
|
http.start();
|
|
|
|
|
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|