rootElement: $('#container'),
total: 0,
ready: function(){
+ $.get("/txtapi/status", function(data){
+ $('#serverStatus').html("<pre>" + data + "</pre>");
+ });
}
});
}
});
+App.ShowFilesRoute = Ember.Route.extend({
+ setupController: function(controller) {
+ App.showCodecsController.load();
+ }
+});
+
App.UsersRoute = Ember.Route.extend({
setupController: function(controller) {
App.usersController.load();
this.route("showCodecs");
this.route("showFiles");
this.route("showAPIs");
+ this.route("showStatus");
this.route("show");
this.route("users");
this.route("about", { path: "/about" });
}
});
+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(){
</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">