##// 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 def uptime():
122 def uptime():
123 from rhodecode.lib.helpers import age, time_to_datetime
123 from rhodecode.lib.helpers import age, time_to_datetime
124 from rhodecode.translation import TranslationString
124
125
125 value = dict(boot_time=0, uptime=0, text='')
126 value = dict(boot_time=0, uptime=0, text='')
126 state = STATE_OK_DEFAULT
127 state = STATE_OK_DEFAULT
@@ -131,13 +132,15 b' def uptime():'
131 value['boot_time'] = boot_time
132 value['boot_time'] = boot_time
132 value['uptime'] = time.time() - boot_time
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 human_value = value.copy()
139 human_value = value.copy()
135 human_value['boot_time'] = time_to_datetime(boot_time)
140 human_value['boot_time'] = time_to_datetime(boot_time)
136 human_value['uptime'] = age(time_to_datetime(boot_time), show_suffix=False)
141 human_value['uptime'] = age(time_to_datetime(boot_time), show_suffix=False)
137
142
138 human_value['text'] = u'Server started {}'.format(
143 human_value['text'] = u'Server started {}'.format(date_or_age)
139 age(time_to_datetime(boot_time)))
140
141 return SysInfoRes(value=value, human_value=human_value)
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