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

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

Issue 2487693002: Add mobile-friendly menu (Closed)
Patch Set: fix z-index and oldui link 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
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23 matching lines...) Expand all
34 signed_in: Boolean, if the user is signed in. 34 signed_in: Boolean, if the user is signed in.
35 Methods: 35 Methods:
36 None. 36 None.
37 37
38 Events: 38 Events:
39 None. 39 None.
40 --> 40 -->
41 41
42 <link rel="import" href="/res/imp/bower_components/app-layout/app-layout.html"> 42 <link rel="import" href="/res/imp/bower_components/app-layout/app-layout.html">
43 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la yout-classes.html"> 43 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la yout-classes.html">
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/paper-fab/paper-fab.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">
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">
49 <link rel="import" href="/res/imp/bower_components/paper-menu/paper-menu.html">
46 <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">
47 51
48
49 <link rel="import" href="auth-signin.html"> 52 <link rel="import" href="auth-signin.html">
50 <link rel="import" href="common-behavior.html"> 53 <link rel="import" href="common-behavior.html">
51 54
52 <dom-module id="swarming-app"> 55 <dom-module id="swarming-app">
53 <template> 56 <template>
54 <style include="iron-flex"> 57 <style include="iron-flex">
55 :host { 58 :host {
56 position: absolute; 59 position: absolute;
57 top: 0; 60 top: 0;
58 bottom: 0; 61 bottom: 0;
(...skipping 16 matching lines...) Expand all
75 margin-left:15px; 78 margin-left:15px;
76 } 79 }
77 .main-content { 80 .main-content {
78 padding: 3px; 81 padding: 3px;
79 } 82 }
80 83
81 .main-content a { 84 .main-content a {
82 color: #1F78B4; 85 color: #1F78B4;
83 } 86 }
84 87
88 .menu-button {
89 min-width: 40px;
90 }
91
85 auth-signin, .small { 92 auth-signin, .small {
86 font-size: .7em; 93 font-size: .7em;
87 } 94 }
88 95
96 #mobile_menu {
97 z-index: 10;
98 --app-drawer-content-container: {
99 margin-top: 64px;
100 };
101 }
102
103 a[href] {
104 color: #1F78B4;
105 }
106
107 .menu-item {
108 padding: 8px 3px;
109 border-bottom: 1px solid #CCC;
110 }
111
89 paper-fab { 112 paper-fab {
90 position: fixed; 113 position: fixed;
91 bottom: 5px; 114 bottom: 5px;
92 right: 5px; 115 right: 5px;
93 background-color: #1F78B4; 116 background-color: #1F78B4;
94 } 117 }
95 118
96 paper-spinner-lite { 119 paper-spinner-lite {
97 --paper-spinner-color: var(--google-yellow-500); 120 --paper-spinner-color: var(--google-yellow-500);
98 } 121 }
99 </style> 122 </style>
123
100 <app-header-layout> 124 <app-header-layout>
125 <app-drawer id="mobile_menu">
126 <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>
128 <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>
130 </app-drawer>
101 <app-header fixed> 131 <app-header fixed>
102 <app-toolbar> 132 <app-toolbar>
133 <paper-icon-button
134 class="menu-button"
135 icon="icons:menu"
136 on-tap="_toggleMobileMenu"
137 hidden$="[[wide_layout]]">
138 </paper-icon-button>
103 <div class="title left">[[name]]</div> 139 <div class="title left">[[name]]</div>
104 <paper-spinner-lite class="left" active="[[_or(busy,_busy1,_busy2)]]"> </paper-spinner-lite> 140 <paper-spinner-lite class="left" active="[[_or(busy,_busy1,_busy2)]]"> </paper-spinner-lite>
105 141
106 <a class="left" href="/">Home</a> 142 <a class="left" href="/" hidden$="[[!wide_layout]]">Home</a>
107 <a class="left" href="/botlist">Bot List</a> 143 <a class="left" href="/botlist" hidden$="[[!wide_layout]]">Bot List</a >
108 <a class="left" href="/tasklist">Task List</a> 144 <a class="left" href="/tasklist" hidden$="[[!wide_layout]]">Task List< /a>
109 <div class="flex"></div> 145 <div class="flex" hidden$="[[!wide_layout]]"></div>
110 <a class="small right" href="/oldui">Old UI</a> 146 <a class="small right" href="/oldui" hidden$="[[!wide_layout]]">Old UI </a>
111 <div class="small right"> 147 <div class="small right">
112 Server: 148 Server:
113 <a href$="[[_versionLink(server_details)]]"> 149 <a href$="[[_versionLink(server_details)]]">
114 [[server_details.server_version]] 150 [[server_details.server_version]]
115 </a> 151 </a>
116 </div> 152 </div>
117 <auth-signin 153 <auth-signin
118 class="right" 154 class="right"
119 client_id="[[client_id]]" 155 client_id="[[client_id]]"
120 auth_headers="{{auth_headers}}" 156 auth_headers="{{auth_headers}}"
121 profile="{{profile}}" 157 profile="{{profile}}"
122 signed_in="{{signed_in}}"> 158 signed_in="{{signed_in}}">
123 </auth-signin> 159 </auth-signin>
124 </app-toolbar> 160 </app-toolbar>
125 </app-header> 161 </app-header>
126 <div class="main-content"> 162 <div class="main-content">
127 <content></content> 163 <content></content>
128 </div> 164 </div>
129 <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"> 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">
130 <paper-fab mini icon="icons:bug-report"></paper-fab> 166 <paper-fab mini icon="icons:bug-report"></paper-fab>
131 </a> 167 </a>
132 </app-header-layout> 168 </app-header-layout>
133 169
170 <iron-media-query query="min-width: 600px" query-matches="{{wide_layout}}">< /iron-media-query>
171
134 </template> 172 </template>
135 <script> 173 <script>
136 Polymer({ 174 Polymer({
137 is: 'swarming-app', 175 is: 'swarming-app',
138 176
139 behaviors: [ 177 behaviors: [
140 SwarmingBehaviors.CommonBehavior, 178 SwarmingBehaviors.CommonBehavior,
141 ], 179 ],
142 180
143 properties: { 181 properties: {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 232
195 }, 233 },
196 234
197 _load: function() { 235 _load: function() {
198 this._getJsonAsync("permissions", "/api/swarming/v1/server/permissions", 236 this._getJsonAsync("permissions", "/api/swarming/v1/server/permissions",
199 "_busy1", this.auth_headers); 237 "_busy1", this.auth_headers);
200 this._getJsonAsync("server_details", "/api/swarming/v1/server/details", 238 this._getJsonAsync("server_details", "/api/swarming/v1/server/details",
201 "_busy2", this.auth_headers) 239 "_busy2", this.auth_headers)
202 }, 240 },
203 241
242 _toggleMobileMenu: function() {
243 this.$.mobile_menu.toggle();
244 },
245
204 _versionLink: function(version) { 246 _versionLink: function(version) {
205 if (!version || !version.server_version) { 247 if (!version || !version.server_version) {
206 return undefined; 248 return undefined;
207 } 249 }
208 var split = version.server_version.split("-"); 250 var split = version.server_version.split("-");
209 if (split.length !== 2) { 251 if (split.length !== 2) {
210 return undefined; 252 return undefined;
211 } 253 }
212 return "https://github.com/luci/luci-py/commit/"+split[1]; 254 return "https://github.com/luci/luci-py/commit/"+split[1];
213 } 255 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 border: none; 343 border: none;
302 line-height: 20px; 344 line-height: 20px;
303 vertical-align: middle; 345 vertical-align: middle;
304 } 346 }
305 347
306 select { 348 select {
307 overflow-y: auto; 349 overflow-y: auto;
308 } 350 }
309 </style> 351 </style>
310 </dom-module> 352 </dom-module>
OLDNEW
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698