mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Worked on styling for confirm dialogs, #1554
This commit is contained in:
parent
259d330822
commit
f5f4689e7c
@ -20,8 +20,7 @@ function (angular) {
|
|||||||
|
|
||||||
$scope.deleteUser = function(user) {
|
$scope.deleteUser = function(user) {
|
||||||
$scope.appEvent('confirm-modal', {
|
$scope.appEvent('confirm-modal', {
|
||||||
title: 'Delete user',
|
title: 'Do you want to delete ' + user.login + '?',
|
||||||
text: 'Are you sure you want to delete user: ' + user.login,
|
|
||||||
onConfirm: function() {
|
onConfirm: function() {
|
||||||
backendSrv.delete('/api/admin/users/' + user.id).then(function() {
|
backendSrv.delete('/api/admin/users/' + user.id).then(function() {
|
||||||
$scope.getUsers();
|
$scope.getUsers();
|
||||||
|
@ -78,7 +78,8 @@ function (angular, _, moment) {
|
|||||||
|
|
||||||
$scope.appEvent('confirm-modal', {
|
$scope.appEvent('confirm-modal', {
|
||||||
title: 'Someone else has updated this dashboard!',
|
title: 'Someone else has updated this dashboard!',
|
||||||
text: "Do you STILL want to save?",
|
text: "Would you still like to save this dashboard?",
|
||||||
|
yesText: "Save & Overwrite",
|
||||||
icon: "fa-warning",
|
icon: "fa-warning",
|
||||||
onConfirm: function() {
|
onConfirm: function() {
|
||||||
$scope.saveDashboard({overwrite: true});
|
$scope.saveDashboard({overwrite: true});
|
||||||
@ -91,7 +92,8 @@ function (angular, _, moment) {
|
|||||||
|
|
||||||
$scope.appEvent('confirm-modal', {
|
$scope.appEvent('confirm-modal', {
|
||||||
title: 'Another dashboard with the same name exists',
|
title: 'Another dashboard with the same name exists',
|
||||||
text: "Do you STILL want to save and ovewrite it?",
|
text: "Would you still like to save this dashboard?",
|
||||||
|
yesText: "Save & Overwrite",
|
||||||
icon: "fa-warning",
|
icon: "fa-warning",
|
||||||
onConfirm: function() {
|
onConfirm: function() {
|
||||||
$scope.saveDashboard({overwrite: true});
|
$scope.saveDashboard({overwrite: true});
|
||||||
@ -102,8 +104,7 @@ function (angular, _, moment) {
|
|||||||
|
|
||||||
$scope.deleteDashboard = function() {
|
$scope.deleteDashboard = function() {
|
||||||
$scope.appEvent('confirm-modal', {
|
$scope.appEvent('confirm-modal', {
|
||||||
title: 'Delete dashboard',
|
title: 'Do you want to delete dashboard ' + $scope.dashboard.title + '?',
|
||||||
text: 'Do you want to delete dashboard ' + $scope.dashboard.title + '?',
|
|
||||||
onConfirm: function() {
|
onConfirm: function() {
|
||||||
$scope.deleteDashboardConfirmed();
|
$scope.deleteDashboardConfirmed();
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,7 @@ function (angular, app, _, config) {
|
|||||||
|
|
||||||
$scope.delete_row = function() {
|
$scope.delete_row = function() {
|
||||||
$scope.appEvent('confirm-modal', {
|
$scope.appEvent('confirm-modal', {
|
||||||
title: 'Delete row',
|
title: 'Are you sure you want to delete this row?',
|
||||||
text: 'Are you sure you want to delete this row?',
|
|
||||||
onConfirm: function() {
|
onConfirm: function() {
|
||||||
$scope.dashboard.rows = _.without($scope.dashboard.rows, $scope.row);
|
$scope.dashboard.rows = _.without($scope.dashboard.rows, $scope.row);
|
||||||
}
|
}
|
||||||
@ -82,8 +81,7 @@ function (angular, app, _, config) {
|
|||||||
|
|
||||||
$scope.remove_panel_from_row = function(row, panel) {
|
$scope.remove_panel_from_row = function(row, panel) {
|
||||||
$scope.appEvent('confirm-modal', {
|
$scope.appEvent('confirm-modal', {
|
||||||
title: 'Remove panel',
|
title: 'Are you sure you want to remove this panel?',
|
||||||
text: 'Are you sure you want to remove this panel?',
|
|
||||||
onConfirm: function() {
|
onConfirm: function() {
|
||||||
row.panels = _.without(row.panels, panel);
|
row.panels = _.without(row.panels, panel);
|
||||||
}
|
}
|
||||||
|
@ -17,29 +17,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="confirm-modal-buttons">
|
<div class="confirm-modal-buttons">
|
||||||
<button type="button" class="btn btn-inverse" ng-click="dismiss()">Cancel</button>
|
<button type="button" class="btn btn-inverse" ng-click="dismiss()">{{noText}}</button>
|
||||||
<button type="button" class="btn btn-danger" ng-click="onConfirm();dismiss();">Save & Overwrite</button>
|
<button type="button" class="btn btn-danger" ng-click="onConfirm();dismiss();">{{yesText}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="gf-box-header"> -->
|
|
||||||
<!-- <div class="gf-box-title"> -->
|
|
||||||
<!-- <i class="fa {{icon}}"></i> -->
|
|
||||||
<!-- {{title}} -->
|
|
||||||
<!-- </div> -->
|
|
||||||
<!-- </div> -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- <div class="gf-box-body" style="min-height: 0px;"> -->
|
|
||||||
<!-- <p class="row-fluid text-center large"> -->
|
|
||||||
<!-- {{text}} -->
|
|
||||||
<!-- <br> -->
|
|
||||||
<!-- <br> -->
|
|
||||||
<!-- </p> -->
|
|
||||||
<!-- <div class="row-fluid"> -->
|
|
||||||
<!-- <span class="span4"></span> -->
|
|
||||||
<!-- <button type="button" class="btn btn-primary span2" ng-click="dismiss()">No</button> -->
|
|
||||||
<!-- <button type="button" class="btn btn-danger span2" ng-click="onConfirm();dismiss();">Yes</button> -->
|
|
||||||
<!-- <span class="span4"></span> -->
|
|
||||||
<!-- </div> -->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,20 +1,22 @@
|
|||||||
<div class="modal-body gf-box gf-box-no-margin">
|
<div class="modal-body">
|
||||||
<div class="gf-box-header text-center">
|
|
||||||
<span class="gf-box-title">
|
<a class="modal-close" ng-click="dismiss();">
|
||||||
<i class="fa fa-exclamation"></i>
|
<i class="fa fa-remove"></i>
|
||||||
Unsaved changes
|
</a>
|
||||||
</span>
|
|
||||||
<button class="gf-box-header-close-btn" ng-click="dismiss();">
|
<div class="confirm-modal-icon">
|
||||||
<i class="fa fa-remove"></i>
|
<i class="fa fa-exclamation"></i>
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="gf-box-body" style="min-height: 0;">
|
<div class="confirm-modal-title">
|
||||||
<div class="row-fluid text-center">
|
Unsaved changes
|
||||||
<button type="button" class="btn btn-success span4" ng-click="save();dismiss();">Save</button>
|
|
||||||
<button type="button" class="btn btn-danger span4" ng-click="ignore();dismiss();">Ignore</button>
|
|
||||||
<button type="button" class="btn btn-inverse span4" ng-click="dismiss()">Cancel</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="confirm-modal-buttons">
|
||||||
|
<button type="button" class="btn btn-inverse" ng-click="dismiss()">Cancel</button>
|
||||||
|
<button type="button" class="btn btn-danger" ng-click="ignore();dismiss()">Ignore</button>
|
||||||
|
<button type="button" class="btn btn-success" ng-click="save();dismiss();">Save</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -65,6 +65,8 @@ function (angular, _) {
|
|||||||
scope.text = payload.text;
|
scope.text = payload.text;
|
||||||
scope.onConfirm = payload.onConfirm;
|
scope.onConfirm = payload.onConfirm;
|
||||||
scope.icon = payload.icon || "fa-check";
|
scope.icon = payload.icon || "fa-check";
|
||||||
|
scope.yesText = payload.yesText || "Yes";
|
||||||
|
scope.noText = payload.noText || "Cancel";
|
||||||
|
|
||||||
var confirmModal = $modal({
|
var confirmModal = $modal({
|
||||||
template: './app/partials/confirm_modal.html',
|
template: './app/partials/confirm_modal.html',
|
||||||
|
@ -259,7 +259,7 @@
|
|||||||
.confirm-modal {
|
.confirm-modal {
|
||||||
border: 1px solid @grafanaTargetFuncBackground;
|
border: 1px solid @grafanaTargetFuncBackground;
|
||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
background-color: @modalBackground;
|
background-color: @grafanaPanelBackground;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
.modal-close {
|
.modal-close {
|
||||||
@ -267,22 +267,26 @@
|
|||||||
font-size: 140%;
|
font-size: 140%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.confirm-modal-icon {
|
.confirm-modal-icon {
|
||||||
padding-top: 41px;
|
padding-top: 41px;
|
||||||
font-size: 280%;
|
font-size: 280%;
|
||||||
color: @green;
|
color: @green;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.confirm-modal-title {
|
.confirm-modal-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
color: @linkColor;
|
color: @linkColor;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.confirm-modal-text {
|
.confirm-modal-text {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.confirm-modal-buttons {
|
.confirm-modal-buttons {
|
||||||
|
margin-top: 35px;
|
||||||
margin-bottom: 35px;
|
margin-bottom: 35px;
|
||||||
button {
|
button {
|
||||||
margin-right: 5px
|
margin-right: 5px
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
@grafanaTargetFuncBackground: darken(@grafanaTargetBackground, 5%);
|
@grafanaTargetFuncBackground: darken(@grafanaTargetBackground, 5%);
|
||||||
@grafanaTargetFuncHightlight: darken(@grafanaTargetBackground, 10%);
|
@grafanaTargetFuncHightlight: darken(@grafanaTargetBackground, 10%);
|
||||||
|
|
||||||
@modalBackground: @white;
|
@modalBackground: @bodyBackground;
|
||||||
|
|
||||||
// Scaffolding
|
// Scaffolding
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user