ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/HostStatus/HostStatus.cpp
(Generate patch)

Comparing HostStatus/HostStatus.cpp (file contents):
Revision 43 by Douglas Thrift, 2003-11-16T20:17:51-08:00 vs.
Revision 44 by Douglas Thrift, 2003-11-17T11:05:37-08:00

# Line 220 | Line 220 | void HostStatus::header(const string& me
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                  << "</td>\n"
246                  << "<td>\n"
247 <                << "<input type=\"checkbox\" name=\"mode\" value=\"h\">&nbsp;Host\n"
248 <                << "<input type=\"checkbox\" name=\"mode\" value=\"n\">&nbsp;Name\n"
249 <                << "<input type=\"checkbox\" name=\"mode\" value=\"a\">&nbsp;Address\n"
250 <                << "<input type=\"checkbox\" name=\"mode\" value=\"p\">&nbsp;Platform"
251 <                << "\n<input type=\"checkbox\" name=\"mode\" value=\"s\">&nbsp;Since\n"
247 >                << "<input type=\"checkbox\" name=\"mode\" value=\"h\""
248 >                << (host && !all ? " checked" : "") << ">&nbsp;Host\n"
249 >                << "<input type=\"checkbox\" name=\"mode\" value=\"n\""
250 >                << (name && !all ? " checked" : "") << ">&nbsp;Name\n"
251 >                << "<input type=\"checkbox\" name=\"mode\" value=\"a\""
252 >                << (address && !all ? " checked" : "") << ">&nbsp;Address\n"
253 >                << "<input type=\"checkbox\" name=\"mode\" value=\"p\""
254 >                << (platform && !all ? " checked" : "") << ">&nbsp;Platform\n"
255 >                << "<input type=\"checkbox\" name=\"mode\" value=\"s\""
256 >                << (since && !all ? " checked" : "") << ">&nbsp;Since\n"
257                  << "</td>\n"
258                  << "<td><input type=\"submit\" value=\"Status\"></td>\n"
259                  << "</tr>\n"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines