Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#114 - Return the updated state after deploying the modules to remove the delay #116

Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public LoginForm uninstall(HttpSession session) {
}

@RequestMapping(value = "install-user-modules", method = RequestMethod.POST)
public void installUserModules(HttpSession session) {
public LoginForm installUserModules(HttpSession session) {
synchronized (syncStatusService) {
dataHubService.installUserModules();

Expand All @@ -162,6 +162,8 @@ public void installUserModules(HttpSession session) {
loginForm.setEntities(entityManagerService.getEntities());
loginForm.refreshSelectedEntity();
syncStatusService.notifyAll();

return loginForm;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.nio.file.WatchEvent;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.DisposableBean;
Expand Down Expand Up @@ -95,7 +96,9 @@ public LoginForm saveEntity(@RequestBody EntityForm entityForm,
* @return
*/
@RequestMapping(value = "status-change", method = RequestMethod.GET)
public LoginForm getStatusChange(HttpSession session) {
public LoginForm getStatusChange(HttpServletRequest request) {
HttpSession session = request.getSession();

synchronized (syncStatusService) {
try {
syncStatusService.wait();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
$location.path('/login');
});
};

scope.uninstall = function (ev) {
var confirm = $mdDialog.confirm().title('Confirm Uninstall')
.textContent('Do you really want to continue uninstalling data hub?')
Expand All @@ -44,6 +44,7 @@
scope.action.message = 'Deploy to Server is in progress';
DataHub.installUserModules()
.finally(function () {
scope.status = DataHub.status;
scope.action.type = null;
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@

function installUserModules() {
return $http.post('api/data-hub/install-user-modules')
.success(function () {
.success(function (data) {
self.status = data;
self.displayMessage('Deploy to server is successful.', 'success', 'notification', false);
})
.error(function () {
Expand Down