diff --git a/rd_ui/app/scripts/directives/query_directives.js b/rd_ui/app/scripts/directives/query_directives.js index 1aacd0a8..b06fdaad 100644 --- a/rd_ui/app/scripts/directives/query_directives.js +++ b/rd_ui/app/scripts/directives/query_directives.js @@ -220,6 +220,32 @@ } } + function schemaBrowser() { + return { + restrict: 'E', + scope: { + schema: '=' + }, + templateUrl: '/views/directives/schema_browser.html', + link: function ($scope) { + $scope.showTable = function(table) { + table.collapsed = !table.collapsed; + $scope.$broadcast('vsRepeatTrigger'); + } + + $scope.getSize = function(table) { + var size = 18; + + if (!table.collapsed) { + size += 18 * table.columns.length; + } + + return size; + } + } + } + } + function queryTimePicker() { return { restrict: 'E', @@ -332,5 +358,6 @@ .directive('queryEditor', ['QuerySnippet', queryEditor]) .directive('queryRefreshSelect', queryRefreshSelect) .directive('queryTimePicker', queryTimePicker) + .directive('schemaBrowser', schemaBrowser) .directive('queryFormatter', ['$http', 'growl', queryFormatter]); })(); diff --git a/rd_ui/app/views/directives/schema_browser.html b/rd_ui/app/views/directives/schema_browser.html new file mode 100644 index 00000000..b53bb89d --- /dev/null +++ b/rd_ui/app/views/directives/schema_browser.html @@ -0,0 +1,17 @@ +
+
+ +
+ +
+
+
+ {{table.name}} ({{table.size}}) +
+
+
{{column}}
+
+
+
+
diff --git a/rd_ui/app/views/query.html b/rd_ui/app/views/query.html index 5d896275..c0ac82de 100644 --- a/rd_ui/app/views/query.html +++ b/rd_ui/app/views/query.html @@ -96,24 +96,7 @@
- - +