public SySal.Web.ChunkedResponse HttpPost(SySal.Web.Session sess, string page, params string[] postfields) { SySal.Web.IWebApplication iwa = null; if (page.Length > 1) { try { iwa = (SySal.Web.IWebApplication)SySal.NExT.NExTServer.NExTServerFromURI(page.Substring(1)); } catch (Exception) { } } ; if (iwa != null) { return(iwa.HttpPost(sess, page, postfields)); } string html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n" + "<html xmlns=\"http://www.w3.org/1999/xhtml\" >\r\n" + "<head>\r\n" + " <meta http-equiv=\"pragma\" content=\"no-cache\">\r\n" + " <meta http-equiv=\"EXPIRES\" content=\"0\" />\r\n" + " <title>NExTSrvHost Monitor</title>\r\n" + " <style type=\"text/css\">\r\n" + " th { font-family: Arial,Helvetica; font-size: 12; color: white; background-color: teal; text-align: center; font-weight: bold }\r\n" + " td { font-family: Arial,Helvetica; font-size: 12; color: navy; background-color: white; text-align: right; font-weight: normal }\r\n" + " p {font-family: Arial,Helvetica; font-size: 14; color: black; background-color: white; text-align: left; font-weight: normal }\r\n" + " div {font-family: Arial,Helvetica; font-size: 14; color: black; background-color: white; text-align: center; font-weight: normal }\r\n" + " </style>\r\n" + "</head>\r\n" + "<body>\r\n" + " <div><b>NExTSrvHost Monitor<br>Last Update: " + System.DateTime.Now.ToLongTimeString() + "</b></div>\r\n" + " <div align=\"center\">\r\n" + " <table width=\"100%\" border=\"1\">\r\n" + " <tr><th>Service</th><th>Status</th></tr>\r\n"; foreach (SySal.NExT.NExTConfiguration.ServiceEntry se in TheConfig.Services.ServiceEntries) { foreach (string name in se.Names) { SySal.NExT.INExTServer ins = SySal.NExT.NExTServer.NExTServerFromURI(name); SySal.NExT.ServerMonitorGauge[] g = ins.MonitorGauges; string mtext = ""; foreach (SySal.NExT.ServerMonitorGauge g1 in g) { mtext += SySal.Web.WebServer.HtmlFormat(g1.Name) + "=" + SySal.Web.WebServer.HtmlFormat(g1.Value.ToString()) + "; "; } html += " <tr><td><a href=\"" + SySal.Web.WebServer.HtmlFormat(name) + "\">" + SySal.Web.WebServer.HtmlFormat(name) + "</a></td><td>" + mtext + "</td></tr>\r\n"; } } html += " <table>\r\n</body>\r\n\r\n"; return(new SySal.Web.HTMLResponse(html)); }
void RefreshTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { int i; for (i = 0; i < lvServices.Items.Count; i++) { SySal.NExT.INExTServer srv = SySal.NExT.NExTServer.NExTServerFromURI(lvServices.Items[i].Text); SySal.NExT.ServerMonitorGauge[] gauges = srv.MonitorGauges; string text = ""; foreach (SySal.NExT.ServerMonitorGauge gauge in gauges) { text += (gauge.Name + "=" + gauge.Value + "; "); } lvServices.Items[i].SubItems[1].Text = text; } }