From 4e7801905b3a12e74127a3018521693bfae1d90e Mon Sep 17 00:00:00 2001 From: Seven Du Date: Mon, 22 Apr 2013 22:33:14 +0800 Subject: [PATCH] add show registrations --- htdocs/portal/assets/js/fsportal.js | 31 +++++++++++++++++++++++++++ htdocs/portal/index.html | 33 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/htdocs/portal/assets/js/fsportal.js b/htdocs/portal/assets/js/fsportal.js index c1d425fbd3..f519e28cc7 100644 --- a/htdocs/portal/assets/js/fsportal.js +++ b/htdocs/portal/assets/js/fsportal.js @@ -80,6 +80,17 @@ App.ShowApplicationsRoute = Ember.Route.extend({ // } }); +App.ShowRegistrationsRoute = Ember.Route.extend({ + setupController: function(controller) { + // Set the Controller's `title` + controller.set('title', "ShowRegistrations"); + App.registrationsController.load(); + }//, + // renderTemplate: function() { + // this.render('calls'); + // } +}); + App.ShowEndpointsRoute = Ember.Route.extend({ setupController: function(controller) { // Set the Controller's `title` @@ -119,6 +130,7 @@ App.UsersRoute = Ember.Route.extend({ App.Router.map(function(){ this.route("calls"); this.route("channels"); + this.route("showRegistrations"); this.route("showApplications"); this.route("showEndpoints"); this.route("showCodecs"); @@ -271,6 +283,25 @@ App.channelsController = Ember.ArrayController.create({ }); +App.registrationsController = Ember.ArrayController.create({ + content: [], + init: function(){ + }, + load: function() { + var me = this; + $.getJSON("/txtapi/show?registrations%20as%20json", function(data){ + // var channels = JSON.parse(data); + console.log(data.row_count); + me.set('total', data.row_count); + me.content.clear(); + if (data.row_count == 0) return; + + me.pushObjects(data.rows); + + }); + } +}); + App.applicationsController = Ember.ArrayController.create({ content: [], init: function(){ diff --git a/htdocs/portal/index.html b/htdocs/portal/index.html index b53fb19092..5974beea4d 100644 --- a/htdocs/portal/index.html +++ b/htdocs/portal/index.html @@ -118,6 +118,38 @@
+ +