mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
fix: List visualziation bundles only in order
This commit is contained in:
parent
4029c029c6
commit
49e03fc4d5
4 changed files with 15 additions and 14 deletions
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package org.apache.zeppelin.rest;
|
||||
|
||||
import com.github.eirslett.maven.plugins.frontend.lib.TaskRunnerException;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
|
@ -160,15 +159,15 @@ public class HeliumRestApi {
|
|||
}
|
||||
|
||||
@GET
|
||||
@Path("bundleOrder")
|
||||
public Response getBundlePackageOrder() {
|
||||
List<String> order = helium.getBundlePackageOrder();
|
||||
@Path("order/visualization")
|
||||
public Response getVisualizationPackageOrder() {
|
||||
List<String> order = helium.setVisualizationPackageOrder();
|
||||
return new JsonResponse(Response.Status.OK, order).build();
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("bundleOrder")
|
||||
public Response setBundlePackageOrder(String orderedPackageNameList) {
|
||||
@Path("order/visualization")
|
||||
public Response getVisualizationPackageOrder(String orderedPackageNameList) {
|
||||
List<String> orderedList = gson.fromJson(
|
||||
orderedPackageNameList, new TypeToken<List<String>>(){}.getType());
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
};
|
||||
|
||||
var getBundleOrder = function() {
|
||||
heliumService.getBundleOrder().
|
||||
heliumService.getVisualizationPackageOrder().
|
||||
success(function(data, status) {
|
||||
$scope.bundleOrder = data.body;
|
||||
}).
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
confirm.$modalFooter.find('button').addClass('disabled');
|
||||
confirm.$modalFooter.find('button:contains("OK")')
|
||||
.html('<i class="fa fa-circle-o-notch fa-spin"></i> Enabling');
|
||||
heliumService.setBundleOrder($scope.bundleOrder).
|
||||
heliumService.setVisualizationPackageOrder($scope.bundleOrder).
|
||||
success(function(data, status) {
|
||||
init();
|
||||
confirm.close();
|
||||
|
|
|
|||
|
|
@ -70,12 +70,12 @@ import { HeliumType, } from './helium-type';
|
|||
return visualizationBundles;
|
||||
};
|
||||
|
||||
this.getBundleOrder = function() {
|
||||
return $http.get(baseUrlSrv.getRestApiBase() + '/helium/bundleOrder');
|
||||
this.getVisualizationPackageOrder = function() {
|
||||
return $http.get(baseUrlSrv.getRestApiBase() + '/helium/order/visualization');
|
||||
};
|
||||
|
||||
this.setBundleOrder = function(list) {
|
||||
return $http.post(baseUrlSrv.getRestApiBase() + '/helium/bundleOrder', list);
|
||||
this.setVisualizationPackageOrder = function(list) {
|
||||
return $http.post(baseUrlSrv.getRestApiBase() + '/helium/order/visualization', list);
|
||||
};
|
||||
|
||||
this.getAllPackageInfo = function() {
|
||||
|
|
|
|||
|
|
@ -346,12 +346,14 @@ public class Helium {
|
|||
* Get enabled package list in order
|
||||
* @return
|
||||
*/
|
||||
public List<String> getBundlePackageOrder() {
|
||||
public List<String> setVisualizationPackageOrder() {
|
||||
List orderedPackageList = new LinkedList<>();
|
||||
List<HeliumPackage> packages = getBundlePackagesToBundle();
|
||||
|
||||
for (HeliumPackage pkg : packages) {
|
||||
orderedPackageList.add(pkg.getName());
|
||||
if (HeliumPackage.Type.VISUALIZATION == pkg.getType()) {
|
||||
orderedPackageList.add(pkg.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return orderedPackageList;
|
||||
|
|
|
|||
Loading…
Reference in a new issue