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

Side by Side Diff: appengine/config_service/ui/src/config-ui/config-ui.html

Issue 2962703003: config_service: Add authentication to the UI. (Closed)
Patch Set: Added the modified file. Changes can be seen by clicking on Delta from patch set 2. Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 Copyright 2017 The LUCI Authors. All rights reserved. 2 Copyright 2017 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 6
7 <link rel="import" href="../../bower_components/polymer/polymer.html"> 7 <link rel="import" href="../../bower_components/polymer/polymer.html">
8 <link rel="import" href="../../bower_components/app-layout/app-layout.html"> 8 <link rel="import" href="../../bower_components/app-layout/app-layout.html">
9 <link rel="import" href="../../bower_components/paper-search/paper-search-bar.ht ml"> 9 <link rel="import" href="../../bower_components/paper-search/paper-search-bar.ht ml">
10 <link rel="import" href="../../bower_components/app-route/app-location.html"> 10 <link rel="import" href="../../bower_components/app-route/app-location.html">
11 <link rel="import" href="../../bower_components/app-route/app-route.html"> 11 <link rel="import" href="../../bower_components/app-route/app-route.html">
12 12
13 <link rel="import" href="../../common/auth-signin.html">
13 <link rel="import" href="config-set.html"> 14 <link rel="import" href="config-set.html">
14 <link rel="import" href="front-page.html"> 15 <link rel="import" href="front-page.html">
15 16
16 <dom-module id="config-ui"> 17 <dom-module id="config-ui">
17 <template> 18 <template>
18 <style> 19 <style>
20 * {
21 font-family: sans-serif;
22 }
23
19 app-toolbar { 24 app-toolbar {
20 background-color: #efefef; 25 background-color: #efefef;
21 color: #232323; 26 color: #232323;
22 } 27 }
23 28
24 app-header { 29 app-header {
25 @apply --layout-fixed-top; 30 @apply --layout-fixed-top;
26 } 31 }
27 32
28 .logo { 33 .logo {
29 height: 100%; 34 height: 100%;
30 } 35 }
31 36
37 .right {
38 margin-left:15px;
39 }
40
32 .title { 41 .title {
33 padding-left: 1%; 42 padding-left: 1%;
34 padding-bottom: 0.5%; 43 padding-bottom: 0.5%;
35 font-size: 150%; 44 font-size: 150%;
36 font-family: sans-serif;
37 } 45 }
38 </style> 46 </style>
39 47
40 <app-header reveals> 48 <app-header reveals>
41 <app-toolbar> 49 <app-toolbar>
42 <image class="logo" src="/static/images/chromium.png"/> 50 <image class="logo" src="/static/images/chromium.png"/>
43 <div class="title" main-title> 51 <div class="title" main-title>
44 Configuration Service (not fully implemented) 52 Configuration Service (not fully implemented)
45 </div> 53 </div>
54
55 <template is="dom-if" if="[[client_id]]">
56 <auth-signin
57 class="right"
58 client_id="[[client_id]]"
59 auth_headers="{{auth_headers}}"
60 profile="{{profile}}"
61 signed_in="{{signed_in}}">
62 </auth-signin>
63 </template>
64 <template is="dom-if" if="[[!client_id]]">
65 <div class="right">No OAauth client id found.</div>
66 </template>
46 </app-toolbar> 67 </app-toolbar>
47 </app-header> 68 </app-header>
48 69
49 70
50 <app-location route="{{route}}" use-hash-as-path></app-location> 71 <app-location route="{{route}}" use-hash-as-path></app-location>
51 <app-route route="{{route}}" 72 <app-route route="{{route}}"
52 pattern="/services/:serviceName" 73 pattern="/services/:serviceName"
53 data="{{serviceData}}" 74 data="{{serviceData}}"
54 tail="{{serviceTail}}" 75 tail="{{serviceTail}}"
55 active="{{serviceActive}}"></app-route> 76 active="{{serviceActive}}"></app-route>
56 77
57 <app-route route="{{route}}" 78 <app-route route="{{route}}"
58 pattern="/projects/:projectName" 79 pattern="/projects/:projectName"
59 data="{{projectData}}" 80 data="{{projectData}}"
60 tail="{{projectTail}}" 81 tail="{{projectTail}}"
61 active="{{projectActive}}"></app-route>--> 82 active="{{projectActive}}"></app-route>
62 83
63 <app-route route="{{route}}" 84 <app-route route="{{route}}"
64 pattern="/" 85 pattern="/"
65 active="{{frontPageActive}}"></app-route> 86 active="{{frontPageActive}}"></app-route>
66 87
67 <div hidden$="[[!frontPageActive]]"> 88 <div hidden$="[[!frontPageActive]]">
Sergey Berezin 2017/06/28 19:53:02 nit: would it also work if we wrap the subpages in
cwpayton 2017/06/29 22:28:15 This sounds like it would work a bit better for wh
68 <front-page></front-page> 89 <front-page auth_headers="{{auth_headers}}"
90 hidden="[[!frontPageActive]]"></front-page>
69 </div> 91 </div>
70 92
71 <div hidden$="[[!serviceActive]]"> 93 <div hidden$="[[!serviceActive]]">
72 <config-set category="services" 94 <config-set category="services"
73 name="{{serviceData.serviceName}}" 95 name="{{serviceData.serviceName}}"
74 route="{{serviceTail}}"></config-set> 96 route="{{serviceTail}}"
97 auth_headers="{{auth_headers}}"
98 hidden="[[!serviceActive]]"></config-set>
75 </div> 99 </div>
76 100
77 <div hidden$="[[!projectActive]]"> 101 <div hidden$="[[!projectActive]]">
78 <config-set category="projects" 102 <config-set category="projects"
79 name="{{projectData.projectName}}" 103 name="{{projectData.projectName}}"
80 route="{{projectTail}}"></config-set> 104 route="{{projectTail}}"
105 auth_headers="{{auth_headers}}"
106 hidden="[[!projectActive]]"></config-set>
81 </div> 107 </div>
82 108
83 </template> 109 </template>
84 110
85 <script> 111 <script>
86 Polymer({ 112 Polymer({
87 is: 'config-ui', 113 is: 'config-ui',
114
115 properties: {
116 auth_headers: {
117 type: Object,
118 notify: true
119 },
120
121 client_id: {
122 type: String,
123 value: null
124 },
125
126 profile: {
127 type: Object,
128 notify: true
129 }
130 },
88 131
89 ready: function() { 132 ready: function() {
90 this.async(function() { 133 this.async(function() {
91 // If the path is blank, redirect to / 134 // If the path is blank, redirect to /
92 if (!this.route.path) { 135 if (!this.route.path) {
93 this.set('route.path', '/'); 136 this.set('route.path', '/');
94 } 137 }
95 }); 138 });
96 }, 139 },
97 140
98 }); 141 });
99 </script> 142 </script>
100 </dom-module> 143 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698