##// END OF EJS Templates
system-info: fix translatio of uptime string.
marcink -
r1462:af7abb96 default
parent child Browse files
Show More
@@ -121,6 +121,7 b' def platform_type():'
121 121
122 122 def uptime():
123 123 from rhodecode.lib.helpers import age, time_to_datetime
124 from rhodecode.translation import TranslationString
124 125
125 126 value = dict(boot_time=0, uptime=0, text='')
126 127 state = STATE_OK_DEFAULT
@@ -131,13 +132,15 b' def uptime():'
131 132 value['boot_time'] = boot_time
132 133 value['uptime'] = time.time() - boot_time
133 134
135 date_or_age = age(time_to_datetime(boot_time))
136 if isinstance(date_or_age, TranslationString):
137 date_or_age = date_or_age.interpolate()
138
134 139 human_value = value.copy()
135 140 human_value['boot_time'] = time_to_datetime(boot_time)
136 141 human_value['uptime'] = age(time_to_datetime(boot_time), show_suffix=False)
137 142
138 human_value['text'] = u'Server started {}'.format(
139 age(time_to_datetime(boot_time)))
140
143 human_value['text'] = u'Server started {}'.format(date_or_age)
141 144 return SysInfoRes(value=value, human_value=human_value)
142 145
143 146
General Comments 0
You need to be logged in to leave comments. Login now