From 4e70d7de302d18a83788305b9f8f516710f77668 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Tue, 4 Jun 2013 09:32:38 +0800 Subject: [PATCH] show tasks --- htdocs/portal/assets/js/fsportal.js | 24 ++++++++++++++++++++++++ htdocs/portal/index.html | 26 +++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/htdocs/portal/assets/js/fsportal.js b/htdocs/portal/assets/js/fsportal.js index 9b65e68bf4..818a8bf5c8 100644 --- a/htdocs/portal/assets/js/fsportal.js +++ b/htdocs/portal/assets/js/fsportal.js @@ -142,6 +142,12 @@ App.ShowChatsRoute = Ember.Route.extend({ } }); +App.ShowTasksRoute = Ember.Route.extend({ + setupController: function(controller) { + App.showTasksController.load(); + } +}); + App.ShowLimitsRoute = Ember.Route.extend({ setupController: function(controller) { App.showLimitsController.load(); @@ -167,6 +173,7 @@ App.Router.map(function(){ this.route("showSays"); this.route("showChats"); this.route("showInterfaces"); + this.route("showTasks"); this.route("showLimits"); this.route("show"); this.route("users"); @@ -509,6 +516,23 @@ App.showInterfacesController = Ember.ArrayController.create({ } }); +App.showTasksController = Ember.ArrayController.create({ + content: [], + init: function(){ + }, + load: function() { + var me = this; + $.getJSON("/txtapi/show?tasks%20as%20json", function(data){ + me.set('total', data.row_count); + me.content.clear(); + if (data.row_count == 0) return; + + me.pushObjects(data.rows); + + }); + } +}); + App.showLimitsController = Ember.ArrayController.create({ content: [], init: function(){ diff --git a/htdocs/portal/index.html b/htdocs/portal/index.html index 0f8c4a16ee..257aaa057c 100644 --- a/htdocs/portal/index.html +++ b/htdocs/portal/index.html @@ -337,6 +337,30 @@ + +