| OLD | NEW |
| 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"> | |
| 9 <link rel="import" href="../../bower_components/paper-search/paper-search-bar.ht
ml"> | 8 <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"> | 9 <link rel="import" href="../../bower_components/app-route/app-location.html"> |
| 11 <link rel="import" href="../../bower_components/app-route/app-route.html"> | 10 <link rel="import" href="../../bower_components/app-route/app-route.html"> |
| 11 <link rel="import" href="../../bower_components/app-layout/app-drawer-layout/app
-drawer-layout.html"> |
| 12 <link rel="import" href="../../bower_components/app-layout/app-header/app-header
.html"> |
| 13 <link rel="import" href="../../bower_components/app-layout/app-header-layout/app
-header-layout.html"> |
| 14 <link rel="import" href="../../bower_components/app-layout/app-toolbar/app-toolb
ar.html"> |
| 15 <link rel="import" href="../../bower_components/app-layout/app-scroll-effects/ef
fects/resize-title.html"> |
| 12 | 16 |
| 13 <link rel="import" href="../../common/auth-signin.html"> | 17 <link rel="import" href="../../common/auth-signin.html"> |
| 14 <link rel="import" href="config-set.html"> | 18 <link rel="import" href="config-set.html"> |
| 15 <link rel="import" href="front-page.html"> | 19 <link rel="import" href="front-page.html"> |
| 16 | 20 |
| 17 <dom-module id="config-ui"> | 21 <dom-module id="config-ui"> |
| 18 <template> | 22 <template> |
| 19 <style> | 23 <style> |
| 20 * { font-family: sans-serif; } | 24 * { font-family: sans-serif; } |
| 21 | 25 |
| 22 app-toolbar { | 26 app-toolbar { |
| 23 background-color: #efefef; | 27 background-color: var(--google-blue-500); |
| 24 color: #232323; | 28 color: #232323; |
| 29 height: 60px; |
| 25 } | 30 } |
| 26 | 31 |
| 27 app-header { @apply --layout-fixed-top; } | 32 .logo { |
| 28 | 33 height: 50px; |
| 29 .logo { height: 100%; } | 34 } |
| 30 | 35 |
| 31 .right { margin-left:15px; } | 36 .right { margin-left:15px; } |
| 32 | 37 |
| 33 .title { | 38 .title { |
| 34 padding-left: 1%; | 39 font-size: 125%; |
| 35 padding-bottom: 0.5%; | 40 color: white; |
| 36 font-size: 150%; | |
| 37 } | 41 } |
| 38 </style> | 42 </style> |
| 39 | 43 |
| 40 <app-header reveals> | 44 <app-drawer-layout fullbleed force-narrow> |
| 41 <app-toolbar> | |
| 42 <image class="logo" src="/static/images/chromium.png"/> | |
| 43 <div class="title" main-title> | |
| 44 Configuration Service (not fully implemented) | |
| 45 </div> | |
| 46 | 45 |
| 47 <template is="dom-if" if="[[client_id]]"> | 46 <app-header-layout> |
| 48 <auth-signin | 47 |
| 49 class="right" | 48 <app-header reveals slot="header" effects="resize-title"> |
| 50 client_id="[[client_id]]" | 49 <app-toolbar> |
| 51 auth_headers="{{auth_headers}}" | 50 <!--<image class="logo" src="/static/images/chromium.png"/>--> |
| 52 profile="{{profile}}" | 51 <div class="title" main-title> |
| 53 signed_in="{{signed_in}}"> | 52 Configuration Service |
| 54 </auth-signin> | 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> |
| 67 </app-toolbar> |
| 68 </app-header> |
| 69 |
| 70 <app-location route="{{route}}" use-hash-as-path></app-location> |
| 71 <app-route route="{{route}}" |
| 72 pattern="/services/:serviceName" |
| 73 data="{{serviceData}}" |
| 74 tail="{{serviceTail}}" |
| 75 active="{{serviceActive}}"></app-route> |
| 76 |
| 77 <app-route route="{{route}}" |
| 78 pattern="/projects/:projectName" |
| 79 data="{{projectData}}" |
| 80 tail="{{projectTail}}" |
| 81 active="{{projectActive}}"></app-route> |
| 82 |
| 83 <app-route route="{{route}}" |
| 84 pattern="/" |
| 85 active="{{frontPageActive}}"></app-route> |
| 86 |
| 87 <template is="dom-if" if="[[frontPageActive]]"> |
| 88 <front-page auth_headers="{{auth_headers}}"></front-page> |
| 55 </template> | 89 </template> |
| 56 <template is="dom-if" if="[[!client_id]]"> | 90 |
| 57 <div class="right">No OAauth client id found.</div> | 91 <template is="dom-if" if="[[serviceActive]]" restamp="true"> |
| 92 <config-set category="services" |
| 93 name="{{serviceData.serviceName}}" |
| 94 route="{{serviceTail}}" |
| 95 auth_headers="{{auth_headers}}" |
| 96 front-page-is-active="[[frontPageActive]]"></config-set> |
| 58 </template> | 97 </template> |
| 59 </app-toolbar> | |
| 60 </app-header> | |
| 61 | 98 |
| 99 <template is="dom-if" if="[[projectActive]]" restamp="true"> |
| 100 <config-set category="projects" |
| 101 name="{{projectData.projectName}}" |
| 102 route="{{projectTail}}" |
| 103 auth_headers="{{auth_headers}}" |
| 104 front-page-is-active="[[frontPageActive]]"></config-set> |
| 105 </template> |
| 62 | 106 |
| 63 <app-location route="{{route}}" use-hash-as-path></app-location> | 107 </app-header-layout> |
| 64 <app-route route="{{route}}" | |
| 65 pattern="/services/:serviceName" | |
| 66 data="{{serviceData}}" | |
| 67 tail="{{serviceTail}}" | |
| 68 active="{{serviceActive}}"></app-route> | |
| 69 | 108 |
| 70 <app-route route="{{route}}" | 109 </app-drawer-layout> |
| 71 pattern="/projects/:projectName" | |
| 72 data="{{projectData}}" | |
| 73 tail="{{projectTail}}" | |
| 74 active="{{projectActive}}"></app-route> | |
| 75 | |
| 76 <app-route route="{{route}}" | |
| 77 pattern="/" | |
| 78 active="{{frontPageActive}}"></app-route> | |
| 79 | |
| 80 <template is="dom-if" if="[[frontPageActive]]"> | |
| 81 <front-page auth_headers="{{auth_headers}}"></front-page> | |
| 82 </template> | |
| 83 | |
| 84 <template is="dom-if" if="[[serviceActive]]" restamp="true"> | |
| 85 <config-set category="services" | |
| 86 name="{{serviceData.serviceName}}" | |
| 87 route="{{serviceTail}}" | |
| 88 auth_headers="{{auth_headers}}" | |
| 89 front-page-is-active="[[frontPageActive]]"></config-set> | |
| 90 </template> | |
| 91 | |
| 92 <template is="dom-if" if="[[projectActive]]" restamp="true"> | |
| 93 <config-set category="projects" | |
| 94 name="{{projectData.projectName}}" | |
| 95 route="{{projectTail}}" | |
| 96 auth_headers="{{auth_headers}}" | |
| 97 front-page-is-active="[[frontPageActive]]"></config-set> | |
| 98 </template> | |
| 99 | 110 |
| 100 </template> | 111 </template> |
| 101 | 112 |
| 102 <script> | 113 <script> |
| 103 Polymer({ | 114 Polymer({ |
| 104 is: 'config-ui', | 115 is: 'config-ui', |
| 105 | 116 |
| 106 properties: { | 117 properties: { |
| 107 client_id: { | 118 client_id: { |
| 108 type: String, | 119 type: String, |
| 109 value: null | 120 value: null |
| 110 } | 121 } |
| 111 }, | 122 }, |
| 112 | 123 |
| 113 ready: function() { | 124 ready: function() { |
| 114 this.async(function() { | 125 this.async(function() { |
| 115 // If the path is blank, redirect to / | 126 // If the path is blank, redirect to / |
| 116 if (!this.route.path) { | 127 if (!this.route.path) { |
| 117 this.set('route.path', '/'); | 128 this.set('route.path', '/'); |
| 118 } | 129 } |
| 119 }); | 130 }); |
| 120 }, | 131 }, |
| 121 | 132 |
| 122 }); | 133 }); |
| 123 </script> | 134 </script> |
| 124 </dom-module> | 135 </dom-module> |
| OLD | NEW |