WIP Domain listing app with automatic status checking. Buitl with AngularJS.

domainsList.js 762B

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. /**
  3. * @ngdoc function
  4. * @name domainManagerApp.controller:AboutCtrl
  5. * @description
  6. * # AboutCtrl
  7. * Controller of the domainManagerApp
  8. */
  9. angular.module('domainManagerApp.domains', ['ui.bootstrap'])
  10. .controller('DomainsListController', function ($scope, $http) {
  11. $http({
  12. method: 'GET',
  13. url: '/scripts/data.json'
  14. }).success(function(data) {
  15. $scope.domains = data.domains;
  16. });
  17. $scope.oneAtATime = false;
  18. $scope.isOpen = false;
  19. $scope.labelColor = function(status) {
  20. if (status == "OK"){
  21. var color = "label-success";
  22. } else if (status == "DEAD") {
  23. var color = "label-danger";
  24. } else {
  25. var color = "label-default";
  26. }
  27. return color;
  28. }
  29. });