1.2.11.13 Db Schema comparison
This commit is contained in:
@@ -85,9 +85,11 @@
|
||||
{
|
||||
//sax.debug('handleDbSchemaResponse', response);
|
||||
delete ah.awaitingSchemaResponse;
|
||||
let $pnlSchema = $('.sax-panel-results .sax-panel-info.DbSchema.' + response.instance) ;
|
||||
let $pnlSchema = $('.sax-panel-results .sax-panel-info.DbSchema.' + response.instance);
|
||||
var $msgs = $('.sax-panel-messages', $pnlSchema).hide().empty();
|
||||
var $items = $('.sax-panel-item-list', $pnlSchema).hide().empty();
|
||||
var $tablePanel = $('.sax-panel-item-table', $pnlSchema).hide();
|
||||
var $table = $('table.sax-item-list', $tablePanel);
|
||||
$('tbody tr', $table).remove();
|
||||
if (!response.success) return;
|
||||
if (response.instance == 'Core') ah.toSchema = setTimeout(function () { ah.refreshDbSchema('Reference'); }, 250);
|
||||
if (response.instance == 'Reference') ah.toSchema = setTimeout(function () { ah.refreshDbSchema('Support'); }, 250);
|
||||
@@ -95,24 +97,26 @@
|
||||
var items = response.items;
|
||||
if (!items.length)
|
||||
return $msgs.append($('<div class="sax-message">' + sax.msg.dbSchemaValid + '</div>')).fadeIn(500);
|
||||
//sax.debug(ah.getDbSchemaTemplate());
|
||||
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
|
||||
$items.append(ah.populateDbSchemaItem(ah.getDbSchemaTemplate(), items[itemIdx]));
|
||||
$items.slideDown(750);
|
||||
$table.append(ah.populateDbSchemaItem(ah.getDbSchemaRowTemplate(), items[itemIdx]));
|
||||
$tablePanel.show();
|
||||
}
|
||||
ah.getDbSchemaTemplate = function ()
|
||||
ah.getDbSchemaTableTemplate = function ()
|
||||
{
|
||||
return $('.sax-panel-results .sax-panel-item-template .sax-panel-item.DbSchemaItem').clone();
|
||||
return $('.sax-panel-results .sax-panel-item-template .sax-panel-item-table.DbSchema').clone();
|
||||
}
|
||||
ah.getDbSchemaRowTemplate = function ()
|
||||
{
|
||||
return $('.sax-panel-results .sax-panel-item-template .sax-row-item.DbSchemaItem').clone();
|
||||
}
|
||||
ah.populateDbSchemaItem = function ($item, item)
|
||||
{
|
||||
if (!item) return;
|
||||
$item.prop('id', sax.itemIdPrefix + item.id);
|
||||
$('.SchemaName', $item).text(item.schemaName);
|
||||
$('.TableName', $item).text(item.tableName);
|
||||
$('.IndexName', $item).text(item.indexName);
|
||||
$('.SchemaIndex', $item).toggle(!!item.indexName);
|
||||
$('.ColumnName', $item).text(item.columnName);
|
||||
$('.SchemaColumn', $item).toggle(!!item.columnName);
|
||||
$('.Comment', $item).text(item.comment);
|
||||
return $item;
|
||||
}
|
||||
@@ -122,9 +126,9 @@
|
||||
{
|
||||
$pnl.appStats = $('.sax-panel-results.ApplicationStats');
|
||||
$frm.dbSchema = $('#frmDatabaseSchema');
|
||||
$pnl.dbSchemaCore = $('.sax-panel-results.DbSchema.Core');
|
||||
$pnl.dbSchemaReference = $('.sax-panel-results.DbSchema.Reference');
|
||||
$pnl.dbSchemaSupport = $('.sax-panel-results.DbSchema.Support');
|
||||
$pnl.dbSchemaCore = $('.sax-panel-info.DbSchema.Core').append(ah.getDbSchemaTableTemplate());
|
||||
$pnl.dbSchemaReference = $('.sax-panel-info.DbSchema.Reference'); $pnl.dbSchemaReference.append(ah.getDbSchemaTableTemplate());
|
||||
$pnl.dbSchemaSupport = $('.sax-panel-info.DbSchema.Support').append(ah.getDbSchemaTableTemplate());
|
||||
|
||||
ah.toStats = setTimeout(ah.refreshApplicationStats, 400);
|
||||
ah.toSchema = setTimeout(function () { ah.refreshDbSchema('Core'); }, 600);
|
||||
|
||||
Reference in New Issue
Block a user