This commit is contained in:
2024-03-26 15:56:31 +08:00
parent 634e8b71ab
commit 0855ae42cd
547 changed files with 94818 additions and 60463 deletions

View File

@ -1,56 +1,6 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Credentials/Credentials.master" AutoEventWireup="true" CodeFile="ManageCredential.aspx.cs" Inherits="ManageCredential" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
.dialog .dialog-title .dialog-close {
float: right;
margin-right: 6px;
cursor: pointer;
}
.dialog .dialog-title .dialog-close:before {
content: '\e600';
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
}
.dialog-content table td.label {
width: 130px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.dialog-content table td input,
.dialog-content table td input[type="text"],
.dialog-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
width: unset;
}
.dialog-content table td textarea {
height: 100px;
max-width: 320px;
}
.icon {
font-family: CalciteWebCoreIcons;
cursor: default;
}
</style>
<script type="text/javascript">
var credentialType = "AEMP";
var credentialList;
@ -79,7 +29,7 @@
$('#dialog_urlkey').val('');
$('#dialog_username').val('');
$('#dialog_password').val('');
$('#dialog_enabled').attr('checked', 'checked');
$('#dialog_enabled').prop('checked', true);
$('#dialog_orgid').val('');
$('#dialog_notes').val('');
$('#dialog_credential .dialog-title span.title').text(GetTextByKey("P_CRE_ADDMANUFACTURE", 'Add Credential'));
@ -96,7 +46,7 @@
var creid;
function OnEdit() {
var cre = grid_dt.source[grid_dt.selectedIndex].Values;
var cre = grid_dt.source[grid_dt.selectedIndex];
if (!cre) {
creid = undefined;
return;
@ -107,7 +57,7 @@
$('#dialog_urlkey').val(cre.UrlKey);
$('#dialog_username').val(cre.UserName);
$('#dialog_password').val(cre.Password);
$('#dialog_enabled').attr("checked", cre.Enabled);
$('#dialog_enabled').prop("checked", cre.Enabled.Value);
$('#dialog_orgid').val(cre.OrgnizationID);
$('#dialog_notes').val(cre.Notes);
$('#dialog_credential .dialog-title span.title').text(GetTextByKey("P_CRE_EDITMANUFACTURE", 'Edit Credential'));
@ -142,8 +92,12 @@
var rows = [];
for (var i = 0; i < data.length; i++) {
var r = data[i];
var fr = { Values: r };
rows.push(fr);
for (var j in r) {
if (j === "Enabled") {
r[j] = { DisplayValue: r["Enabled"] ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
}
}
rows.push(r);
}
grid_dt.setData(rows);
@ -153,17 +107,12 @@
function InitGridData() {
$('#btnEdit').attr("disabled", "disabled");
grid_dt = new GridView('#credentiallist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#credentiallist');
var list_columns = [
{ name: 'ManufactureID', caption: GetTextByKey("P_CRE_MANUFACTURE", "Manufacture"), valueIndex: 'ManufactureID', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UrlKey', caption: GetTextByKey("P_CRE_URLKEY", "Url Key"), valueIndex: 'UrlKey', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UserName', caption: GetTextByKey("P_CRE_USERNAME", "User Name"), valueIndex: 'UserName', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Enabled', caption: GetTextByKey("P_CRE_ENABLED", "Enabled"), valueIndex: 'Enabled', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'ManufactureID', caption: GetTextByKey("P_CRE_MANUFACTURE", "Manufacture"), valueIndex: 'ManufactureID', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UrlKey', caption: GetTextByKey("P_CRE_URLKEY", "Url Key"), valueIndex: 'UrlKey', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'UserName', caption: GetTextByKey("P_CRE_USERNAME", "User Name"), valueIndex: 'UserName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Enabled', caption: GetTextByKey("P_CRE_ENABLED", "Enabled"), valueIndex: 'Enabled', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Notes', caption: GetTextByKey("P_CRE_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
@ -179,30 +128,32 @@
col.width = list_columns[hd].css.width;
col.align = list_columns[hd].css["text-align"]
col.key = list_columns[hd].valueIndex;
col.allowFilter = list_columns[hd].allowFilter;
if (col.name === "Edit") {
col.isurl = true;
col.text = "\uf044";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'edit';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnEdit();
}
};
col.classFilter = function (e) {
return "icon-col";
}
col.attrs = { 'title': GetTextByKey("P_CRE_EDIT", 'Edit') };
}
else if (col.name === "Delete") {
col.isurl = true;
col.text = "\uf00d";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = 'times';
col.iconType = 'fa-light';
col.events = {
onclick: function () {
OnDelete(this);
}
};
col.classFilter = function (e) {
return "icon-col";
};
col.attrs = { 'title': GetTextByKey("P_CRE_DELETE", 'Delete') };
}
columns.push(col);
@ -210,12 +161,12 @@
grid_dt.canMultiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = OnEdit;
grid_dt.onRowDblClicked = OnEdit;
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
creid = rowdata.Values.ID;
creid = rowdata.ID;
}
}
}
@ -226,7 +177,7 @@
'UrlKey': $('#dialog_urlkey').val().replace(/(^\s*)|(\s*$)/g, ''),
'UserName': $('#dialog_username').val().replace(/(^\s*)|(\s*$)/g, ''),
'Password': $('#dialog_password').val(),
'Enabled': $('#dialog_enabled').attr("checked") == "checked",
'Enabled': $('#dialog_enabled').prop("checked"),
'OrgnizationID': $('#dialog_orgid').val(),
'CredentialType': credentialType,
'Notes': $('#dialog_notes').val()