]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add show registrations
authorSeven Du <dujinfang@gmail.com>
Mon, 22 Apr 2013 14:33:14 +0000 (22:33 +0800)
committerTravis Cross <tc@traviscross.com>
Fri, 7 Jun 2013 04:53:16 +0000 (04:53 +0000)
htdocs/portal/assets/js/fsportal.js
htdocs/portal/index.html

index c1d425fbd3750e29969fb16099633844a2b50807..f519e28cc798b7f324d3c9660f3189af38a9afb4 100644 (file)
@@ -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(){
index b53fb190920f32c6fae33cb6369d9a631be2b843..5974beea4d3971808e7d5751574a5a58a530861f 100644 (file)
                <div id="serverStatus"></div>
        </script>
 
+       <script type="text/x-handlebars" data-template-name="showRegistrations">
+               <h1>Registrations</h1>
+               <div>
+                       <table class="table">
+                       <tr>
+                               <th>Reg User</th>
+                               <th>Realm</th>
+                               <th>Expires</th>
+                               <th>Network IP</th>
+                               <th>Network Port</th>
+                               <th>Network Proto</th>
+                               <th>Hostname</th>
+                               <th>Metadata</th>
+                               <th>Token / Url</th>
+                       </tr>
+                       {{#each App.registrationsController.content}}
+                       <tr>
+                               <td>{{ reg_user }}</td>
+                               <td>{{ realm }}</td>
+                               <td>{{ expires }}</td>
+                               <td>{{ network_ip }}</td>
+                               <td>{{ network_port }}</td>
+                               <td>{{ network_proto }}</td>
+                               <td>{{ hostname }}</td>
+                               <td>{{ metadata }}</td>
+                               <td>{{ token }}<br>{{ url }}</td>
+                       </tr>
+                       {{/each}}
+                       </table>
+               </div>
+       </script>
+
        <script type="text/x-handlebars" data-template-name="showApplications">
                <h1>Applications</h1>
                <div>
 
        <script type="text/x-handlebars" data-template-name="show">
                <h1>Show</h1>
+               {{#linkTo "showRegistrations"}} Registrations {{/linkTo}} |
                {{#linkTo "showApplications"}} Applications {{/linkTo}} |
                {{#linkTo "showEndpoints"}} Endpoints {{/linkTo}} |
                {{#linkTo "showCodecs"}} Codecs {{/linkTo}} |