add show complete

This commit is contained in:
Seven Du 2013-06-04 09:52:14 +08:00
parent 68f1d34dfc
commit d92074233c
2 changed files with 63 additions and 2 deletions

View File

@ -136,6 +136,12 @@ App.ShowAliasesRoute = Ember.Route.extend({
} }
}); });
App.ShowCompletesRoute = Ember.Route.extend({
setupController: function(controller) {
App.showCompletesController.load();
}
});
App.ShowManagementsRoute = Ember.Route.extend({ App.ShowManagementsRoute = Ember.Route.extend({
setupController: function(controller) { setupController: function(controller) {
App.showManagementsController.load(); App.showManagementsController.load();
@ -195,6 +201,7 @@ App.Router.map(function(){
this.route("showFiles"); this.route("showFiles");
this.route("showAPIs"); this.route("showAPIs");
this.route("showAliases"); this.route("showAliases");
this.route("showCompletes");
this.route("showManagements"); this.route("showManagements");
this.route("showSays"); this.route("showSays");
this.route("showChats"); this.route("showChats");
@ -509,6 +516,23 @@ App.showAliasesController = Ember.ArrayController.create({
} }
}); });
App.showCompletesController = Ember.ArrayController.create({
content: [],
init: function(){
},
load: function() {
var me = this;
$.getJSON("/txtapi/show?complete%20as%20json", function(data){
me.set('total', data.row_count);
me.content.clear();
if (data.row_count == 0) return;
me.pushObjects(data.rows);
});
}
});
App.showManagementsController = Ember.ArrayController.create({ App.showManagementsController = Ember.ArrayController.create({
content: [], content: [],
init: function(){ init: function(){

View File

@ -299,6 +299,44 @@
</div> </div>
</script> </script>
<script type="text/x-handlebars" data-template-name="showCompletes">
<h1>Aliases</h1>
<div>
<table class="table">
<tr>
<th>Sticky</th>
<th>A1</th>
<th>A2</th>
<th>A3</th>
<th>A4</th>
<th>A5</th>
<th>A6</th>
<th>A7</th>
<th>A8</th>
<th>A9</th>
<th>A10</th>
<th>Hostname</th>
</tr>
{{#each App.showCompletesController.content}}
<tr>
<td>{{ sticky }}</td>
<td>{{ a1 }}</td>
<td>{{ a2 }}</td>
<td>{{ a3 }}</td>
<td>{{ a4 }}</td>
<td>{{ a5 }}</td>
<td>{{ a6 }}</td>
<td>{{ a7 }}</td>
<td>{{ a8 }}</td>
<td>{{ a9 }}</td>
<td>{{ a10 }}</td>
<td>{{ hostname }}</td>
</tr>
{{/each}}
</table>
</div>
</script>
<script type="text/x-handlebars" data-template-name="showManagements"> <script type="text/x-handlebars" data-template-name="showManagements">
<h1>Say</h1> <h1>Say</h1>
<div> <div>
@ -451,8 +489,7 @@
{{#linkTo "showFiles"}} Files {{/linkTo}} | {{#linkTo "showFiles"}} Files {{/linkTo}} |
{{#linkTo "showAPIs"}} APIs {{/linkTo}} | {{#linkTo "showAPIs"}} APIs {{/linkTo}} |
{{#linkTo "showAliases"}} Aliases {{/linkTo}} | {{#linkTo "showAliases"}} Aliases {{/linkTo}} |
{{#linkTo "showCompletes"}} Complete {{/linkTo}} |
Complete |
{{#linkTo "showChats"}} Chat {{/linkTo}} | {{#linkTo "showChats"}} Chat {{/linkTo}} |
{{#linkTo "showManagements"}} Management {{/linkTo}} | {{#linkTo "showManagements"}} Management {{/linkTo}} |
Nat_map | Nat_map |