mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added support for the password cell.
This commit is contained in:
parent
6dbfb7db7e
commit
5eef63c068
@ -1241,3 +1241,26 @@ form[name="change_password_form"] .help-block {
|
|||||||
.dashboard-tab-container .backgrid-filter .clear {
|
.dashboard-tab-container .backgrid-filter .clear {
|
||||||
z-index: 10 !important;
|
z-index: 10 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.backgrid .string-cell.editor input[type=password] {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.backgrid td.editor input[type=password] {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0 5px;
|
||||||
|
margin: 0;
|
||||||
|
background-color: transparent;
|
||||||
|
border: 0;
|
||||||
|
outline: 0;
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
-moz-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
-moz-appearance: none;
|
||||||
|
}
|
||||||
|
@ -845,6 +845,45 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
Formatter for PasswordCell.
|
||||||
|
|
||||||
|
@class Backgrid.PasswordFormatter
|
||||||
|
@extends Backgrid.CellFormatter
|
||||||
|
@constructor
|
||||||
|
*/
|
||||||
|
var PasswordFormatter = Backgrid.PasswordFormatter = function () {};
|
||||||
|
PasswordFormatter.prototype = new Backgrid.CellFormatter();
|
||||||
|
_.extend(PasswordFormatter.prototype, {
|
||||||
|
fromRaw: function (rawValue, model) {
|
||||||
|
|
||||||
|
if (_.isUndefined(rawValue) || _.isNull(rawValue)) return '';
|
||||||
|
|
||||||
|
var pass = '';
|
||||||
|
for(var i = 0; i < rawValue.length; i++) {
|
||||||
|
pass += '*';
|
||||||
|
}
|
||||||
|
return pass;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var PasswordCell = Backgrid.Extension.PasswordCell = Backgrid.StringCell.extend({
|
||||||
|
|
||||||
|
formatter: PasswordFormatter,
|
||||||
|
|
||||||
|
editor: Backgrid.InputCellEditor.extend({
|
||||||
|
attributes: {
|
||||||
|
type: "password"
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function () {
|
||||||
|
var model = this.model;
|
||||||
|
this.$el.val(model.get(this.column.get("name")));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
return Backgrid;
|
return Backgrid;
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user