mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-06 20:43:27 -05:00
Upgrades of add-ons and backends started at once: a backend Upgrade button and Update all fired immediately, and an add-on could only be upgraded from the Details panel. Add a shared "Review updates" sheet. It lists each pending item as installed version to candidate version, with checkboxes, Upgrade selected and Upgrade all. Nothing runs until the administrator confirms in it. An add-on whose candidate the host cannot run is listed with the reasons and cannot be selected. One failure does not stop the other items; the sheet and a toast report each result. Entry points: an "Updates (N)" button on the add-ons grid and on the Backends header, an Upgrade action on each add-on card, and a "Check for updates" action that checks every installed add-on. Row Upgrade buttons on the Backends page open the sheet with that backend checked. Add-on upgrades are now followed by a small store outside the page, so they continue across routes. They show in the Activity page under a new Add-ons filter with progress, Cancel and Retry. Cancel aborts the request and the page reads the operation to report the owner's answer. The confirmation header and the one-identity-per-action rules are unchanged, and no tool is added. No server change. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code] Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
24 lines
1.2 KiB
JavaScript
24 lines
1.2 KiB
JavaScript
import { test, expect } from './coverage-fixtures.js'
|
|
import { UPGRADE_LLAMA, mockOperate } from './operate-fixtures.js'
|
|
|
|
// An update is said where it can be acted on: in the row's state, in the one
|
|
// primary button above the list and on the tab. It is not a banner. A filled
|
|
// panel makes every notice shout at the weight of an error, and a coloured
|
|
// rail on its edge is decoration that repeats on every item.
|
|
|
|
test('an update is a row state and a header button, not a banner or a rail', async ({ page }) => {
|
|
await mockOperate(page, { upgrades: UPGRADE_LLAMA })
|
|
await page.goto('/app/backends?view=installed')
|
|
|
|
const row = page.locator('[data-entity="llama-cpp"]')
|
|
await expect(row).toContainText('Update 0.9.7')
|
|
await expect(page.getByRole('button', { name: 'Updates (1)' })).toBeVisible()
|
|
await expect(page.locator('.dk-hubtabs [data-hub-tab="runtime"] .dk-hubtab-attn')).toContainText('1')
|
|
|
|
// Nothing here is a filled card with an edge.
|
|
await expect(page.locator('.bk-notice')).toHaveCount(0)
|
|
const edges = await page.evaluate(() => [...document.querySelectorAll('.bk-table tr, .op-notice, .bk-recommend, .bk-manual')]
|
|
.map(el => parseFloat(getComputedStyle(el).borderLeftWidth)))
|
|
expect(Math.max(0, ...edges)).toBeLessThanOrEqual(1)
|
|
})
|