use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminSyslogActivity method removeAll.
@Override
public void removeAll() {
adminContent.setFormBusy(true);
environment.getApp().getRequests().send(syslogResource::clearEvents, 204, () -> {
adminContent.clearEvents();
adminContent.setFormBusy(false);
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().eventsRemoved()));
});
}
use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminSyslogActivity method saveSettings.
@Override
public void saveSettings() {
// TODO Client-side validation error handling?
adminContent.setFormBusy(true);
readFromView();
environment.getApp().getRequests().sendWith(syslogConfigMapper, requestParams -> {
syslogResource.updateConfig(requestParams, config);
}, 204, () -> {
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().settingsSaved()));
adminContent.setFormBusy(false);
});
}
use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminUserEditActivity method delete.
@Override
public void delete() {
adminContent.showConfirmation(environment.getMessages().confirmation(), environment.getMessages().confirmationDelete(user.getUsername()), () -> {
adminContent.setFormBusy(true);
adminContent.clearFormMessages();
clearViewFieldErrors();
environment.getApp().getRequests().send(requestParams -> userResource.delete(requestParams, realm, userId), 204, () -> {
adminContent.setFormBusy(false);
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().userDeleted(user.getUsername())));
environment.getPlaceController().goTo(new AdminUsersPlace(realm));
});
});
}
use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AdminUserNotificationsActivity method onNotificationsDelete.
@Override
public void onNotificationsDelete() {
adminContent.setFormBusy(true);
environment.getApp().getRequests().send(requestParams -> notificationResource.removeNotificationsOfUser(requestParams, userId), 204, () -> {
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().notificationsDeleted()));
loadNotifications(() -> adminContent.setFormBusy(false));
});
}
use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.
the class AssetEditActivity method create.
@Override
public void create() {
view.setFormBusy(true);
clearViewMessages();
validateAttributes(false, results -> {
if (results.stream().anyMatch(result -> !result.isValid())) {
view.setFormBusy(false);
processValidationResults(results);
} else {
readFromView();
environment.getApp().getRequests().sendWithAndReturn(assetMapper, assetMapper, requestParams -> assetResource.create(requestParams, asset), 200, createdAsset -> {
environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().assetCreated(createdAsset.getName())));
environment.getPlaceController().goTo(new AssetViewPlace(createdAsset.getId()));
}, validationErrorHandler);
}
});
}
Aggregations