From e61cedcdb1563eb6f0159169c0d6f1cb5343c3ff Mon Sep 17 00:00:00 2001
From: brain
Date: Mon, 30 Jul 2007 18:53:11 +0000
Subject: Output is now xml in trunk.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7629 e03df62e-2008-0410-955e-edbf42e46eb7
---
src/modules/m_httpd_stats.cpp | 77 ++++++++++++++-----------------------------
1 file changed, 25 insertions(+), 52 deletions(-)
(limited to 'src/modules/m_httpd_stats.cpp')
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 37bc7615e..70b73e13d 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -87,43 +87,26 @@ class ModuleHttpStats : public Module
if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/"))
{
- data << "\n\
- ";
-
- data << "
";
- data << "";
- data << "InspIRCd server statisitics for " << ServerInstance->Config->ServerName << " (" << ServerInstance->Config->ServerDesc << ")";
- data << "";
- data << "
InspIRCd server statisitics for " << ServerInstance->Config->ServerName << " (" << ServerInstance->Config->ServerDesc << ")
";
+ data << "";
+
+ data << "" << ServerInstance->Config->ServerName << "" << ServerInstance->Config->ServerDesc << "";
+
+ data << "";
+ data << "" << ServerInstance->clientlist->size() << "";
+ data << "" << ServerInstance->chanlist->size() << "";
+ data << "" << ServerInstance->all_opers.size() << "";
+ data << "" << (ServerInstance->SE->GetMaxFds() - ServerInstance->SE->GetRemainingFds()) << "" << ServerInstance->SE->GetMaxFds() <<
+ "" << ServerInstance->SE->GetName() << "')";
+ data << "";
+ data << "";
for (int i = 0; i <= ServerInstance->GetModuleCount(); i++)
{
if (!ServerInstance->Config->module_names[i].empty())
- data << "
" << ServerInstance->Config->module_names[i] << "
";
+ data << "" << ServerInstance->Config->module_names[i] << "";
}
- data << "
";
- data << "
";
-
- data << "
";
- data << "
Channels
";
- data << "
";
- data << "
Users
Name
@
%
+
Topic
";
+ data << "";
+ data << "";
/* If the list has changed since last time it was displayed, re-sort it
* this time only (not every time, as this would be moronic)
*/
@@ -136,31 +119,21 @@ class ModuleHttpStats : public Module
chanrec* c = ServerInstance->FindChan(a->second.c_str());
if (c && !c->IsModeSet('s') && !c->IsModeSet('p'))
{
- data << "
" << a->first << "
" << c->GetUsers()->size() << "
";
- data << "
" << c->GetOppedUsers()->size() << "
";
- data << "
" << c->GetHalfoppedUsers()->size() << "
";
- data << "
" << c->GetVoicedUsers()->size() << "
";
- data << "
" << c->topic << "
";
- data << "
";
+ data << "";
+ data << "" << c->GetUsers()->size() << "" << c->name << "";
+ data << "" << c->GetOppedUsers()->size() << "";
+ data << "" << c->GetHalfoppedUsers()->size() << "";
+ data << "" << c->GetVoicedUsers()->size() << "";
+ data << "" << c->topic << "";
+ data << "";
}
}
- data << "
";
- data << "
";
-
-
-
-
-
- data << "
";
- data << "
";
- data << "
";
-
- data << "";
- data << "";
+ data << "";
+ data << "";
/* Send the document back to m_httpd */
- HTTPDocument response(http->sock, &data, 200, "X-Powered-By: m_http_stats.so\r\nContent-Type: text/html; charset=iso-8859-1\r\n");
+ HTTPDocument response(http->sock, &data, 200, "X-Powered-By: m_http_stats.so\r\nContent-Type: text/xml\r\n");
Request req((char*)&response, (Module*)this, event->GetSource());
req.Send();
}
--
cgit v1.3.1-10-gc9f91