-
- $scope.ReLoadDashboardFromViewResetComboBox = function(type, amount)//('Users','All') ('Accounts','All') ('Creation_times','All')
- {
- console.log("ReLoadDashboardFromViewResetComboBox");
- };
-
-
-
- //////////////////////////////////
-
- $scope.total_tdr_team_selected_model = [];
- $scope.total_tdr_users_selected_model = [];
- $scope.total_tdr_requests_selected_model = [];
- $scope.total_tdr_entities_selected_model = [];
-
- $scope.reloadTDRDashboard = function(name)
- {
- console.log("reloadTDRDashboard");
- var url = "/testdata-service/test-data-request/dashboard/counts.json?";
-
- $http.get(url+params).success(function(data)
- {
- console.log("success");
- $scope.total_tdr_team_count = data.result.dashboardCountModel.teams;
- $scope.total_tdr_users_count = data.result.dashboardCountModel.users;
- $scope.total_tdr_requests_count = data.result.dashboardCountModel.requests;
- $scope.total_tdr_entities_count = data.result.dashboardCountModel.entities;
-
-
- if("team"!=name)
- {
- $scope.total_tdr_team_array = $scope.returnObjectArray(data.result.tdrDashboardModel.teams);
- $scope.TDRTeamGridId.api().clear().draw();
- $scope.TDRTeamGridId.fnAddData($scope.total_tdr_team_array);
- }
-
-
- if("users"!=name)
- {
- $scope.total_tdr_users_array = $scope.returnObjectArray(data.result.tdrDashboardModel.users);
- $scope.TDRUserGridId.api().clear().draw();
- $scope.TDRUserGridId.fnAddData($scope.total_tdr_users_array);
- }
-
- if("status"!=name)
- {
- $scope.total_tdr_entities_array = $scope.returnObjectArray(data.result.tdrDashboardModel.entities);
- $scope.TDREntitiesGridId.api().clear().draw();
- $scope.TDREntitiesGridId.fnAddData($scope.total_tdr_entities_array);
- }
-
- if("request"!=name)
- {
- $scope.total_tdr_requests_array = $scope.returnObjectArray(data.result.tdrDashboardModel.requests);
- $scope.TDRNumberGridId.api().clear().draw();
- $scope.TDRNumberGridId.fnAddData($scope.total_tdr_requests_array);
- }
- });
-
- };
-
-
- $scope.loadTDRDashboard = function()
- {
- console.log("loadTDRDashboard");
- $rootScope.launch('wait');
-
- /* api jobs */
- var apiJobUrl = "/utm-service/em/jobs?timezoneOffset=420";
-
- $http.get(apiJobUrl).success(function(data)
- {
- console.log("success");
- $scope.total_test_scenario_count = data.length;
-
-
- $scope.TDRNumberGridId = $('#TDRNumberGridId').dataTable( {
- "serverSide": false,
- "aoColumns": [
-
- { "sTitle": "","mDataProp": null, "sWidth": "20px", "bSortable": false},
- { "sTitle":"Total TestScenarios","mDataProp": "data","bSortable": true}
- ],
- //"columns": [{"data": "data"}],
- "order": [[ 1, "asc" ]],
- "bPaginate": false,
- "bFilter": false,
- "bInfo": false,
- "bAutoWidth": false,
- "bScrollCollapse": false,
- "bLengthChange":false,
- "bJQueryUI": true,
- "search": {"caseInsensitive": true},
- "scrollY": "200px",
- "scrollX": "100%",
- "sScrollXInner": "100%",
- "fnCreatedRow": function( nRow, aData, iDataIndex )
- {
- console.log("fnCreatedRow");
- $(nRow).children("td").css("overflow", "hidden");
- $(nRow).children("td").css("white-space", "nowrap");
- $(nRow).children("td").css("text-overflow", "ellipsis");
-
- var found = false;
-
- angular.forEach($scope.total_tdr_requests_selected_model, function (value)
- {
- console.log("total_tdr_requests_selected_model");
- if(aData.data==value.id)
- {
- found=true;
- }
- });
-
- if(found)
- {
- $('td:eq(0)', nRow).html( '<span class="tdr_checkbox tdr_checkbox_glyphicon_glyphicon_ok glyphicon glyphicon-ok" id="'+aData.data+'"></span>');
- }
- else
- {
- $('td:eq(0)', nRow).html( '<span class="tdr_checkbox tdr_checkbox_glyphicon_glyphicon_unchecked glyphicon glyphicon-unchecked" id="'+aData.data+'"></span>');
- }
-
-
- }
- } );
-
- $scope.total_tdr_requests_array = $scope.returnOverRiddenObjectArray(data);
-
- if($scope.total_tdr_requests_array.length > 0)
- {
- $scope.TDRNumberGridId.fnAddData($scope.total_tdr_requests_array);
- }
-
-
-
-
-
- $('#TDRNumberGridId tbody').on( 'click', 'td', function ()
- {
- console.log("click");
- var position = $scope.TDRNumberGridId.fnGetPosition(this); // getting the clicked row position
-
- if(position[1]==1)
- {
-
- var valueX = this.innerHTML;
-
- $('.tdr_checkbox').each(function(i, obj)
- {
- console.log("tdr_checkbox");
- var uncheck = $(obj).hasClass( "glyphicon-unchecked");
-
- if(valueX==obj.id && uncheck)
- {
- $(obj).attr('class','tdr_checkbox tdr_checkbox_glyphicon_glyphicon_ok glyphicon glyphicon-ok');
- }
- else if(valueX==obj.id && !uncheck)
- {
- $(obj).attr('class','tdr_checkbox tdr_checkbox_glyphicon_glyphicon_unchecked glyphicon glyphicon-unchecked');
- }
- });
-
-
- if($('.tdr_checkbox_glyphicon_glyphicon_ok').length <= 0)
- {
- $scope.total_tdr_requests_selected_model = [];
- $scope.total_tdr_requests_selected_model.push({'id':'All'});
- }
- else
- {
- $scope.total_tdr_requests_selected_model = [];
-
- $('.tdr_checkbox_glyphicon_glyphicon_ok').each(function(i, obj)
- {
- console.log("tdr_checkbox_glyphicon_glyphicon_ok");
- $scope.total_tdr_requests_selected_model.push({'id':obj.id});
- });
-
- }
- }
- else
- {
- var valueX = this.innerHTML.substring(this.innerHTML.indexOf("id=\"")+4,this.innerHTML.length-9);
-
- $('.tdr_checkbox').each(function(i, obj)
- {
- console.log("tdr_checkbox");
- var uncheck = $(obj).hasClass( "glyphicon-unchecked");
-
- if(valueX==obj.id && uncheck)
- {
- $(obj).attr('class','tdr_checkbox tdr_checkbox_glyphicon_glyphicon_ok glyphicon glyphicon-ok');
- }
- else if(valueX==obj.id && !uncheck)
- {
- $(obj).attr('class','tdr_checkbox tdr_checkbox_glyphicon_glyphicon_unchecked glyphicon glyphicon-unchecked');
- }
-
- });
-
-
- if($('.tdr_checkbox_glyphicon_glyphicon_ok').length <= 0)
- {
- $scope.total_tdr_requests_selected_model = [];
- $scope.total_tdr_requests_selected_model.push({'id':'All'});
- }
- else
- {
- $scope.total_tdr_requests_selected_model = [];
- $('.tdr_checkbox_glyphicon_glyphicon_ok').each(function(i, obj)
- {
- console.log("tdr_checkbox_glyphicon_glyphicon_ok");
- $scope.total_tdr_requests_selected_model.push({'id':obj.id});
- });
- }
- }