Github user aetomala commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/130#discussion_r16987056
--- Diff: usage/jsgui/src/main/webapp/assets/mobile/js/controllers.js ---
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+var bklnControllers =
angular.module('BrooklynApp.controllers',['ngResource']);
+
+//Brooklyn ApplicationList controller
+bklnControllers.controller('ApplicationListController', function($scope,
$interval, ApplicationService){
+ //
+ $scope.reloadTimer;
+ $scope.loadData = function(){
+ ApplicationService.query({}, function (applications){
+ $scope.applications = applications;
+ console.log('ApplicationListController: new data
loaded');
+ });
+ };
+
+ $scope.showDetails = function($event){
+ alert("swipe happened");
+ $event.stopPropagation();
+ console.dir ($event);
+ };
+
+ $scope.$on('$viewContentLoaded', function() {
+ console.log('ApplicationListController: loadeding');
+ $scope.loadData();
+ console.log('ApplicationListController: requested data');
+ $scope.reloadTimer = $interval($scope.loadData, 10000);
+ console.log('ApplicationListController: reload timer set');
+ console.log('ApplicationListController: loaded');
+ });
+
+ $scope.$on('$destroy', function() {
+ console.log('ApplicationListController: unloading');
+ if (angular.isDefined($scope.reloadTimer)) {
+ $interval.cancel($scope.reloadTimer);
+ $scope.reloadTimer = undefined;
+ }
+ console.log('ApplicationListController: reload timer stopped');
+ console.log('ApplicationListController: unloaded');
+ });
+
+});
+
+
+bklnControllers.controller('EntityListController', function($scope, $http,
$interval, $location, $routeParams){
+
+ $scope.reloadTimer;
+ $scope.path = $location.path().replace("#",'');
+ var shownPath = false;
+ $scope.loadData = function(){
+
+ $http({method: 'GET', url: $scope.path}).
+ success(function(data) {
+ $scope.entity = data;
+ $scope.name = (data.spec) ? data.spec.name : data.name;
+ var children = (data.links.children) ? data.links.children :
data.links.entities ;
+ $scope.back = (data.links.parent) ? data.links.parent :
"/v1/applications";
+ if (!shownPath) {
+ console.info ("Current path: "+ $location.path());
+ console.info ("Back path: "+ $scope.back);
+ shownPath = true;
--- End diff --
removed
Angel Tomala-Reyes (°²ç÷¶ù ÃÃÃÃàÃðù)
Senior Software Engineer, Advanced Cloud Technologies
Global Technology Services, IBM Corporation
15038 Union Turnpike 8F
Flushing, NY 11367
[email protected]
From: Svetoslav <[email protected]>
To: apache/incubator-brooklyn
<[email protected]>
Cc: Angel E Tomala Reyes/Poughkeepsie/IBM@IBMUS
Date: 09/02/2014 08:45 AM
Subject: Re: [incubator-brooklyn] First iteration brooklyn web mobile
app. (#130)
In usage/jsgui/src/main/webapp/assets/mobile/js/controllers.js:
> +
> + $scope.reloadTimer;
> + $scope.path = $location.path().replace("#",'');
> + var shownPath = false;
> + $scope.loadData = function(){
> +
> + $http({method: 'GET', url: $scope.path}).
> + success(function(data) {
> + $scope.entity = data;
> + $scope.name = (data.spec) ? data.spec.name :
data.name;
> + var children = (data.links.children) ?
data.links.children : data.links.entities ;
> + $scope.back = (data.links.parent) ?
data.links.parent : "/v1/applications";
> + if (!shownPath) {
> + console.info ("Current path: "+
$location.path());
> + console.info ("Back path: "+
$scope.back);
> + shownPath = true;
Seems like dev-time debugging helper, not needed any more?
¡ª
Reply to this email directly or view it on GitHub.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---