Skip to content

Commit

Permalink
UI: Allow to enable/disable a function without build (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
LevkoKozak authored and eran-nussbaum committed Nov 29, 2018
1 parent 01ce570 commit 3c1f200
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/dashboard/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"gulp-rev-collector": "^1.0.2",
"gulp-uglify": "^1.4.1",
"gulp-util": "^3.0.4",
"iguazio.dashboard-controls": "^0.3.22",
"iguazio.dashboard-controls": "^0.3.23",
"imagemin-gifsicle": "^5.1.0",
"imagemin-jpegtran": "^5.0.2",
"imagemin-optipng": "^5.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
ctrl.getExternalIPAddresses = getExternalIPAddresses;
ctrl.getProject = getProject;
ctrl.getFunctions = getFunctions;
ctrl.getFunction = getFunction;
ctrl.deleteFunction = deleteFunction;
ctrl.updateFunction = updateFunction;

//
// Public methods
Expand Down Expand Up @@ -45,6 +47,15 @@
return NuclioFunctionsDataService.getFunctions(id);
}

/**
* Gets a function
* @param {Object} metadata
* @returns {Promise}
*/
function getFunction(metadata) {
return NuclioFunctionsDataService.getFunction(metadata);
}

/**
* Deletes function
* @param {Object} functionToDelete
Expand All @@ -53,5 +64,15 @@
function deleteFunction(functionToDelete) {
return NuclioFunctionsDataService.deleteFunction(functionToDelete);
}

/**
* Updates function
* @param functionData
* @param projectID
* @returns {*|Promise}
*/
function updateFunction(functionData, projectID) {
return NuclioFunctionsDataService.updateFunction(functionData, projectID);
}
}
}());
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<ncl-functions data-get-external-Ip-addresses="$ctrl.getExternalIPAddresses()"
<ncl-functions data-get-external-ip-addresses="$ctrl.getExternalIPAddresses()"
data-get-project="$ctrl.getProject(id)"
data-get-functions="$ctrl.getFunctions(id)"
data-delete-function="$ctrl.deleteFunction(functionData)">
data-get-function="$ctrl.getFunction(metadata, projectID)"
data-delete-function="$ctrl.deleteFunction(functionData)"
data-on-update-function="$ctrl.updateFunction(function, projectID)">
</ncl-functions>

0 comments on commit 3c1f200

Please sign in to comment.