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

Unified Diff: appengine/config_service/ui/src/config-ui/config-set.html

Issue 2953463002: config_service: integrated working config set page with routing (Closed)
Patch Set: Nit: fixed 80+ char line Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: appengine/config_service/ui/src/config-ui/config-set.html
diff --git a/appengine/config_service/ui/src/config-ui/config-set.html b/appengine/config_service/ui/src/config-ui/config-set.html
new file mode 100644
index 0000000000000000000000000000000000000000..d89fdb05457923fa7177877f0dd997ad810b91b2
--- /dev/null
+++ b/appengine/config_service/ui/src/config-ui/config-set.html
@@ -0,0 +1,104 @@
+<!--
+ Copyright 2017 The LUCI Authors. All rights reserved.
+ Use of this source code is governed under the Apache License, Version 2.0
+ that can be found in the LICENSE file.
+-->
+
+<link rel="import" href="config-file-card.html">
+<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
+<link rel="import" href="../../bower_components/paper-item/paper-item.html">
+<link rel="import" href="../../bower_components/polymer/polymer.html">
+
+<dom-module id="config-set">
+ <template>
+ <style>
+ .category {
+ font-size: 100%;
+ font-family: sans-serif;
+ }
+
+ .center {
+ width: 27%;
+ margin: auto;
+ text-align: left;
+ }
+
+ .name {
+ font-size: 200%;
+ font-family: sans-serif;
+ }
+
+ .title {
+ padding-bottom: 1%;
+ padding-top: 5%;
+ }
+ </style>
+
+ <iron-ajax
+ auto
+ id="requestConfigs"
+ url="/_ah/api/config/v1/config-sets?config_set=[[category]]%2F[[name]]&include_files=true"
+ handle-as="json"
+ on-response="_onGotConfigFiles">
+ </iron-ajax>
+
+ <div class="center title">
+ <div class="name">[[name]][[route.path]]</div>
+ <div class="category">[[_formatCategory(category)]]</div>
+ </div>
+
+ <template is="dom-if" if="[[isLoading]]">
+ <div class="center">Fetching config files...</div>
+ </template>
+ <template is="dom-if" if="[[_not(isLoading)]]">
+ <template is="dom-repeat" items="[[files]]" as="file">
+ <config-file-card
+ name="[[file.path]]" link="[[location]]/[[file.path]]">
+ </config-file-card>
+ </template>
+ </template>
+ </template>
+ <script>
+ Polymer({
+ is: "config-set",
+
+ properties: {
+ category: {
+ type: String
+ },
+
+ files: {
+ type: Array
+ },
+
+ isLoading: {
+ type: Boolean,
+ value: true
+ },
+
+ location: {
+ type: String
+ },
+
+ name: {
+ type: String
+ }
+ },
+
+ _formatCategory: function(category) {
+ if (category === "projects") return "Project";
+ if (category === "services") return "Service";
+ },
+
+ _not: function(b) {
+ return !b;
+ },
+
+ _onGotConfigFiles: function(event) {
+ this.files = event.detail.response.config_sets[0].files;
+ this.location = event.detail.response.config_sets[0].location;
+ this.isLoading = false;
+ }
+ });
+ </script>
+</dom-module>

Powered by Google App Engine
This is Rietveld 408576698