formated code
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled

This commit is contained in:
wt committed 2025-02-13 19:25:56 +07:00
1 parent d1a08ba5ce
commit f4bcead439
46 files changed
+23674 -22776

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ namespace api
{
namespace system
{
void reboot(const httplib::Request &request, httplib::Response &response)
void reboot(const httplib::Request& request, httplib::Response& response)
{
std::cout << GREEN << request.path << RESET << " " << request.method << std::endl;
response.set_header("Access-Control-Allow-Origin", "*");
+1 -1
View File
@@ -7,7 +7,7 @@ namespace api
{
namespace system
{
void reboot(const httplib::Request &request, httplib::Response &response);
void reboot(const httplib::Request& request, httplib::Response& response);
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ namespace api
{
namespace system
{
void get_syslog(const httplib::Request &request, httplib::Response &response)
void get_syslog(const httplib::Request& request, httplib::Response& response)
{
std::stringstream responsedata;
std::ifstream syslogfile(SYSLOG_FILE);
+2 -2
View File
@@ -7,8 +7,8 @@ namespace api
{
namespace system
{
void get_syslog(const httplib::Request &request, httplib::Response &response);
void get_syslog(const httplib::Request& request, httplib::Response& response);
}
}
#endif // SYSLOG_HPP
#endif // SYSLOG_HPP
+1 -1
View File
@@ -7,4 +7,4 @@
#include <system/syslog/syslog.hpp>
#include <system/reboot/reboot.hpp>
#endif // SYSTEM_HPP
#endif // SYSTEM_HPP
+7 -7
View File
@@ -9,7 +9,7 @@ namespace api
{
namespace system
{
void get_uptime(const httplib::Request &request, httplib::Response &response)
void get_uptime(const httplib::Request& request, httplib::Response& response)
{
#ifdef __linux__
struct sysinfo x;
@@ -21,12 +21,12 @@ namespace api
// << std::endl;
std::stringstream responsedata;
responsedata << R"({"uptime":{"hour":")"
<< static_cast<unsigned long long>(x.uptime) / 3600ULL
<< R"(","minute":")"
<< static_cast<unsigned long long>(x.uptime) / 60ULL % 60ULL
<< R"(","second":")"
<< static_cast<unsigned long long>(x.uptime) % 60ULL
<< R"("}})";
<< static_cast<unsigned long long>(x.uptime) / 3600ULL
<< R"(","minute":")"
<< static_cast<unsigned long long>(x.uptime) / 60ULL % 60ULL
<< R"(","second":")"
<< static_cast<unsigned long long>(x.uptime) % 60ULL
<< R"("}})";
response.set_content(responsedata.str(), JSON_TYPE);
return;
}
+2 -2
View File
@@ -7,8 +7,8 @@ namespace api
{
namespace system
{
void get_uptime(const httplib::Request &request, httplib::Response &response);
void get_uptime(const httplib::Request& request, httplib::Response& response);
}
}
#endif // UPTIME_HPP
#endif // UPTIME_HPP