[Groonga-commit] groonga/groonga-admin at 0935914 [master] Add table list view

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Dec 31 17:06:22 JST 2014


Kouhei Sutou	2014-12-31 17:06:22 +0900 (Wed, 31 Dec 2014)

  New Revision: 09359144252413e1f49756fee77130efb9dd0b9a
  https://github.com/groonga/groonga-admin/commit/09359144252413e1f49756fee77130efb9dd0b9a

  Message:
    Add table list view

  Added files:
    app/scripts/controllers/table-index-controller.js
    app/views/tables/index.html
  Modified files:
    app/index.html
    app/scripts/app.js
    app/scripts/groonga-client/response/table-list.js
    app/styles/main.scss

  Modified: app/index.html (+1 -0)
===================================================================
--- app/index.html    2014-12-31 17:02:27 +0900 (6b3aba5)
+++ app/index.html    2014-12-31 17:06:22 +0900 (36b549c)
@@ -83,6 +83,7 @@
         <script src="scripts/app.js"></script>
         <script src="scripts/services/schema-loader.js"></script>
         <script src="scripts/controllers/top-controller.js"></script>
+        <script src="scripts/controllers/table-index-controller.js"></script>
         <script src="scripts/controllers/table-show-controller.js"></script>
         <script src="scripts/controllers/table-search-controller.js"></script>
         <script src="scripts/controllers/column-show-controller.js"></script>

  Modified: app/scripts/app.js (+4 -0)
===================================================================
--- app/scripts/app.js    2014-12-31 17:02:27 +0900 (fada4d7)
+++ app/scripts/app.js    2014-12-31 17:06:22 +0900 (fa0de22)
@@ -25,6 +25,10 @@ angular
         templateUrl: 'views/top.html',
         controller: 'TopController'
       })
+      .when('/tables/', {
+        templateUrl: 'views/tables/index.html',
+        controller: 'TableIndexController'
+      })
       .when('/tables/:table/', {
         templateUrl: 'views/tables/show.html',
         controller: 'TableShowController'

  Added: app/scripts/controllers/table-index-controller.js (+33 -0) 100644
===================================================================
--- /dev/null
+++ app/scripts/controllers/table-index-controller.js    2014-12-31 17:06:22 +0900 (7ea9c9d)
@@ -0,0 +1,33 @@
+'use strict';
+
+/**
+ * @ngdoc function
+ * @name groongaAdminApp.controller:TableIndexController
+ * @description
+ * # TableIndexController
+ * Controller of the groongaAdminApp
+ */
+angular.module('groongaAdminApp')
+  .controller('TableIndexController', [
+    '$scope', 'schemaLoader',
+    function ($scope, schemaLoader) {
+      var schema;
+
+      function initialize() {
+        $scope.tables = [];
+      }
+
+      initialize();
+      schemaLoader()
+        .then(function(_schema) {
+          schema = _schema;
+
+          var tables = [];
+          angular.forEach(schema.tables, function(value) {
+            tables.push(value);
+          });
+          $scope.tables = tables.sort(function(table1, table2) {
+            return (table1.name > table2.name) ? 1 : -1;
+          });
+        });
+    }]);

  Modified: app/scripts/groonga-client/response/table-list.js (+2 -2)
===================================================================
--- app/scripts/groonga-client/response/table-list.js    2014-12-31 17:02:27 +0900 (f70f91c)
+++ app/scripts/groonga-client/response/table-list.js    2014-12-31 17:06:22 +0900 (abe8e84)
@@ -32,8 +32,8 @@
         case 'flags':
           value = value.split('|');
           break;
-        case 'source':
-          name = 'sources';
+        case 'default_tokenizer':
+          name = 'tokenizer';
           break;
         }
         table[name] = table.properties[name] = value;

  Modified: app/styles/main.scss (+1 -0)
===================================================================
--- app/styles/main.scss    2014-12-31 17:02:27 +0900 (662a45a)
+++ app/styles/main.scss    2014-12-31 17:06:22 +0900 (751cda2)
@@ -38,6 +38,7 @@ $icon-font-path: "../bower_components/bootstrap-sass-official/assets/fonts/boots
   }
 }
 
+.tables,
 .table-search-result,
 .table-properties,
 .table-columns,

  Added: app/views/tables/index.html (+44 -0) 100644
===================================================================
--- /dev/null
+++ app/views/tables/index.html    2014-12-31 17:06:22 +0900 (cd51b90)
@@ -0,0 +1,44 @@
+<div class="container-fluid" ng-controller="TableIndexController">
+  <ol class="breadcrumb">
+    <li><a href="#/">Top</a></li>
+    <li class="active"><a href="#/tables/">Tables</a></li>
+  </ol>
+
+  <div class="alert alert-warning" ng-show="message.length &gt; 0">
+    <p>{{message}}</p>
+  </div>
+
+  <h2>Tables</h2>
+  <div class="tables">
+    <table>
+      <thead>
+        <tr>
+          <th>id</th>
+          <th>name</th>
+          <th>type</th>
+          <th>value type</th>
+          <th>normalizer</th>
+          <th>tokenizer</th>
+          <th>token filters</th>
+          <th>path</th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr ng-repeat="table in tables track by $index">
+          <td>{{table.id}}</td>
+          <td>
+            <a href="#/tables/{{table.name}}">
+              {{table.name}}
+            </a>
+          </td>
+          <td>{{table.type}}</td>
+          <td>{{table.range}}</td>
+          <td>{{table.normalizer}}</td>
+          <td>{{table.tokenizer}}</td>
+          <td>{{table.token_filters}}</td>
+          <td>{{table.path}}</td>
+        </tr>
+      </tbody>
+    </table>
+  </div>
+</div>
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index