-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatus.cpp
More file actions
40 lines (32 loc) · 1006 Bytes
/
Copy pathstatus.cpp
File metadata and controls
40 lines (32 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "session/status.hpp"
namespace droidcli::session {
namespace {
const char* enabled_label(const bool value)
{
return value ? "On" : "Off";
}
const char* bound_label(const bool value)
{
return value ? "bound" : "not-bound";
}
const char* http_enabled_label(const bool value)
{
return value ? "enabled" : "disabled";
}
} // namespace
core::String build_http_server_status_text(const RuntimeSession& session)
{
return "HTTP "
+ core::String(http_enabled_label(session.http_enabled))
+ ", port=" + std::to_string(session.http_port)
+ ", router=" + bound_label(session.http_router_bound)
+ ", endpoints=/health,/echo,/notify";
}
core::String build_startup_feature_flags_text(const RuntimeSession& session)
{
return "AI=" + core::String(enabled_label(session.features.ai))
+ " Networking=" + enabled_label(session.features.networking)
+ " Recording=" + enabled_label(session.features.recording)
+ " UI=" + enabled_label(session.features.ui);
}
} // namespace droidcli::session