diff --git a/htdocs/portal/assets/js/fsportal.js b/htdocs/portal/assets/js/fsportal.js index 51c827b638..c1d425fbd3 100644 --- a/htdocs/portal/assets/js/fsportal.js +++ b/htdocs/portal/assets/js/fsportal.js @@ -100,7 +100,13 @@ App.ShowCodecsRoute = Ember.Route.extend({ App.ShowFilesRoute = Ember.Route.extend({ setupController: function(controller) { - App.showCodecsController.load(); + App.showFilesController.load(); + } +}); + +App.ShowAPIsRoute = Ember.Route.extend({ + setupController: function(controller) { + App.showAPIsController.load(); } }); @@ -118,7 +124,6 @@ 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" }); @@ -341,6 +346,37 @@ App.showFilesController = Ember.ArrayController.create({ } }); +App.showAPIsController = Ember.ArrayController.create({ + content: [], + init: function(){ + }, + load: function() { + var me = this; + $.getJSON("/txtapi/show?api%20as%20json", function(data){ + // var channels = JSON.parse(data); + me.set('total', data.row_count); + me.content.clear(); + if (data.row_count == 0) return; + + var rows = []; + data.rows.forEach(function(r) { + if (r.name == "show") { + r.syntax = r.syntax.replace(/\|/g, "\n"); + } else if (r.name == "fsctl") { + r.syntax = r.syntax.replace(/\]\|/g, "]\n"); + } else { + r.syntax = r.syntax.replace(/\n/g, "\n"); + } + // console.log(r.syntax); + rows.push(r); + }); + + me.pushObjects(rows); + + }); + } +}); + App.usersController = Ember.ArrayController.create({ content: [], init: function(){ diff --git a/htdocs/portal/index.html b/htdocs/portal/index.html index df2b056577..b53fb19092 100644 --- a/htdocs/portal/index.html +++ b/htdocs/portal/index.html @@ -189,7 +189,7 @@ Name iKey - {{#each App.showCodecsController.content}} + {{#each App.showFilesController.content}} {{ type }} {{ name }} @@ -201,7 +201,26 @@