11#include " hardware_list_cmd.h"
2-
32#include < json/reader.h>
43#include < json/value.h>
54#include < iostream>
6-
75#include < vector>
8- #include " httplib.h"
96#include " server_start_cmd.h"
7+ #include " services/hardware_service.h"
108#include " utils/curl_utils.h"
11- #include " utils/hardware/cpu_info.h"
12- #include " utils/hardware/gpu_info.h"
13- #include " utils/hardware/os_info.h"
14- #include " utils/hardware/power_info.h"
15- #include " utils/hardware/ram_info.h"
16- #include " utils/hardware/storage_info.h"
179#include " utils/logging_utils.h"
18- #include " utils/string_utils.h"
1910// clang-format off
2011#include < tabulate/table.hpp>
2112// clang-format on
@@ -106,14 +97,15 @@ bool HardwareListCmd::Exec(const std::string& host, int port,
10697 std::cout << std::endl;
10798 }
10899
109- if (!ho.has_value () || ho.value ().show_gpu ) {
100+ if (!ho.has_value () || ho.value ().show_gpu ) {
110101 std::cout << " GPU Information:" << std::endl;
111102 Table table;
112103 std::vector<std::string> column_headers{
113104 " (Index)" , " ID" ,
114105 " Name" , " Version" ,
115106 " Total (MiB)" , " Available (MiB)" ,
116- " Driver Version" , " Compute Capability" , " Activated" };
107+ " Driver Version" , " Compute Capability" ,
108+ " Activated" };
117109
118110 Row_t header{column_headers.begin (), column_headers.end ()};
119111 table.add_row (header);
@@ -170,7 +162,8 @@ bool HardwareListCmd::Exec(const std::string& host, int port,
170162 table.add_row (header);
171163 table.format ().font_color (Color::green);
172164 std::vector<std::string> row = {" 1" };
173- cortex::hw::PowerInfo pi = cortex::hw::power::FromJson (result.value ()[" power" ]);
165+ cortex::hw::PowerInfo pi =
166+ cortex::hw::power::FromJson (result.value ()[" power" ]);
174167 row.emplace_back (std::to_string (pi.battery_life ));
175168 row.emplace_back (pi.charging_status );
176169 row.emplace_back (pi.is_power_saving ? " Yes" : " No" );
@@ -181,4 +174,4 @@ bool HardwareListCmd::Exec(const std::string& host, int port,
181174
182175 return true ;
183176}
184- } // namespace commands
177+ } // namespace commands
0 commit comments