+53
-27
@@ -752,34 +752,38 @@ export async function pullImageWithAuth(args) {
|
||||
}
|
||||
|
||||
try {
|
||||
const job = await runJob(`Pull ${image}`, [
|
||||
{
|
||||
id: 'pull',
|
||||
label: 'Download layers',
|
||||
run: async ({ job: j, log }) => {
|
||||
const tracker = beginPullProgress(image, j.id, 'pull')
|
||||
const initial = tracker.snapshot()
|
||||
setJobProgress(j.id, initial, {
|
||||
stepId: 'pull',
|
||||
})
|
||||
log(`Pulling ${image}…`)
|
||||
try {
|
||||
const res = await manager.request(Methods.pullImage, body)
|
||||
applyFinalPullToJob(finalizePullProgress(image, { ok: true }))
|
||||
log(res?.message || 'Pull complete')
|
||||
return res
|
||||
} catch (err) {
|
||||
applyFinalPullToJob(
|
||||
finalizePullProgress(image, {
|
||||
ok: false,
|
||||
message: err?.message || String(err),
|
||||
})
|
||||
)
|
||||
throw err
|
||||
}
|
||||
const job = await runJob(
|
||||
`Pull ${image}`,
|
||||
[
|
||||
{
|
||||
id: 'pull',
|
||||
label: 'Download layers',
|
||||
run: async ({ job: j, log }) => {
|
||||
const tracker = beginPullProgress(image, j.id, 'pull')
|
||||
const initial = tracker.snapshot()
|
||||
setJobProgress(j.id, initial, {
|
||||
stepId: 'pull',
|
||||
})
|
||||
log(`Pulling ${image}…`)
|
||||
try {
|
||||
const res = await manager.request(Methods.pullImage, body)
|
||||
applyFinalPullToJob(finalizePullProgress(image, { ok: true }))
|
||||
log(res?.message || 'Pull complete')
|
||||
return res
|
||||
} catch (err) {
|
||||
applyFinalPullToJob(
|
||||
finalizePullProgress(image, {
|
||||
ok: false,
|
||||
message: err?.message || String(err),
|
||||
})
|
||||
)
|
||||
throw err
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
],
|
||||
{ icon: 'fa-download', subtitle: image }
|
||||
)
|
||||
// Job tray is source of truth — light success toast only if drawer inactive
|
||||
const msg = job?.result?.message || `Pulled ${image}`
|
||||
if (!window.peardockOps?.isJobDrawerActive?.()) {
|
||||
@@ -815,6 +819,28 @@ export async function pushImageWithAuth(args) {
|
||||
if (args.credentialId) body.credentialId = args.credentialId
|
||||
|
||||
const label = args.repo ? `${args.repo}:${args.tag || 'latest'}` : image
|
||||
|
||||
// Prefer hybrid job-tray push progress (same UX as pull)
|
||||
if (typeof window.peardockOps?.pushImageJob === 'function') {
|
||||
try {
|
||||
document.getElementById('progress-push-image')?.remove()
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
const res = await window.peardockOps.pushImageJob({
|
||||
...args,
|
||||
image,
|
||||
body,
|
||||
})
|
||||
if (typeof window.loadImages === 'function') window.loadImages()
|
||||
return res
|
||||
} catch (err) {
|
||||
if (!err?.viaJob) presentError(err, 'pushImage', { showAlert })
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
const host =
|
||||
document.getElementById('registry-view') ||
|
||||
document.getElementById('images-view') ||
|
||||
|
||||
Reference in New Issue
Block a user