2 * Copyright (c) 2014 DataTorrent, Inc. ALL Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 .controller('LayoutsDemoCtrl', function($scope, widgetDefinitions, defaultWidgets, LayoutStorage, $interval) {
21 $scope.layoutOptions = {
22 storageId: 'demo-layouts',
23 storage: localStorage,
24 storageHash: 'fs4df4d51',
25 widgetDefinitions: widgetDefinitions,
26 defaultWidgets: defaultWidgets,
27 lockDefaultLayouts: true,
29 { title: 'Layout 1', active: true , defaultWidgets: defaultWidgets },
30 { title: 'Layout 2', active: false, defaultWidgets: defaultWidgets },
31 { title: 'Layout 3', active: false, defaultWidgets: defaultWidgets, locked: false }
34 $scope.randomValue = Math.random();
35 $interval(function () {
36 $scope.randomValue = Math.random();
40 .controller('LayoutsDemoExplicitSaveCtrl', function($scope, widgetDefinitions, defaultWidgets, LayoutStorage, $interval, $http) {
41 $http.get('raptor.htm?action=report.search.execute').then(
43 var data = result.data;
44 var report_id_name = [];
45 for (var i in data.rows[0]) {
46 report_id_name.push({index:i, value: data.rows[0][i][1].searchresultField.displayValue, title: data.rows[0][i][2].searchresultField.displayValue})
48 $scope.reports = report_id_name;
49 console.log($scope.reports);
50 $scope.report1 = $scope.reports[1];
53 $scope.rcloud_url= "https://rcloud.research.att.com/mini.html?notebook=c131ea997453e75303588699936d1896";
54 $scope.layoutOptions = {
55 storageId: 'demo-layouts-explicit-save',
56 storage: localStorage,
57 storageHash: 'fs4df4d51',
58 widgetDefinitions: widgetDefinitions,
59 defaultWidgets: defaultWidgets,
62 { title: 'Layout 1', active: true , defaultWidgets: defaultWidgets },
63 { title: 'Layout 2', active: false, defaultWidgets: defaultWidgets },
64 { title: 'Layout 3', active: false, defaultWidgets: defaultWidgets }
67 $scope.randomValue = Math.random();
68 $interval(function () {
69 $scope.randomValue = Math.random();