3.0.1.8 Control repository status check on update

This commit is contained in:
Andy Howard
2025-10-26 14:51:00 +00:00
parent a841bd8b4b
commit d414910e96
47 changed files with 727 additions and 404 deletions
@@ -45,9 +45,11 @@
let items = response.repositories || [];
if (!items.length)
return $pnl.msgs.append($('<div class="sbc-message">' + sbc.msg.dataNoneFound + '</div>')).fadeIn(500);
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
$table.append(ir.populateItem(ir.getItemRowTemplate(), items[itemIdx]));
ir.refreshRepoInfo(items[0].id, 500);
for (const item of items)
{
$table.append(ir.populateItem(ir.getItemRowTemplate(), item));
ir.addRepoForInfo(item);
}
}
ir.populateItem = function ($item, item)
{
@@ -79,6 +81,29 @@
}
//--------------------------------------------------------------
const reposForInfo = [];
ir.addRepoForInfo = (item) =>
{
if (reposForInfo.some(repo => repo.id == item.id)) return;
ir.clearRepoInfo(item);
reposForInfo.push(item);
if (reposForInfo.length == 1) ir.refreshNextRepoInfo();
}
ir.clearRepoInfo = (item) =>
{
$pnl.table.find('#' + ir.getItemId(item)).find('.RepositoryInitialised').empty();
}
ir.resetRefreshRepoInfo = () =>
{
reposForInfo.length = 0;
sbc.cancelAjaxRequest(ir.ajax.repoInit);
}
ir.refreshNextRepoInfo = () =>
{
if (ir.ajax.repoInit?.timeout) return;
let repo = reposForInfo.shift();
if (repo?.id) ir.refreshRepoInfo(repo.id, 200);
}
ir.refreshRepoInfo = function (id, delay)
{
$frm.itemId.find('.RepositoryId').val(id);
@@ -103,13 +128,11 @@
}
else $repoInit.append($('<div>').append($('<img style="width:16px">').prop('src', '/img/icon/tick-24.png')));
$bgr.toggle(!!$('.sbc-dropdown-item', $mnu).length);
let $next = $item.next();
if ($next.length) ir.refreshRepoInfo($next.prop('id').replace(/[^0-9]/g, ''), 200);
ir.refreshNextRepoInfo();
}
ir.onInitRepo = function (id)
ir.onInitRepo = function (item)
{
//sbc.debug('onInitRepo', id);
ir.refreshResults(50);
ir.addRepoForInfo(item);
}
//--------------------------------------------------------------
@@ -237,6 +260,7 @@
$('table tbody', $pnl.table).prepend($item).show();
}
ir.populateItem($item, item);
ir.addRepoForInfo(item);
}
//--------------------------------------------------------------