mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 02:44:15 +00:00
* HTTPServer.cpp: drop boost::date_time dep
This commit is contained in:
parent
4d98a64000
commit
849308e28d
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
|
||||||
|
|
||||||
#include "Base.h"
|
#include "Base.h"
|
||||||
#include "FS.h"
|
#include "FS.h"
|
||||||
@ -230,11 +229,29 @@ namespace http {
|
|||||||
{ "stats.i2p", "http://7tbay5p4kzeekxvyvbf6v7eauazemsnnl2aoyqhg5jzpr5eke7tq.b32.i2p/cgi-bin/jump.cgi?a=" },
|
{ "stats.i2p", "http://7tbay5p4kzeekxvyvbf6v7eauazemsnnl2aoyqhg5jzpr5eke7tq.b32.i2p/cgi-bin/jump.cgi?a=" },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void ShowUptime (std::stringstream& s, int seconds) {
|
||||||
|
int num;
|
||||||
|
|
||||||
|
if ((num = seconds / 86400) > 0) {
|
||||||
|
s << num << " days, ";
|
||||||
|
seconds -= num;
|
||||||
|
}
|
||||||
|
if ((num = seconds / 3600) > 0) {
|
||||||
|
s << num << " hours, ";
|
||||||
|
seconds -= num;
|
||||||
|
}
|
||||||
|
if ((num = seconds / 60) > 0) {
|
||||||
|
s << num << " min, ";
|
||||||
|
seconds -= num;
|
||||||
|
}
|
||||||
|
s << seconds << " seconds";
|
||||||
|
}
|
||||||
|
|
||||||
void ShowStatus (std::stringstream& s)
|
void ShowStatus (std::stringstream& s)
|
||||||
{
|
{
|
||||||
s << "<b>Uptime:</b> " << boost::posix_time::to_simple_string (
|
s << "<b>Uptime:</b> ";
|
||||||
boost::posix_time::time_duration (boost::posix_time::seconds (
|
ShowUptime(s, i2p::context.GetUptime ());
|
||||||
i2p::context.GetUptime ()))) << "<br>\r\n";
|
s << "<br>\r\n";
|
||||||
s << "<b>Status:</b> ";
|
s << "<b>Status:</b> ";
|
||||||
switch (i2p::context.GetStatus ())
|
switch (i2p::context.GetStatus ())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user