Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {{define "base"}} | 1 {{define "base"}} |
| 2 <!DOCTYPE html> | 2 <!DOCTYPE html> |
| 3 <html lang="en"> | 3 <html lang="en"> |
| 4 <!-- Copyright 2015 The LUCI Authors. All rights reserved. | 4 <!-- Copyright 2015 The LUCI Authors. All rights reserved. |
| 5 Use of this source code is governed under the Apache License, Version 2.0 | 5 Use of this source code is governed under the Apache License, Version 2.0 |
| 6 that can be found in the LICENSE file. --> | 6 that can be found in the LICENSE file. --> |
| 7 <head> | 7 <head> |
| 8 <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> | 8 <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> |
| 9 <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 9 <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 10 <meta name="viewport" content="width=device-width, initial-scale=1"> | 10 <meta name="viewport" content="width=device-width, initial-scale=1"> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 {{end}} | 92 {{end}} |
| 93 | 93 |
| 94 | 94 |
| 95 {{define "job-action-scripts"}} | 95 {{define "job-action-scripts"}} |
| 96 <script> | 96 <script> |
| 97 var xsrfToken = "{{.XsrfToken}}"; | 97 var xsrfToken = "{{.XsrfToken}}"; |
| 98 | 98 |
| 99 var postJobAction = function(btn, action) { | 99 var postJobAction = function(btn, action) { |
| 100 var form = $(btn).closest("form"); | 100 var form = $(btn).closest("form"); |
| 101 var projectID = $("input#projectID", form).val(); | 101 var projectID = $("input#projectID", form).val(); |
| 102 var jobID = $("input#jobID", form).val(); | 102 var JobName = $("input#JobName", form).val(); |
|
Vadim Sh.
2017/06/21 16:40:42
please keep it lowercase to conform to js naming s
tandrii(chromium)
2017/06/21 16:52:05
Done.
| |
| 103 var url = "/actions/" + action + "/" + projectID + "/" + jobID; | 103 var url = "/actions/" + action + "/" + projectID + "/" + JobName; |
| 104 if (!form.attr("submitted")) { | 104 if (!form.attr("submitted")) { |
| 105 $("input#xsrf_token", form).val(xsrfToken); | 105 $("input#xsrf_token", form).val(xsrfToken); |
| 106 form.attr("action", url); | 106 form.attr("action", url); |
| 107 form.attr("submitted", "yes"); | 107 form.attr("submitted", "yes"); |
| 108 form.submit(); | 108 form.submit(); |
| 109 } | 109 } |
| 110 }; | 110 }; |
| 111 </script> | 111 </script> |
| 112 {{end}} | 112 {{end}} |
| 113 | 113 |
| 114 | 114 |
| 115 {{define "job-action-buttons"}} | 115 {{define "job-action-buttons"}} |
| 116 <form style="display: inline" method="POST"> | 116 <form style="display: inline" method="POST"> |
| 117 <input type="hidden" id="xsrf_token" name="xsrf_token" value=""> | 117 <input type="hidden" id="xsrf_token" name="xsrf_token" value=""> |
| 118 <input type="hidden" id="projectID" value="{{.ProjectID}}"> | 118 <input type="hidden" id="projectID" value="{{.ProjectID}}"> |
| 119 <input type="hidden" id="jobID" value="{{.JobID}}"> | 119 <input type="hidden" id="JobName" value="{{.JobName}}"> |
| 120 <div class="btn-group btn-group-xs" role="group"> | 120 <div class="btn-group btn-group-xs" role="group"> |
| 121 {{if .Paused}} | 121 {{if .Paused}} |
| 122 <button type="button" class="btn btn-primary" onclick="postJobAction(this, 'resumeJob')"> | 122 <button type="button" class="btn btn-primary" onclick="postJobAction(this, 'resumeJob')"> |
| 123 Resume | 123 Resume |
| 124 </button> | 124 </button> |
| 125 {{else}} | 125 {{else}} |
| 126 <button type="button" class="btn btn-primary" onclick="postJobAction(this, 'pauseJob')"> | 126 <button type="button" class="btn btn-primary" onclick="postJobAction(this, 'pauseJob')"> |
| 127 Pause | 127 Pause |
| 128 </button> | 128 </button> |
| 129 {{end}} | 129 {{end}} |
| 130 <button type="button" class="btn btn-danger" onclick="postJobAction(this, 'a bortJob')"> | 130 <button type="button" class="btn btn-danger" onclick="postJobAction(this, 'a bortJob')"> |
| 131 Abort | 131 Abort |
| 132 </button> | 132 </button> |
| 133 <button type="button" class="btn btn-success" onclick="postJobAction(this, ' runJob')"> | 133 <button type="button" class="btn btn-success" onclick="postJobAction(this, ' runJob')"> |
| 134 Run now | 134 Run now |
| 135 </button> | 135 </button> |
| 136 </div> | 136 </div> |
| 137 </form> | 137 </form> |
| 138 {{end}} | 138 {{end}} |
| 139 | 139 |
| 140 | 140 |
| 141 {{define "invocation-action-scripts"}} | 141 {{define "invocation-action-scripts"}} |
| 142 <script> | 142 <script> |
| 143 var xsrfToken = "{{.XsrfToken}}"; | 143 var xsrfToken = "{{.XsrfToken}}"; |
| 144 | 144 |
| 145 var postInvocationAction = function(btn, action) { | 145 var postInvocationAction = function(btn, action) { |
| 146 var form = $(btn).closest("form"); | 146 var form = $(btn).closest("form"); |
| 147 var projectID = $("input#projectID", form).val(); | 147 var projectID = $("input#projectID", form).val(); |
| 148 var jobID = $("input#jobID", form).val(); | 148 var JobName = $("input#JobName", form).val(); |
| 149 var invID = $("input#invID", form).val(); | 149 var invID = $("input#invID", form).val(); |
| 150 var url = "/actions/" + action + "/" + projectID + "/" + jobID + "/" + invID; | 150 var url = "/actions/" + action + "/" + projectID + "/" + JobName + "/" + invID ; |
| 151 if (!form.attr("submitted")) { | 151 if (!form.attr("submitted")) { |
| 152 $("input#xsrf_token", form).val(xsrfToken); | 152 $("input#xsrf_token", form).val(xsrfToken); |
| 153 form.attr("action", url); | 153 form.attr("action", url); |
| 154 form.attr("submitted", "yes"); | 154 form.attr("submitted", "yes"); |
| 155 form.submit(); | 155 form.submit(); |
| 156 } | 156 } |
| 157 }; | 157 }; |
| 158 </script> | 158 </script> |
| 159 {{end}} | 159 {{end}} |
| 160 | 160 |
| 161 | 161 |
| 162 {{define "invocation-action-buttons"}} | 162 {{define "invocation-action-buttons"}} |
| 163 <form style="display: inline" method="POST"> | 163 <form style="display: inline" method="POST"> |
| 164 <input type="hidden" id="xsrf_token" name="xsrf_token" value=""> | 164 <input type="hidden" id="xsrf_token" name="xsrf_token" value=""> |
| 165 <input type="hidden" id="projectID" value="{{.ProjectID}}"> | 165 <input type="hidden" id="projectID" value="{{.ProjectID}}"> |
| 166 <input type="hidden" id="jobID" value="{{.JobID}}"> | 166 <input type="hidden" id="JobName" value="{{.JobName}}"> |
| 167 <input type="hidden" id="invID" value="{{.InvID}}"> | 167 <input type="hidden" id="invID" value="{{.InvID}}"> |
| 168 <div class="btn-group btn-group-xs" role="group"> | 168 <div class="btn-group btn-group-xs" role="group"> |
| 169 <button type="button" class="btn btn-danger" onclick="postInvocationAction(t his, 'abortInvocation')"> | 169 <button type="button" class="btn btn-danger" onclick="postInvocationAction(t his, 'abortInvocation')"> |
| 170 Abort | 170 Abort |
| 171 </button> | 171 </button> |
| 172 </div> | 172 </div> |
| 173 </form> | 173 </form> |
| 174 {{end}} | 174 {{end}} |
| 175 | 175 |
| 176 | 176 |
| 177 {{define "job-id-ref"}} | 177 {{define "job-id-ref"}} |
| 178 <span class="glyphicon {{.JobFlavorIcon}}" aria-hidden="true" title="{{.JobFlavo rTitle}}"> | 178 <span class="glyphicon {{.JobFlavorIcon}}" aria-hidden="true" title="{{.JobFlavo rTitle}}"> |
| 179 </span> | 179 </span> |
| 180 <a href="/jobs/{{.ProjectID}}/{{.JobID}}">{{.JobID}}</a> | 180 <a href="/jobs/{{.ProjectID}}/{{.JobName}}">{{.JobName}}</a> |
| 181 {{end}} | 181 {{end}} |
| OLD | NEW |