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

Side by Side Diff: appengine/swarming/ui/res/imp/common/swarming-app.html

Issue 2511463003: Move error-toast up and make server details problems easy to see (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 Copyright 2016 The LUCI Authors. All rights reserved. 2 Copyright 2016 The LUCI Authors. All rights reserved.
3 Use of this source code is governed under the Apache License, Version 2.0 3 Use of this source code is governed under the Apache License, Version 2.0
4 that can be found in the LICENSE file. 4 that can be found in the LICENSE file.
5 5
6 This in an HTML Import-able file that contains the definition 6 This in an HTML Import-able file that contains the definition
7 of the following elements: 7 of the following elements:
8 8
9 <swarming-app> 9 <swarming-app>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html"> 44 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html">
45 <link rel="import" href="/res/imp/bower_components/iron-media-query/iron-media-q uery.html"> 45 <link rel="import" href="/res/imp/bower_components/iron-media-query/iron-media-q uery.html">
46 <link rel="import" href="/res/imp/bower_components/paper-fab/paper-fab.html"> 46 <link rel="import" href="/res/imp/bower_components/paper-fab/paper-fab.html">
47 <link rel="import" href="/res/imp/bower_components/paper-icon-button/paper-icon- button.html"> 47 <link rel="import" href="/res/imp/bower_components/paper-icon-button/paper-icon- button.html">
48 <link rel="import" href="/res/imp/bower_components/paper-item/paper-item.html"> 48 <link rel="import" href="/res/imp/bower_components/paper-item/paper-item.html">
49 <link rel="import" href="/res/imp/bower_components/paper-menu/paper-menu.html"> 49 <link rel="import" href="/res/imp/bower_components/paper-menu/paper-menu.html">
50 <link rel="import" href="/res/imp/bower_components/paper-spinner/paper-spinner-l ite.html"> 50 <link rel="import" href="/res/imp/bower_components/paper-spinner/paper-spinner-l ite.html">
51 51
52 <link rel="import" href="auth-signin.html"> 52 <link rel="import" href="auth-signin.html">
53 <link rel="import" href="common-behavior.html"> 53 <link rel="import" href="common-behavior.html">
54 <link rel="import" href="error-toast.html">
54 55
55 <dom-module id="swarming-app"> 56 <dom-module id="swarming-app">
56 <template> 57 <template>
57 <style include="iron-flex"> 58 <style include="iron-flex">
58 :host { 59 :host {
59 position: absolute; 60 position: absolute;
60 top: 0; 61 top: 0;
61 bottom: 0; 62 bottom: 0;
62 left: 0; 63 left: 0;
63 right: 0; 64 right: 0;
64 } 65 }
65 66
66 app-toolbar { 67 app-toolbar {
67 background-color: #1F78B4; 68 background-color: #1F78B4;
68 color: #fff; 69 color: #fff;
69 } 70 }
70 71
72 app-toolbar.error {
73 background-color: #b41f1f;
74 color: #fff;
75 }
76
71 app-toolbar a { 77 app-toolbar a {
72 color: #fff; 78 color: #fff;
73 } 79 }
74 .left { 80 .left {
75 margin-right:15px; 81 margin-right:15px;
76 } 82 }
77 .right { 83 .right {
78 margin-left:15px; 84 margin-left:15px;
79 } 85 }
80 .main-content { 86 .main-content {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 </style> 128 </style>
123 129
124 <app-header-layout> 130 <app-header-layout>
125 <app-drawer id="mobile_menu"> 131 <app-drawer id="mobile_menu">
126 <div class="menu-item"><a class="left" href="/">Home</a></div> 132 <div class="menu-item"><a class="left" href="/">Home</a></div>
127 <div class="menu-item"><a class="left" href="/botlist">Bot List</a></d iv> 133 <div class="menu-item"><a class="left" href="/botlist">Bot List</a></d iv>
128 <div class="menu-item"><a class="left" href="/tasklist">Task List</a>< /div> 134 <div class="menu-item"><a class="left" href="/tasklist">Task List</a>< /div>
129 <div class="menu-item"><a class="left" href="/oldui">Old UI</a></div> 135 <div class="menu-item"><a class="left" href="/oldui">Old UI</a></div>
130 </app-drawer> 136 </app-drawer>
131 <app-header fixed> 137 <app-header fixed>
132 <app-toolbar> 138 <app-toolbar class$="[[_toolbarClass(client_id)]]">
133 <paper-icon-button 139 <paper-icon-button
134 class="menu-button" 140 class="menu-button"
135 icon="icons:menu" 141 icon="icons:menu"
136 on-tap="_toggleMobileMenu" 142 on-tap="_toggleMobileMenu"
137 hidden$="[[wide_layout]]"> 143 hidden$="[[wide_layout]]">
138 </paper-icon-button> 144 </paper-icon-button>
139 <div class="title left">[[name]]</div> 145 <div class="title left">[[name]]</div>
140 <paper-spinner-lite class="left" active="[[_or(busy,_busy1,_busy2)]]"> </paper-spinner-lite> 146 <paper-spinner-lite class="left" active="[[_or(busy,_busy1,_busy2)]]"> </paper-spinner-lite>
141 147
142 <a class="left" href="/" hidden$="[[!wide_layout]]">Home</a> 148 <a class="left" href="/" hidden$="[[!wide_layout]]">Home</a>
143 <a class="left" href="/botlist" hidden$="[[!wide_layout]]">Bot List</a > 149 <a class="left" href="/botlist" hidden$="[[!wide_layout]]">Bot List</a >
144 <a class="left" href="/tasklist" hidden$="[[!wide_layout]]">Task List< /a> 150 <a class="left" href="/tasklist" hidden$="[[!wide_layout]]">Task List< /a>
145 <div class="flex" hidden$="[[!wide_layout]]"></div> 151 <div class="flex" hidden$="[[!wide_layout]]"></div>
146 <a class="small right" href="/oldui" hidden$="[[!wide_layout]]">Old UI </a> 152 <template is="dom-if" if="[[client_id]]">
147 <div class="small right"> 153 <div class="small right">
148 Server: 154 Server:
149 <a href$="[[_versionLink(server_details)]]"> 155 <a href$="[[_versionLink(server_details)]]">
150 [[server_details.server_version]] 156 [[server_details.server_version]]
151 </a> 157 </a>
152 </div> 158 </div>
153 <auth-signin 159 <auth-signin
154 class="right" 160 class="right"
155 client_id="[[client_id]]" 161 client_id="[[client_id]]"
156 auth_headers="{{auth_headers}}" 162 auth_headers="{{auth_headers}}"
157 profile="{{profile}}" 163 profile="{{profile}}"
158 signed_in="{{signed_in}}"> 164 signed_in="{{signed_in}}">
159 </auth-signin> 165 </auth-signin>
166 </template>
167 <template is="dom-if" if="[[!client_id]]">
168 <div class="right">No OAauth client id found.</div>
169 </template>
160 </app-toolbar> 170 </app-toolbar>
161 </app-header> 171 </app-header>
162 <div class="main-content"> 172 <div class="main-content">
163 <content></content> 173 <content></content>
164 </div> 174 </div>
165 <a target="_blank" rel="noopener" href="https://bugs.chromium.org/p/chro mium/issues/entry?components=Infra%3EPlatform%3ESwarming&owner=kjlubick@chromium .org&status=Assigned"> 175 <error-toast></error-toast>
166 <paper-fab mini icon="icons:bug-report"></paper-fab> 176 <a target="_blank" rel="noopener" href="https://bugs.chromium.org/p/chromi um/issues/entry?components=Infra%3EPlatform%3ESwarming&owner=kjlubick@chromium.o rg&status=Assigned">
167 </a> 177 <paper-fab mini icon="icons:bug-report"></paper-fab>
178 </a>
168 </app-header-layout> 179 </app-header-layout>
169 180
170 <iron-media-query query="min-width: 600px" query-matches="{{wide_layout}}">< /iron-media-query> 181 <iron-media-query query="min-width: 600px" query-matches="{{wide_layout}}">< /iron-media-query>
171 182
172 </template> 183 </template>
173 <script> 184 <script>
174 Polymer({ 185 Polymer({
175 is: 'swarming-app', 186 is: 'swarming-app',
176 187
177 behaviors: [ 188 behaviors: [
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 type: Boolean, 240 type: Boolean,
230 value: false, 241 value: false,
231 } 242 }
232 243
233 }, 244 },
234 245
235 _load: function() { 246 _load: function() {
236 this._getJsonAsync("permissions", "/api/swarming/v1/server/permissions", 247 this._getJsonAsync("permissions", "/api/swarming/v1/server/permissions",
237 "_busy1", this.auth_headers); 248 "_busy1", this.auth_headers);
238 this._getJsonAsync("server_details", "/api/swarming/v1/server/details", 249 this._getJsonAsync("server_details", "/api/swarming/v1/server/details",
239 "_busy2", this.auth_headers) 250 "_busy2", this.auth_headers).catch(function(r){
251 sk.errorMessage("Http response: "+ (r.status || " ") + " " + r.respo nse);
252 });
240 }, 253 },
241 254
242 _toggleMobileMenu: function() { 255 _toggleMobileMenu: function() {
243 this.$.mobile_menu.toggle(); 256 this.$.mobile_menu.toggle();
244 }, 257 },
245 258
259 _toolbarClass: function(client_id) {
260 if (!client_id) {
261 return "error";
262 }
263 return "";
264 },
265
246 _versionLink: function(version) { 266 _versionLink: function(version) {
247 if (!version || !version.server_version) { 267 if (!version || !version.server_version) {
248 return undefined; 268 return undefined;
249 } 269 }
250 var split = version.server_version.split("-"); 270 var split = version.server_version.split("-");
251 if (split.length !== 2) { 271 if (split.length !== 2) {
252 return undefined; 272 return undefined;
253 } 273 }
254 return "https://github.com/luci/luci-py/commit/"+split[1]; 274 return "https://github.com/luci/luci-py/commit/"+split[1];
255 } 275 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 border: none; 363 border: none;
344 line-height: 20px; 364 line-height: 20px;
345 vertical-align: middle; 365 vertical-align: middle;
346 } 366 }
347 367
348 select { 368 select {
349 overflow-y: auto; 369 overflow-y: auto;
350 } 370 }
351 </style> 371 </style>
352 </dom-module> 372 </dom-module>
OLDNEW
« no previous file with comments | « appengine/swarming/ui/res/imp/botpage/bot-page.html ('k') | appengine/swarming/ui/res/imp/index/swarming-index-demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698