]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add status on main page and add showFiles
authorSeven Du <dujinfang@gmail.com>
Mon, 22 Apr 2013 13:01:27 +0000 (21:01 +0800)
committerTravis Cross <tc@traviscross.com>
Fri, 7 Jun 2013 04:53:15 +0000 (04:53 +0000)
htdocs/portal/assets/js/fsportal.js
htdocs/portal/index.html

index 4689474414547607a438c19548e847209e8e0185..51c827b638989002f6f45ccc548b550ea95e704e 100644 (file)
@@ -35,6 +35,9 @@ var App = Ember.Application.create({
        rootElement: $('#container'),
        total: 0,
        ready: function(){
+               $.get("/txtapi/status", function(data){
+                       $('#serverStatus').html("<pre>" + data + "</pre>");
+               });
        }
 });
 
@@ -95,6 +98,12 @@ App.ShowCodecsRoute = Ember.Route.extend({
        }
 });
 
+App.ShowFilesRoute = Ember.Route.extend({
+       setupController: function(controller) {
+               App.showCodecsController.load();
+       }
+});
+
 App.UsersRoute = Ember.Route.extend({
        setupController: function(controller) {
                App.usersController.load();
@@ -109,6 +118,7 @@ App.Router.map(function(){
        this.route("showCodecs");
        this.route("showFiles");
        this.route("showAPIs");
+       this.route("showStatus");
        this.route("show");
        this.route("users");
        this.route("about", { path: "/about" });
@@ -313,6 +323,24 @@ App.showCodecsController = Ember.ArrayController.create({
        }
 });
 
+App.showFilesController = Ember.ArrayController.create({
+       content: [],
+       init: function(){
+       },
+       load: function() {
+               var me = this;
+               $.getJSON("/txtapi/show?files%20as%20json", function(data){
+                         // var channels = JSON.parse(data);
+                       me.set('total', data.row_count);
+                       me.content.clear();
+                       if (data.row_count == 0) return;
+
+                       me.pushObjects(data.rows);
+
+               });
+       }
+});
+
 App.usersController = Ember.ArrayController.create({
        content: [],
        init: function(){
index 476d2a12db274e53cc79376c2e1fb6b7689838e9..df2b0565776b9f53786d77b3e5e5e8d15d1bb885 100644 (file)
        </div>
 
        <script type="text/x-handlebars" data-template-name="index">
-               <h1>Welcome to FreeSWITCH Portal</h1>
-               Welcome
+               <h1>Welcome to FreeSWITCH !</h1>
+               ---- The World's First Cross-Platform Scalable FREE Multi-Protocol Soft Switch
+
+               <br>
+               <br>
+               <br>
+               <br>
+               <div id="serverStatus"></div>
        </script>
 
        <script type="text/x-handlebars" data-template-name="showApplications">
        </script>
 
        <script type="text/x-handlebars" data-template-name="showFiles">
-               Unimplemented
+               <h1>Files</h1>
+               <div>
+                       <table class="table">
+                       <tr>
+                               <th>Type</th>
+                               <th>Name</th>
+                               <th>iKey</th>
+                       </tr>
+                       {{#each App.showCodecsController.content}}
+                       <tr>
+                               <td>{{ type }}</td>
+                               <td>{{ name }}</td>
+                               <td>{{ ikey }}</td>
+                       </tr>
+                       {{/each}}
+                       </table>
+               </div>
        </script>
 
        <script type="text/x-handlebars" data-template-name="showAPIs">
                {{#linkTo "showCodecs"}} Codecs {{/linkTo}} |
                {{#linkTo "showFiles"}} Files {{/linkTo}} |
                {{#linkTo "showAPIs"}} APIs {{/linkTo}}
+
+               <br>
+
+               {{#linkTo "showStatus"}} Status {{/linkTo}}
+
        </script>
 
        <script type="text/x-handlebars" data-template-name="about">