Mail-DMARC
view release on metacpan or search on metacpan
share/html/js/app.js view on Meta::CPAN
// Routing, shared scope controls, and boot.
//
// All view state lives in the location hash, so any view of the data is a
// link an operator can paste into a ticket.
import { el, replace, api, num, nowDay, days, dayFull, dayOrYear } from './core.js';
import { combobox } from './combo.js';
import * as ptr from './ptr.js';
import * as overview from './overview.js';
import * as sources from './sources.js';
import * as reports from './reports.js';
const VIEWS = { overview, sources, reports };
const WINDOWS = [
{ key: '7', label: 'Last 7 days', days: 7 },
{ key: '30', label: 'Last 30 days', days: 30 },
share/html/js/app.js view on Meta::CPAN
windowSelect.value = DEFAULT_WINDOW;
const rescope = (patch) => {
const { view, state } = parseHash();
writeHash(view, { ...state, ...patch, start: null });
};
windowSelect.addEventListener('change',
() => rescope({ window: windowSelect.value }));
domainPicker = combobox({
id: 'scope-domain',
placeholder: 'All domains',
onSelect: (domain) => rescope({ domain: domain || null }),
});
document.getElementById('scope-domain-mount').append(domainPicker.node);
try {
const { data } = await api.domains();
domainInfo = new Map((data || []).map((row) => [row.domain, row]));
domainPicker.setItems([
share/html/js/combo.js view on Meta::CPAN
// A filtering picker for lists too long to scroll: a store can hold thousands
// of domains, and a plain select makes finding one a scrolling exercise.
import { el, clear } from './core.js';
const VISIBLE = 60;
export const combobox = ({ id, placeholder, onSelect }) => {
const input = el('input', {
type: 'text',
role: 'combobox',
id,
class: 'combo-input',
placeholder,
autocomplete: 'off',
spellcheck: 'false',
'aria-expanded': 'false',
'aria-autocomplete': 'list',
'aria-controls': `${id}-list`,
});
const list = el('ul', { id: `${id}-list`, class: 'combo-list', role: 'listbox',
( run in 2.795 seconds using v1.01-cache-2.11-cpan-8dfa8b56332 )