Skip to content

Commit

Permalink
Fix #482 and add installed column on feature table
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Aug 19, 2013
1 parent 99335b3 commit 5e13e93
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
14 changes: 14 additions & 0 deletions hawtio-web/src/main/webapp/app/karaf/html/features.html
Expand Up @@ -27,6 +27,20 @@
</div>


<!--
<div class="row-fluid">
<div hawtio-editor="repositoriesString" mode="javascript"></div>
</div>
<div class="row-fluid">
<div hawtio-editor="featuresString" mode="javascript"></div>
</div>
<div class="row-fluid">
<div hawtio-editor="resultString" mode="javascript"></div>
</div>
-->

<div class="row-fluid">
<div class="gridStyle" ng-grid="featureOptions"></div>
</div>
Expand Down
13 changes: 12 additions & 1 deletion hawtio-web/src/main/webapp/app/karaf/js/features.ts
Expand Up @@ -97,8 +97,12 @@ module Karaf {
{
field: 'Version',
displayName: 'Version',
cellTemplate: '<div class="ngCellText"><a href="#/karaf/feature/{{row.entity.Name}}/{{row.entity.Version}}">{{row.getProperty(col.field)}}</a></div>',
cellTemplate: '<div class="ngCellText"><a href="#/osgi/feature/{{row.entity.Name}}/{{row.entity.Version}}">{{row.getProperty(col.field)}}</a></div>',
width: 200
},
{
field: 'Installed',
displayName: 'Installed'
}
]
};
Expand Down Expand Up @@ -162,15 +166,22 @@ module Karaf {
];
}

$scope.javascript = 'javascript';

function render(response) {
if (!Object.equal($scope.result, response.value)) {
$scope.result = response.value;
//$scope.resultString = angular.toJson($scope.result, true);

$scope.features = [];
$scope.repositories = empty();

populateFeaturesAndRepos($scope.result, $scope.features, $scope.repositories);
$scope.repository = setSelect($scope.repository, $scope.repositories);

//$scope.featuresString = angular.toJson($scope.features, true);
//$scope.repositoriesString = angular.toJson($scope.repositories, true);

Core.$apply($scope);
}
}
Expand Down
10 changes: 7 additions & 3 deletions hawtio-web/src/main/webapp/app/karaf/js/helpers.ts
Expand Up @@ -69,6 +69,7 @@ module Karaf {
}

export function populateFeaturesAndRepos(attributes, features, repositories) {
var fullFeatures = attributes["Features"];
angular.forEach(attributes["Repositories"], (repo) => {

repositories.push({
Expand All @@ -77,15 +78,18 @@ module Karaf {
});

angular.forEach(repo["Features"], (feature) => {

angular.forEach(feature, (entry) => {
var f = {};
var f = Object.extended(fullFeatures[entry['Name']][entry['Version']]).clone();
f["Id"] = entry["Name"] + "/" + entry["Version"];
/*
f["Name"] = entry["Name"];
f["Version"] = entry["Version"];
f["Installed"] = entry["Installed"];
f["Repository"] = repo["Name"];
f["Repository"] = repo["Name"];*/
features.push(f);
});

});
});
}
Expand Down Expand Up @@ -249,4 +253,4 @@ module Karaf {
}
return null;
}
}
}

0 comments on commit 5e13e93

Please sign in to comment.