3.0.0.1 Demo repository registration
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* BusMgr Control - Home scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let ch = sbc.controlHome = {};
|
||||
let $pnl = ch.$pnl = {}, $dlg = ch.$dlg = {}, $frm = ch.$frm = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
ch.refreshApplicationStats = function (delay)
|
||||
{
|
||||
}
|
||||
ch.handleStatsResponse = function (response)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
ch.refreshDbSchema = function (instance, delay)
|
||||
{
|
||||
if (sbc.awaitingLogin) return;
|
||||
if (!ch.awaitingSchemaResponse)
|
||||
{
|
||||
let $pnlSchema = $('.sbc-panel-results .sbc-panel-info.DbSchema.' + instance);
|
||||
var $items = $('.sbc-panel-item-list', $pnlSchema).fadeOut(200).empty();
|
||||
var $msgs = $('.sbc-panel-messages', $pnlSchema).hide().empty().append($('<div class="sbc-message">' + sbc.msg.dataQuerying + '</div>')).fadeIn(200);
|
||||
}
|
||||
$('.DatabaseInstance', $frm.dbSchema).val(instance);
|
||||
sbc.ajax.dbSchema = sbc.ajax.dbSchema || { url: sbc.url.base + 'System/Ajax/ValidateDatabaseSchema', formId: $frm.dbSchema.prop('id'), callbackFn: ch.handleDbSchemaResponse, noWaitIcon: true };
|
||||
sbc.doAjaxRequest(sbc.ajax.dbSchema, delay || 50);
|
||||
ch.awaitingSchemaResponse = true;
|
||||
}
|
||||
ch.handleDbSchemaResponse = function (response)
|
||||
{
|
||||
sbc.debug('handleDbSchemaResponse', response);
|
||||
delete ch.awaitingSchemaResponse;
|
||||
let $pnlSchema = $('.sbc-panel-results .sbc-panel-info.DbSchema.' + response.instance);
|
||||
var $msgs = $('.sbc-panel-messages', $pnlSchema).hide().empty();
|
||||
var $tablePanel = $('.sbc-panel-item-table', $pnlSchema).hide();
|
||||
var $table = $('table.sbc-item-list', $tablePanel);
|
||||
sbc.debug($table);
|
||||
$('tbody tr', $table).remove();
|
||||
if (!response.success) return;
|
||||
if (response.instance == 'Control') ch.toSchema = setTimeout(function () { ch.refreshDbSchema('Template'); }, 250);
|
||||
if (response.instance == 'Template') ch.toSchema = setTimeout(function () { ch.refreshDbSchema('Demo'); }, 250);
|
||||
// Items.
|
||||
var items = response.items;
|
||||
if (!items.length)
|
||||
return $msgs.append($('<div class="sbc-message">' + sbc.msg.dbSchemaValid + '</div>')).fadeIn(500);
|
||||
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
|
||||
$table.append(ch.populateDbSchemaItem(ch.getDbSchemaRowTemplate(), items[itemIdx]));
|
||||
$tablePanel.show();
|
||||
}
|
||||
ch.getDbSchemaTableTemplate = function ()
|
||||
{
|
||||
return $('.sbc-panel-results .sbc-panel-item-template .sbc-panel-item-table.DbSchema').clone().hide();
|
||||
}
|
||||
ch.getDbSchemaRowTemplate = function ()
|
||||
{
|
||||
return $('.sbc-panel-results .sbc-panel-item-template .sbc-row-item.DbSchemaItem').clone();
|
||||
}
|
||||
ch.populateDbSchemaItem = function ($item, item)
|
||||
{
|
||||
if (!item) return;
|
||||
$item.prop('id', sbc.itemIdPrefix + item.id);
|
||||
$('.SchemaName', $item).text(item.schemaName);
|
||||
$('.TableName', $item).text(item.tableName);
|
||||
$('.IndexName', $item).text(item.indexName);
|
||||
$('.ColumnName', $item).text(item.columnName);
|
||||
$('.Comment', $item).text(item.comment);
|
||||
return $item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
$frm.dbSchema = $('#frmDatabaseSchema');
|
||||
$pnl.dbSchemaControl = $('.sbc-panel-info.DbSchema.Control').append(ch.getDbSchemaTableTemplate());
|
||||
$pnl.dbSchemaTemplate = $('.sbc-panel-info.DbSchema.Template'); $pnl.dbSchemaTemplate.append(ch.getDbSchemaTableTemplate());
|
||||
$pnl.dbSchemaDemo = $('.sbc-panel-info.DbSchema.Demo').append(ch.getDbSchemaTableTemplate());
|
||||
|
||||
ch.toSchema = setTimeout(function () { ch.refreshDbSchema('Control'); }, 600);
|
||||
// NB Can only request one of the database schemas at a time as they share the same ajax config.
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -255,7 +255,7 @@
|
||||
var opt = sbc.dlgOpts();
|
||||
sbc.$dlg.alert = $('<div id="dlgAlert"><div id="dlgAlertMsg"></div></div>').dialog(opt);
|
||||
}
|
||||
$('#dlgAlertMsg', sbc.$dlg.alert).html(msg.replace(/\\n/g, '<br>'));
|
||||
$('#dlgAlertMsg', sbc.$dlg.alert).html(msg.replace(/\n/g, '<br>'));
|
||||
let btns = {};
|
||||
btns[sbc.lbl.ok] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
||||
sbc.$dlg.alert.dialog('option', { title: title || sbc.dlg.title.alert, buttons: btns });
|
||||
@@ -277,7 +277,7 @@
|
||||
btns[sbc.lbl.yes] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
||||
btns[sbc.lbl.no] = function () { $(this).dialog('close'); if (onCancel) onCancel(); };
|
||||
sbc.$dlg.confirm.dialog('option', { title: title || sbc.dlg.title.confirm, buttons: btns });
|
||||
$('#dlgConfirmMsg').html(msg.replace(/\\n/g, '<br>'));
|
||||
$('#dlgConfirmMsg').html(msg.replace(/\n/g, '<br>'));
|
||||
sbc.openDialog(sbc.$dlg.confirm);
|
||||
}
|
||||
sbc.doProgress = function (title, msg, delay)
|
||||
@@ -295,7 +295,7 @@
|
||||
opt.hide = { effect: 'fade', duration: 200 };
|
||||
sbc.$dlg.progress = $('<div id="dlgProgress"><div id="dlgProgressMsg"></div></div>').dialog(opt);
|
||||
}
|
||||
$('#dlgProgressMsg').html(msg.replace(/\\n/g, '<br>'));
|
||||
$('#dlgProgressMsg').html(msg.replace(/\n/g, '<br>'));
|
||||
sbc.$dlg.progress.dialog('option', { title: title || sbc.dlg.title.progress });
|
||||
if (delay > 0) sbc.toShowProgress = setTimeout(function () { sbc.$dlg.progress.dialog('open'); }, delay);
|
||||
else sbc.$dlg.progress.dialog('open');
|
||||
|
||||
@@ -76,11 +76,11 @@
|
||||
$('#ifEmailAddress,#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm').on('input', function () { sbc.clearControlError(this); });
|
||||
sbc.$frm.signIn = $('#frmSignIn');
|
||||
sbc.$frm.signIn.on('keypress', '#ifEmailAddress,#ifPassword,#chkKeepMeSignedIn', function (e) { if (e.which == 13 && $('#ifEmailAddress', sbc.$frm.signIn).val() && $('#ifPassword', sbc.$frm.signIn).val()) sbc.doSignin(); });
|
||||
sbc.$frm.signIn.on('click', '#pbSignIn', function () { sbc.doSignin(); }).on('keypress', '#pbSignIn', function (e) { if (e.which == 13) sbc.doSignin(); });;
|
||||
sbc.$frm.signIn.on('click', '#pbSignIn', function () { sbc.doSignin(); }).on('keypress', '#pbSignIn', function (e) { if (e.which == 13) sbc.doSignin(); });
|
||||
sbc.$frm.chgPword = $('#frmChangePassword');
|
||||
sbc.$frm.chgPword.on('keypress', '#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm', function (e) { if (e.which == 13) sbc.doChangePassword(); });
|
||||
sbc.$frm.chgPword.on('keyup', '#ifPassword', sbc.doScorePassword);
|
||||
sbc.$prgPwordStrength = $('#prgPasswordStrength', sbc.$frm.chgPword).progressbar({ 'max': 5 });
|
||||
sbc.$prgPwordStrength = $('.sbc-password-strength', sbc.$frm.chgPword).progressbar({ 'max': 5 });
|
||||
$('#pbChangePassword', sbc.$frm.chgPword).on('click', function () { sbc.doChangePassword(); }).on('keypress', function (e) { if (e.which == 13) sbc.doChangePassword(); });
|
||||
sbc.$frm.reqPword = $('#frmRequestPassword');
|
||||
sbc.$frm.reqPword.on('keypress', '#ifEmailAddress', function (e) { if (e.which == 13) sbc.doRequestPassword(); });
|
||||
|
||||
Reference in New Issue
Block a user