185 |
|
<< "<body>\n" |
186 |
|
<< "<h1 id=\"title\" class=\"center\">Host Status</h1>\n" |
187 |
|
<< "<form action=\"hoststatus.cgi\" method=\"POST\">\n" |
188 |
< |
<< "<p class=\"center\">\n" |
189 |
< |
<< "<select name=\"host\" multiple>\n"; |
188 |
> |
<< "<table class=\"center\">\n" |
189 |
> |
<< "<tr>\n" |
190 |
> |
<< "<td>\n" |
191 |
> |
<< "<select name=\"host\" size=\"2\" multiple>\n"; |
192 |
|
|
193 |
|
if (method != "POST") sputenv("QUERY_STRING=mode=h"); |
194 |
|
|
220 |
|
} |
221 |
|
while (!done && hostupdate.good()); |
222 |
|
|
223 |
+ |
set<string> selected; |
224 |
+ |
|
225 |
+ |
for (multimap<string, string>::iterator itor = cgi.find("host"); itor != |
226 |
+ |
cgi.upper_bound("host") && itor != cgi.end(); itor++) |
227 |
+ |
{ |
228 |
+ |
string host = itor->second; |
229 |
+ |
|
230 |
+ |
if (host != "") selected.insert(host); |
231 |
+ |
} |
232 |
+ |
|
233 |
|
for (list<Host>::iterator itor = hosts.begin(); itor != hosts.end(); |
234 |
|
itor++) |
235 |
|
{ |
236 |
|
Host host = *itor; |
237 |
|
|
238 |
< |
cout << "<option>" << host.getHost() << "</option>\n"; |
238 |
> |
cout << "<option" << (selected.find(host.getHost()) != selected.end() ? |
239 |
> |
" selected>" : ">") << host.getHost() << "</option>\n"; |
240 |
|
} |
241 |
|
|
242 |
+ |
bool all = host && name && address && platform && since; |
243 |
+ |
|
244 |
|
cout << "</select>\n" |
245 |
< |
<< "<input type=\"checkbox\" name=\"mode\" value=\"h\"> Host\n" |
246 |
< |
<< "<input type=\"checkbox\" name=\"mode\" value=\"n\"> Name\n" |
247 |
< |
<< "<input type=\"checkbox\" name=\"mode\" value=\"a\"> Address\n" |
248 |
< |
<< "<input type=\"checkbox\" name=\"mode\" value=\"p\"> Platform" |
249 |
< |
<< '\n' |
250 |
< |
<< "<input type=\"checkbox\" name=\"mode\" value=\"s\"> Since\n" |
251 |
< |
<< "<input type=\"submit\" value=\"Status\">\n" |
252 |
< |
<< "</p>\n" |
245 |
> |
<< "</td>\n" |
246 |
> |
<< "<td>\n" |
247 |
> |
<< "<input type=\"checkbox\" name=\"mode\" value=\"h\"" |
248 |
> |
<< (host && !all ? " checked" : "") << "> Host\n" |
249 |
> |
<< "<input type=\"checkbox\" name=\"mode\" value=\"n\"" |
250 |
> |
<< (name && !all ? " checked" : "") << "> Name\n" |
251 |
> |
<< "<input type=\"checkbox\" name=\"mode\" value=\"a\"" |
252 |
> |
<< (address && !all ? " checked" : "") << "> Address\n" |
253 |
> |
<< "<input type=\"checkbox\" name=\"mode\" value=\"p\"" |
254 |
> |
<< (platform && !all ? " checked" : "") << "> Platform\n" |
255 |
> |
<< "<input type=\"checkbox\" name=\"mode\" value=\"s\"" |
256 |
> |
<< (since && !all ? " checked" : "") << "> Since\n" |
257 |
> |
<< "</td>\n" |
258 |
> |
<< "<td><input type=\"submit\" value=\"Status\"></td>\n" |
259 |
> |
<< "</tr>\n" |
260 |
> |
<< "</table>\n" |
261 |
|
<< "</form>\n" |
262 |
|
<< "<table class=\"center\">\n" |
263 |
|
<< "<tr>\n"; |