This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #561 from ammendonca/HAWKULAR-613-REMOVE-DS
HAWKULAR-613 : Add support for Delete Datasource
- Loading branch information
Showing
4 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...e/src/main/scripts/plugins/metrics/html/app-details/modals/detail-datasources-delete.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="modal-header"> | ||
<button type="button" class="close" ng-click="mvm.cancel()"> | ||
<span class="pficon pficon-close"></span> | ||
</button> | ||
<h4 class="modal-title">Delete Datasource</h4> | ||
</div> | ||
<div class="modal-body"> | ||
<div class="form-group"> | ||
<p class="primary-message">Are you sure you want to delete the Datasource <strong>{{ mvm.datasource.properties.name }}</strong> ?</p> | ||
<p>This action can't be undone.</p> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" ng-click="mvm.cancel()">Cancel</button> | ||
<button type="button" class="btn btn-danger" ng-click="mvm.deleteDatasource()">Delete</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...rc/main/scripts/plugins/metrics/ts/app-details/modals/appServerDatasourcesDeleteDialog.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/// | ||
/// Copyright 2015 Red Hat, Inc. and/or its affiliates | ||
/// and other contributors as indicated by the @author tags. | ||
/// | ||
/// Licensed under the Apache License, Version 2.0 (the "License"); | ||
/// you may not use this file except in compliance with the License. | ||
/// You may obtain a copy of the License at | ||
/// | ||
/// http://www.apache.org/licenses/LICENSE-2.0 | ||
/// | ||
/// Unless required by applicable law or agreed to in writing, software | ||
/// distributed under the License is distributed on an "AS IS" BASIS, | ||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
/// See the License for the specific language governing permissions and | ||
/// limitations under the License. | ||
/// | ||
|
||
/// <reference path="../../metricsPlugin.ts"/> | ||
|
||
module HawkularMetrics { | ||
|
||
export class AppServerDatasourcesDeleteDialogController { | ||
|
||
static $inject = ['$scope', '$rootScope', '$modalInstance', '$q', 'HawkularOps', 'NotificationsService', | ||
'datasource']; | ||
|
||
constructor(private $scope:any, | ||
private $rootScope:any, | ||
private $modalInstance:any, | ||
private $q:ng.IQService, | ||
private HawkularOps, | ||
private NotificationsService:INotificationsService, | ||
public datasource) { | ||
|
||
/// make sure our WS socket is open | ||
HawkularOps.init(this.NotificationsService); | ||
|
||
$scope.$on('DatasourceRemoveSuccess', (event, data) => { | ||
this.$modalInstance.close(data); | ||
}); | ||
|
||
$scope.$on('DatasourceRemoveError', (event, data) => { | ||
this.NotificationsService.error('The Datasource ' + this.datasource.properties.name + | ||
' failed to be deleted.'); | ||
}); | ||
} | ||
|
||
public deleteDatasource(): void { | ||
this.HawkularOps.performRemoveDatasourceOperation( | ||
this.datasource.path, | ||
this.$rootScope.userDetails.token, | ||
this.$rootScope.currentPersona.id); | ||
} | ||
|
||
public cancel() { | ||
this.$modalInstance.dismiss('cancel'); | ||
} | ||
|
||
} | ||
|
||
_module.controller('AppServerDatasourcesDeleteDialogController', AppServerDatasourcesDeleteDialogController); | ||
|
||
} |