Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2724)

Unified Diff: appengine/swarming/handlers_frontend.py

Issue 2362483002: Links to the newui preserve state (Closed) Base URL: git@github.com:luci/luci-py@nicer-botlist
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/swarming/templates/restricted_bot.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/handlers_frontend.py
diff --git a/appengine/swarming/handlers_frontend.py b/appengine/swarming/handlers_frontend.py
index 22088e7f4fb0642f6ffa0cc46532355bd2d7210e..5b5ddaa1f74644766c6a8a37b830181659c4435a 100644
--- a/appengine/swarming/handlers_frontend.py
+++ b/appengine/swarming/handlers_frontend.py
@@ -245,6 +245,9 @@ class BotsListHandler(auth.AuthenticatingHandler):
num_bots_dead = num_bots_dead_future.get_result()
num_bots_quarantined = num_bots_quarantined_future.get_result()
num_bots_total = num_bots_total_future.get_result()
+ try_link = '/newui/botlist?l=%d' % limit
+ if dimensions:
+ try_link += '&f=' + '&f='.join(dimensions)
params = {
'bots': bots,
'current_version': version,
@@ -258,6 +261,7 @@ class BotsListHandler(auth.AuthenticatingHandler):
'num_bots_busy': num_bots_busy,
'num_bots_dead': num_bots_dead,
'num_bots_quarantined': num_bots_quarantined,
+ 'try_link': try_link,
'sort_by': sort_by,
'sort_options': self.SORT_OPTIONS,
'xsrf_token': self.generate_xsrf_token(),
@@ -343,6 +347,7 @@ class BotHandler(auth.AuthenticatingHandler):
'now': now,
'run_results': run_results,
'run_time': run_time,
+ 'try_link': '/newui/bot?id=%s' % bot_id,
'xsrf_token': self.generate_xsrf_token(),
}
self.response.write(
@@ -520,6 +525,10 @@ class TasksHandler(auth.AuthenticatingHandler):
total_saved_percent = (
(100. * total_saved.total_seconds() / duration_sum.total_seconds())
if duration_sum else 0.)
+
+ try_link = '/newui/tasklist?l=%d' % limit
+ if task_tags:
+ try_link += '&f=' + '&f='.join(task_tags)
params = {
'cursor': cursor_str,
'duration_average': avg(durations),
@@ -545,6 +554,7 @@ class TasksHandler(auth.AuthenticatingHandler):
'total_cost_saved_usd': total_cost_saved_usd,
'total_saved': total_saved,
'total_saved_percent': total_saved_percent,
+ 'try_link': try_link,
'xsrf_token': self.generate_xsrf_token(),
}
# TODO(maruel): If admin or if the user is task's .user, show the Cancel
@@ -706,6 +716,7 @@ class TaskHandler(BaseTaskHandler):
'previous_task': previous_task,
'request': request,
'task': result,
+ 'try_link': '/newui/task?id=%s' % task_id,
'xsrf_token': self.generate_xsrf_token(),
}
self.response.write(template.render('swarming/user_task.html', params))
« no previous file with comments | « no previous file | appengine/swarming/templates/restricted_bot.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698