// #139: public history table + 30s auto-refresh.
const t = PaletteTable.init({
endpoint: '/api/public',
perPage: 25,
hasPager: true,
rowHtml: it =>
`
| ` +
(it.title
? `${t.esc(it.title)}${it.is_can ? ' can' : ''}`
: `${t.esc(it.id)}${it.is_can ? ' can' : ''}`) +
` | ` +
`${t.esc(it.language || 'text')} | ` +
`${t.fmtSize(it.size)} | ${it.view_count} | ${t.ago(it.created_at)} | ` +
(it.custom_slug ? `/${t.esc(it.custom_slug)} | ` : `none | `) +
`${t.esc(it.id)} |
`,
emptyFiltered: 'No pastes match your search.',
emptyAll: 'No pastes yet. Create the first one.',
});
t.load();
setInterval(t.load, 30000); // auto-refresh history every 30s