Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,6 @@ <h1 class="sec-title" id="ev-title">General</h1>
</div></div>
</div>

<script type="module" src="/js/admin.js?v=c5a04f6d"></script>
<script type="module" src="/js/admin.js?v=8d54f118"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions ui/js/admin-app-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
failureIsMissingApiPath,
nextActiveIndex,
sameIconName,
} from '/js/admin-logic.js?v=5356a1b3';
} from '/js/admin-logic.js?v=cbb7417d';
import { t } from '/js/i18n.js?v=1f1ea9c1';
import {
toast,
Expand All @@ -21,10 +21,10 @@ import {
reveal,
setTogDisabled,
swapContent,
} from '/js/admin-shared.js?v=d218efee';
import { createListbox } from '/js/listbox.js?v=80606092';
} from '/js/admin-shared.js?v=7407b339';
import { createListbox } from '/js/listbox.js?v=ccee5041';
import { MAX_LABELS } from '/js/badge-logic.js?v=9e6d9d4b';
import { renderColorControl, BADGE_DEFAULT } from '/js/admin-color-control.js?v=96364a80';
import { renderColorControl, BADGE_DEFAULT } from '/js/admin-color-control.js?v=6f0cd148';
import { badgeErrorAdvice, TONE } from '/js/admin-error.js?v=e4ea7820';
import { fluidHoverClear, fluidHoverKb } from '/js/fluid-hover.js?v=cb886e86';
import { iconSvg } from '/js/icon-set.js?v=ba9434d9';
Expand Down
2 changes: 1 addition & 1 deletion ui/js/admin-auth.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { apiGet, apiPost } from '/js/admin-shared.js?v=d218efee';
import { apiGet, apiPost } from '/js/admin-shared.js?v=7407b339';
import { t } from '/js/i18n.js?v=1f1ea9c1';
import { pwStrength } from '/js/password-strength.js?v=42f45ac7';
import { el, inp as inpById, qa } from '/js/utils.js?v=ed0f1802';
Expand Down
2 changes: 1 addition & 1 deletion ui/js/admin-color-control.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PE_SVG, initInlineEdit, toast, reveal } from '/js/admin-shared.js?v=d218efee';
import { PE_SVG, initInlineEdit, toast, reveal } from '/js/admin-shared.js?v=7407b339';
import { t } from '/js/i18n.js?v=1f1ea9c1';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { qa, q } from '/js/utils.js?v=ed0f1802';
Expand Down
6 changes: 3 additions & 3 deletions ui/js/admin-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

import { collapsedFolders, filter, state } from '/js/admin-state.js?v=831e219e';
import { snapshotItems } from '/js/admin-save-logic.js?v=60a82419';
import { reorderItems } from '/js/admin-logic.js?v=5356a1b3';
import { reorderItems } from '/js/admin-logic.js?v=cbb7417d';
import { initDrag, wireRowDrag } from '/js/admin-drag.js?v=0a411097';
import { paintIcon } from '/js/admin-shared.js?v=d218efee';
import { paintIcon } from '/js/admin-shared.js?v=7407b339';
import { clr, el, qa, setUserText } from '/js/utils.js?v=ed0f1802';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { t } from '/js/i18n.js?v=1f1ea9c1';
import { sizeLabel } from '/js/admin-widget-form.js?v=e17ed1b7';
import { sizeLabel } from '/js/admin-widget-form.js?v=0112370e';
import { widgetGlyph } from '/js/widget-glyphs.js?v=ad1869d7';
import { iconSvg } from '/js/icon-set.js?v=ba9434d9';

Expand Down
11 changes: 4 additions & 7 deletions ui/js/admin-logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,9 @@ export function isBareHostUrl(url) {
/** Whether a failed badge fetch should report the missing API path instead of
the failure itself.

The hint is a guess from the address. The error code is what the service
reported. A guess never replaces a known cause, so the hint is shown only
where a missing path could actually explain the failure: the service
answered and had nothing there (404), or answered with something that is not
data. A request that was blocked, never connected, or was refused for
credentials failed for a reason the path cannot change.
Shown only where a missing path explains the failure: a bare address that
answered 404 or redirected, usually to a login page. Anything else is
reported as itself.

@param {string} url
@param {{ sessionExpired?: boolean, code?: string, vars?: { status?: number } }} advice
Expand All @@ -319,7 +316,7 @@ export function failureIsMissingApiPath(url, advice) {
if (!advice || advice.sessionExpired) return false;
if (!isBareHostUrl(url)) return false;
if (advice.code === 'upstream.status') return advice.vars?.status === 404;
return advice.code === 'invalid';
return advice.code === 'upstream.redirect';
}

/** Compares what `read` returns now with what it returned at the last reset.
Expand Down
6 changes: 3 additions & 3 deletions ui/js/admin-settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toast, apiGet, apiPost, reveal, swapContent } from '/js/admin-shared.js?v=d218efee';
import { toast, apiGet, apiPost, reveal, swapContent } from '/js/admin-shared.js?v=7407b339';
import { pwStrength } from '/js/password-strength.js?v=42f45ac7';
import { t } from '/js/i18n.js?v=1f1ea9c1';
import {
Expand All @@ -7,10 +7,10 @@ import {
clearsStoredPassword,
createDirtyTracker,
BLOCK,
} from '/js/admin-logic.js?v=5356a1b3';
} from '/js/admin-logic.js?v=cbb7417d';
import { confirmText } from '/js/modal.js?v=11fa1eff';
import { el, inp, setUserText } from '/js/utils.js?v=ed0f1802';
import { renderColorControl } from '/js/admin-color-control.js?v=96364a80';
import { renderColorControl } from '/js/admin-color-control.js?v=6f0cd148';
import { BACKDROP } from '/js/background.js?v=848da677';

/* Mirrors the server's rule: auth cannot be switched on with no password. */
Expand Down
2 changes: 1 addition & 1 deletion ui/js/admin-shared.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Stateless helpers shared by the admin modules. Mutable state stays out. */
import { recoversSession, toastHoldMs } from '/js/admin-logic.js?v=5356a1b3';
import { recoversSession, toastHoldMs } from '/js/admin-logic.js?v=cbb7417d';
import { el, q } from '/js/utils.js?v=ed0f1802';
import { t } from '/js/i18n.js?v=1f1ea9c1';
import { iconChain } from '/js/icons.js?v=9c8c550c';
Expand Down
8 changes: 4 additions & 4 deletions ui/js/admin-widget-form.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { state } from '/js/admin-state.js?v=831e219e';
import { PE_SVG, initInlineEdit, swapContent } from '/js/admin-shared.js?v=d218efee';
import { createListbox } from '/js/listbox.js?v=80606092';
import { renderWidgetConfigForm } from '/js/widget-config-form.js?v=0dbce7d5';
import { PE_SVG, initInlineEdit, swapContent } from '/js/admin-shared.js?v=7407b339';
import { createListbox } from '/js/listbox.js?v=ccee5041';
import { renderWidgetConfigForm } from '/js/widget-config-form.js?v=f6c23560';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { sizesForView, widgetConfigMode, rejectionLines, carriesTypedValues } from '/js/admin-logic.js?v=5356a1b3';
import { sizesForView, widgetConfigMode, rejectionLines, carriesTypedValues } from '/js/admin-logic.js?v=cbb7417d';
import { t } from '/js/i18n.js?v=1f1ea9c1';
import { q, qi, qa } from '/js/utils.js?v=ed0f1802';
import { iconSvg } from '/js/icon-set.js?v=ba9434d9';
Expand Down
16 changes: 8 additions & 8 deletions ui/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { buildAppForm, buildFolderForm, captureActLabels, serializeKvRows } from '/js/admin-app-form.js?v=097f38ca';
import { checkAuth, requireLogin, wirePasswordStrength } from '/js/admin-auth.js?v=fbd8a6cb';
import { initList, render, syncFilterUI } from '/js/admin-list.js?v=1c8871af';
import { resolveAdminSection } from '/js/admin-logic.js?v=5356a1b3';
import { buildAppForm, buildFolderForm, captureActLabels, serializeKvRows } from '/js/admin-app-form.js?v=bc1dd21c';
import { checkAuth, requireLogin, wirePasswordStrength } from '/js/admin-auth.js?v=3a99f588';
import { initList, render, syncFilterUI } from '/js/admin-list.js?v=33904226';
import { resolveAdminSection } from '/js/admin-logic.js?v=cbb7417d';
import {
buildAppItem,
claimFolderChildren,
Expand All @@ -10,7 +10,7 @@ import {
snapshotItems,
upsertItem,
} from '/js/admin-save-logic.js?v=60a82419';
import { loadSettings, settingsDirty, showBgFields, showWallpaperFile } from '/js/admin-settings.js?v=b5694a5f';
import { loadSettings, settingsDirty, showBgFields, showWallpaperFile } from '/js/admin-settings.js?v=d70ae980';
import {
apiGet,
apiPost,
Expand All @@ -19,12 +19,12 @@ import {
reveal,
setReauthHandler,
toast,
} from '/js/admin-shared.js?v=d218efee';
} from '/js/admin-shared.js?v=7407b339';
import { collapsedFolders, filter, state } from '/js/admin-state.js?v=831e219e';
import { buildWidgetForm } from '/js/admin-widget-form.js?v=e17ed1b7';
import { buildWidgetForm } from '/js/admin-widget-form.js?v=0112370e';
import { initFluidHover } from '/js/fluid-hover.js?v=cb886e86';
import { initGlideSelect, syncGlideSelect } from '/js/glide-select.js?v=8b39e9d0';
import { createListbox } from '/js/listbox.js?v=80606092';
import { createListbox } from '/js/listbox.js?v=ccee5041';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { initI18n, LANGUAGES, t } from '/js/i18n.js?v=1f1ea9c1';
import { loadLocalIcons } from '/js/icons.js?v=9c8c550c';
Expand Down
2 changes: 1 addition & 1 deletion ui/js/listbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Do not use popover. The top layer makes iOS collapse its browser toolbar,
which exposes a strip of page canvas and misplaces the menu. */

import { nextActiveIndex } from '/js/admin-logic.js?v=5356a1b3';
import { nextActiveIndex } from '/js/admin-logic.js?v=cbb7417d';
import { fluidHoverClear, fluidHoverKb } from '/js/fluid-hover.js?v=cb886e86';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { qa } from '/js/utils.js?v=ed0f1802';
Expand Down
8 changes: 4 additions & 4 deletions ui/js/widget-config-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

import { t } from '/js/i18n.js?v=1f1ea9c1';
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
import { reveal, wireInlineEdit } from '/js/admin-shared.js?v=d218efee';
import { createListbox } from '/js/listbox.js?v=80606092';
import { renderColorControl } from '/js/admin-color-control.js?v=96364a80';
import { reveal, wireInlineEdit } from '/js/admin-shared.js?v=7407b339';
import { createListbox } from '/js/listbox.js?v=ccee5041';
import { renderColorControl } from '/js/admin-color-control.js?v=6f0cd148';
import {
seedCarried,
applyOptionSet,
collectFieldValues,
requiredFieldMissing,
groupBounds,
visibleFieldFlags,
} from '/js/admin-logic.js?v=5356a1b3';
} from '/js/admin-logic.js?v=cbb7417d';
import { optionsErrorAdvice, TONE } from '/js/admin-error.js?v=e4ea7820';
import { qi } from '/js/utils.js?v=ed0f1802';

Expand Down
8 changes: 3 additions & 5 deletions ui/test/admin-logic.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,10 @@ test('isBareHostUrl rejects what it cannot parse', () => {
for (const u of ['', ' ', 'http://', undefined, null, 42]) assert.equal(isBareHostUrl(u), false, String(u));
});

/* The two failures a missing path actually produces: the service answers and
has nothing there, or answers with something that is not data. */
test('a failed fetch of a bare address reports the missing API path', () => {
const notFound = { code: 'upstream.status', vars: { status: 404 } };
const notData = { code: 'invalid' };
for (const advice of [notFound, notData]) {
const redirected = { code: 'upstream.redirect', vars: { status: 302 } };
for (const advice of [notFound, redirected]) {
assert.equal(failureIsMissingApiPath('https://seerr.example.com', advice), true, advice.code);
assert.equal(failureIsMissingApiPath('https://seerr.example.com/api/v1/request/count', advice), false);
}
Expand All @@ -598,7 +596,7 @@ test('a known cause is reported instead of the path hint', () => {
{ code: 'timeout' },
{ code: 'network.tls-untrusted' },
{ code: 'invalid.retype' },
{ code: 'upstream.redirect', vars: { status: 301 } },
{ code: 'invalid' },
{ code: 'upstream.status', vars: { status: 401 } },
{ code: 'upstream.status', vars: { status: 500 } },
]) {
Expand Down
Loading