]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
implement show modules
authorSeven Du <dujinfang@gmail.com>
Mon, 22 Apr 2013 15:11:34 +0000 (23:11 +0800)
committerTravis Cross <tc@traviscross.com>
Fri, 7 Jun 2013 04:53:17 +0000 (04:53 +0000)
htdocs/portal/assets/js/fsportal.js
htdocs/portal/index.html

index f519e28cc798b7f324d3c9660f3189af38a9afb4..c52f8f4f89818454da026df08319efb7d3f1bb4c 100644 (file)
@@ -68,23 +68,33 @@ App.ChannelsRoute = Ember.Route.extend({
 });
 
 
-App.ShowApplicationsRoute = Ember.Route.extend({
+App.ShowRegistrationsRoute = Ember.Route.extend({
        setupController: function(controller) {
                // Set the Controller's `title`
-               controller.set('title', "ShowApplications");
-               console.log("showApplications");
-               App.applicationsController.load();
+               controller.set('title', "ShowRegistrations");
+               App.registrationsController.load();
+       }//,
+       // renderTemplate: function() {
+               // this.render('calls');
+       // }
+});
+
+App.ShowModulesRoute = Ember.Route.extend({
+       setupController: function(controller) {
+               // Set the Controller's `title`
+               App.showModulesController.load();
        }//,
        // renderTemplate: function() {
                // this.render('calls');
        // }
 });
 
-App.ShowRegistrationsRoute = Ember.Route.extend({
+App.ShowApplicationsRoute = Ember.Route.extend({
        setupController: function(controller) {
                // Set the Controller's `title`
-               controller.set('title', "ShowRegistrations");
-               App.registrationsController.load();
+               controller.set('title', "ShowApplications");
+               console.log("showApplications");
+               App.applicationsController.load();
        }//,
        // renderTemplate: function() {
                // this.render('calls');
@@ -131,6 +141,7 @@ App.Router.map(function(){
        this.route("calls");
        this.route("channels");
        this.route("showRegistrations");
+       this.route("showModules");
        this.route("showApplications");
        this.route("showEndpoints");
        this.route("showCodecs");
@@ -408,6 +419,24 @@ App.showAPIsController = Ember.ArrayController.create({
        }
 });
 
+App.showModulesController = Ember.ArrayController.create({
+       content: [],
+       init: function(){
+       },
+       load: function() {
+               var me = this;
+               $.getJSON("/txtapi/show?module%20as%20json", function(data){
+                       me.set('total', data.row_count);
+                       me.content.clear();
+                       console.log(data);
+                       if (data.row_count == 0) return;
+
+                       me.pushObjects(data.rows);
+
+               });
+       }
+});
+
 App.usersController = Ember.ArrayController.create({
        content: [],
        init: function(){
index 5974beea4d3971808e7d5751574a5a58a530861f..1519b77bdcf2c19d8b026d7dd58a93746578910c 100644 (file)
                </div>
        </script>
 
+       <script type="text/x-handlebars" data-template-name="showModules">
+               <h1>Modules</h1>
+               <div>
+                       <table class="table">
+                       <tr>
+                               <th>Type</th>
+                               <th>Name</th>
+                               <th>iKey</th>
+                               <th>Fileame</th>
+                       </tr>
+                       {{#each App.showModulesController.content}}
+                       <tr>
+                               <td>{{ type }}</td>
+                               <td>{{ name }}</td>
+                               <td>{{ ikey }}</td>
+                               <td>{{ filename }}</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 "showModules"}} Modules {{/linkTo}} |
                {{#linkTo "showApplications"}} Applications {{/linkTo}} |
                {{#linkTo "showEndpoints"}} Endpoints {{/linkTo}} |
                {{#linkTo "showCodecs"}} Codecs {{/linkTo}} |
                Complete |
                Chat |
                Management |
-               Modules |
                Nat_map |
                Say |
                Interfaces |