|
a/tool/run/plugins/webserver/server.java |
|
b/tool/run/plugins/webserver/server.java |
|
... |
|
... |
65 |
// all done
|
65 |
// all done
|
66 |
String message = html.h3("Settings saved!");
|
66 |
String message = html.h3("Settings saved!");
|
67 |
request.setAnswer(utils.html.redirect("/webserver/server", 2, message));
|
67 |
request.setAnswer(utils.html.redirect("/webserver/server", 2, message));
|
68 |
}
|
68 |
}
|
69 |
|
69 |
|
|
|
70 |
|
|
|
71 |
/**
|
|
|
72 |
* Opens up the web browser from the user on the front page of our software
|
|
|
73 |
* @param request the end-user request
|
|
|
74 |
*/
|
|
|
75 |
public void open(WebRequest request){
|
|
|
76 |
String status = settings.read("status", "offline");
|
|
|
77 |
// if we are supposed to be offline, we can't use this thing
|
|
|
78 |
if(status.equals("offline")){
|
|
|
79 |
String message = html.h3("You need to first activate the server..");
|
|
|
80 |
request.setAnswer(utils.html.redirect("/webserver/server", 2, message));
|
|
|
81 |
return;
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
// get the current port number
|
|
|
85 |
String portNumber = settings.read("port", definition.portDefault);
|
|
|
86 |
|
|
|
87 |
// All checked, let's open the front page
|
|
|
88 |
utils.internet.openURL("http://localhost:" + portNumber
|
|
|
89 |
+ "/webserver/intro.html");
|
|
|
90 |
|
|
|
91 |
String message = html.h3("Opening your web browser..");
|
|
|
92 |
request.setAnswer(utils.html.redirect("/webserver/server", 2, message));
|
|
|
93 |
}
|
|
|
94 |
|
70 |
/**
|
95 |
/**
|
71 |
* Show the main page for the server settings
|
96 |
* Show the main page for the server settings
|
72 |
* @param request the request from the end-user
|
97 |
* @param request the request from the end-user
|
73 |
*/
|
98 |
*/
|
74 |
@Override
|
99 |
@Override
|