Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions resources/release_note/js/appRN.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function (ng, window, document, undefined) {
'use strict';

/* this module allows to execute js code loaded dynamically from the bp */
ng.module('ngLoadScript', [])
.directive('script', function() {
Expand All @@ -23,7 +23,7 @@
.controller('mainController', ['dataFactory', 'getServicesStatus', '$scope', function(dataFactory, getServicesStatus, $scope){
var controller = this;

dataFactory().success(function(data){
dataFactory().success(function(data){
controller.core = data.core;
$scope.codeJSON = data.blueprints;
controller.core.forEach(function(element, index, array){
Expand All @@ -33,7 +33,7 @@
setInterval(function(){
getServicesStatus(controller.core);
},10000);
});
});
}]
)
/* load the components/tools */
Expand All @@ -43,15 +43,15 @@
restrict: 'E',
templateUrl: 'dir/component-list.html',
controller: function(){

}
};
})
/* replace the missing image with text*/
.directive('errSrc', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
link: function(scope, element, attrs) {
element.bind('error', function() {
var parent = element.parent();
if(parent.find("span").length === 0){
Expand All @@ -60,30 +60,30 @@
parent.append(span);
}
parent.addClass("no-image");

});
}
};
});

/* fetch the data from the descriptor file */
ng.module('rnApp').factory('dataFactory', ['$http', function($http){
return function () { return $http.get('./plugins.json'); };
}]);


function generateUrls(data){
data.forEach(function(element, index, array){
if(element.linkCreate){
element.link = createUrl(element.linkCreate.host) + element.linkCreate.endPath;
}
});
});
}

function createUrl(host){
return "http://"+ host + "." + window.location.host+ (window.location.host.indexOf(".xip.io") > -1 ? "" : ".xip.io/");
return "http://"+ host + "." + window.location.hostname+ (window.location.host.indexOf(".xip.io") > -1 ? "" : ".xip.io" + (window.location.port ? ':' + window.location.port + '/' : '/'));
}

function getStatusClass(status,node_status){

if (status === "passing" && node_status === "passing"){
Expand All @@ -94,13 +94,13 @@
}
/* check the status of the services */
ng.module('rnApp').factory('getServicesStatus', ['$http', function($http){
return function (components) {
return function (components) {
};
}]);






})(angular, window, document);