null+****@clear*****
null+****@clear*****
2012年 4月 5日 (木) 17:19:49 JST
Kouhei Sutou 2012-04-05 17:19:49 +0900 (Thu, 05 Apr 2012) New Revision: 0ea7981ddabdc4aaa234c7f98ce419b933726792 Log: admin: add suggest tab Modified files: data/html/admin/index.html data/html/admin/js/groonga-admin.js Modified: data/html/admin/index.html (+26 -0) =================================================================== --- data/html/admin/index.html 2012-04-05 17:07:20 +0900 (b546c22) +++ data/html/admin/index.html 2012-04-05 17:19:49 +0900 (f02e7f8) @@ -28,6 +28,7 @@ <h2>画面一覧</h2> <ul id="side-menu-view-list"> <li><a href="#side-menu-summary" id="side-menu-summary">サマリー</a></li> + <li><a href="#side-menu-suggest" id="side-menu-suggest">サジェスト</a></li> </ul> <h2>テーブル一覧</h2> <ul id="side-menu-tablelist" /> @@ -243,6 +244,31 @@ <input type="button" id="createcolumn-add-column" value="カラム追加"> </div> </div> + + <!-- suggest view --> + <div id="suggest-tabs"> + <ul> + <li><a href="#suggest-tab-search">検索</a></li> + </ul> + <div id="suggest-tab-search"> + <form id="suggest-tab-search-form"> + <p> + <label for="suggest-dataset">データセット: </label> + <input type="text" id="suggest-dataset"> + </p> + <label for="suggest-query">検索クエリ: </label> + <input type="text" id="suggest-query"> + <input type="checkbox" id="suggest-incremental" /> + <label for="suggest-incremental" + id="suggest-incremental-label">インクリメンタル検索</label> + <p> + <input type="button" id="suggest-submit" value="検索" /> + </p> + </form> + <div id="suggest-result"> + </div> + </div> + </div> </td> </tr> </table> Modified: data/html/admin/js/groonga-admin.js (+48 -14) =================================================================== --- data/html/admin/js/groonga-admin.js 2012-04-05 17:07:20 +0900 (4d39646) +++ data/html/admin/js/groonga-admin.js 2012-04-05 17:19:49 +0900 (a697797) @@ -77,19 +77,8 @@ function GroongaAdmin() { this.reload_record_func = function(){}; var that = this; - this.$database_tabs = $('#database-tabs').tabs({ - show: function(e, ui) { - that.stop_status_timer(); - if (ui.panel.id == 'database-tab-summary') { - that.start_status_timer(); - } - } - }); + this._initializeTabs(); - this.$table_tabs = $('#table-tabs').tabs({ - show: function(e, ui) { - } - }); $('#tab-tablelist-link').click(function() { that.tablelist(); }); @@ -144,10 +133,13 @@ function GroongaAdmin() { }); $('#side-menu-summary').click(function() { that.current_table = null; - $('#table-tabs').hide(); - $('#database-tabs').show(); + that._selectTab("database"); that.$database_tabs.tabs("select", "#database-tab-summary"); }); + $('#side-menu-suggest').click(function() { + that.current_table = null; + that._selectTab("suggest"); + }); this.update_tablelist(); var e1 = $('#createtable-key-type-builtin'); @@ -248,6 +240,47 @@ function GroongaAdmin() { jQuery.extend(GroongaAdmin.prototype, { SELECT_PARAMS_LIST: ['match_columns', 'query', 'filter', 'scorer', 'sortby', 'output_columns', 'offset', 'limit', 'drilldown', 'drilldown_sortby', 'drilldown_output_columns', 'drilldown_offset', 'drilldown_limit'], + _initializeTabs: function() { + var that = this; + + this.$database_tabs = $('#database-tabs').tabs({ + show: function(e, ui) { + that.stop_status_timer(); + if (ui.panel.id == 'database-tab-summary') { + that.start_status_timer(); + } + } + }); + + this.$table_tabs = $('#table-tabs').tabs({ + show: function(e, ui) { + } + }); + + this.$suggest_tabs = $('#suggest-tabs').tabs({ + show: function(e, ui) { + } + }); + + this._selectTab("database"); + }, + _selectTab: function(name) { + this.$database_tabs.hide(); + this.$table_tabs.hide(); + this.$suggest_tabs.hide(); + switch (name) { + case "table": + this.$table_tabs.show(); + break; + case "suggest": + this.$suggest_tabs.show(); + break; + case "database": + default: + this.$database_tabs.show(); + break; + } + }, start_status_timer: function() { var that = this; this.stop_status_timer(); @@ -459,6 +492,7 @@ jQuery.extend(GroongaAdmin.prototype, { .click(function() { that.current_table = table_name; $('#database-tabs').hide(); + $('#suggest-tabs').hide(); that.stop_status_timer(); $('#table-tabs').show(); that.columnlist(table_name);