API GET uptime returns formatted string, not seconds as the doc says #2158

This commit is contained in:
nicolargo 2022-11-20 18:58:15 +01:00
parent ea60836cc9
commit c23451f2ba
3 changed files with 439 additions and 441 deletions

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "GLANCES" "1" "Nov 03, 2022" "3.3.1_beta1" "Glances"
.TH "GLANCES" "1" "Nov 20, 2022" "3.3.1_beta1" "Glances"
.SH NAME
glances \- An eye on your system
.SH SYNOPSIS

View File

@ -70,7 +70,7 @@ def print_plugins_list(stat):
print('')
def print_plugin_export(plugin, stat_export):
def print_plugin_stats(plugin, stat):
sub_title = 'GET {}'.format(plugin)
print(sub_title)
print('-' * len(sub_title))
@ -79,7 +79,7 @@ def print_plugin_export(plugin, stat_export):
print('Get plugin stats::')
print('')
print(' # curl {}/{}'.format(API_URL, plugin))
print(indent_stat(stat_export))
print(indent_stat(json.loads(stat.get_stats())))
print('')
@ -223,7 +223,7 @@ class GlancesStdoutApiDoc(object):
stat_export = stat.get_export()
if stat_export is None or stat_export == [] or stat_export == {}:
continue
print_plugin_export(plugin, stat_export)
print_plugin_stats(plugin, stat)
print_plugin_description(plugin, stat)
print_plugin_item_value(plugin, stat, stat_export)