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
7 changes: 4 additions & 3 deletions data/locales/boards.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ en:
kind_yaml: 'ipctool report'
no_board: 'No board named'
new_link: 'Add a camera that is not in the catalogue'
new_lede: 'Name the maker and the board, and add photos of it: the board''s front and back, and the label. A maintainer adds it to the catalogue when they publish your report; each photo and file earns {n} ★, and a whole-flash dump nobody sent before {dump} ★.'
new_dump_hint: 'Optional. Read the chip with a programmer when ipctool cannot run on the camera, for example behind a U-Boot password; a dump nobody sent before earns {n} ★.'
new_lede: 'Name the maker and the board, and add photos of it: the board''s front and back, and the label. A maintainer adds it to the catalogue when they publish your report; each photo and file earns {n} ★, and a whole-flash dump nobody sent before {dump} ★ from ipctool, or {raw} ★ read with a programmer.'
new_dump_hint: 'Optional. Read the chip with a programmer when ipctool cannot run on the camera, for example behind a U-Boot password; a dump nobody sent before earns {n} ★. ipctool''s report sent for it later earns its own star and leaves the dump''s as they are.'
code_get: 'Send ipctool''s report from a camera'
code_add_ipctool: 'Add ipctool''s report from this camera'
code_own: 'Run this on the camera within a day. The report becomes yours and earns stars once a maintainer accepts it.'
Expand All @@ -542,7 +542,8 @@ en:
proposed: 'New: {board}'
rules_title: 'How stars work'
rules_item: 'Boot log, U-Boot console, photo, pinout, ipctool report'
rules_dump: 'Full flash dump the catalogue doesn''t have'
rules_dump: 'Full flash dump the catalogue doesn''t have, taken by ipctool'
rules_raw_dump: 'Full flash dump the catalogue doesn''t have, read with a programmer or over TFTP'
rules_none: 'A dump the catalogue already holds, or anything not accepted'
rules_note: 'Reports earn stars when a maintainer accepts them, never on upload. Cameras earn theirs once a night, from the days they kept sending pictures; stars for a camera found to be fake are taken back.'
send_kinds_label: 'What you are sending'
Expand Down
7 changes: 4 additions & 3 deletions data/locales/boards.ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ ru:
kind_yaml: 'Отчёт ipctool'
no_board: 'Плата не указана'
new_link: 'Добавить камеру, которой нет в каталоге'
new_lede: 'Укажите производителя и плату и приложите фото: плату с обеих сторон и наклейку. Мейнтейнер добавит её в каталог, когда опубликует ваш отчёт; каждое фото и файл приносят {n} ★, а полный дамп флеша, которого у нас ещё нет, — {dump} ★.'
new_dump_hint: 'Необязательно. Снимите флеш программатором, если ipctool на камере не запустить, например когда U-Boot закрыт паролем; дамп, которого у нас ещё нет, приносит {n} ★.'
new_lede: 'Укажите производителя и плату и приложите фото: плату с обеих сторон и наклейку. Мейнтейнер добавит её в каталог, когда опубликует ваш отчёт; каждое фото и файл приносят {n} ★, а полный дамп флеша, которого у нас ещё нет, — {dump} ★ от ipctool или {raw} ★, снятый программатором.'
new_dump_hint: 'Необязательно. Снимите флеш программатором, если ipctool на камере не запустить, например когда U-Boot закрыт паролем; дамп, которого у нас ещё нет, приносит {n} ★. Отчёт ipctool, присланный к нему позже, приносит свою звезду, а за дамп остаётся столько же.'
code_get: 'Отправить отчёт ipctool с камеры'
code_add_ipctool: 'Добавить отчёт ipctool с этой камеры'
code_own: 'Выполните это на камере в течение суток. Отчёт станет вашим и принесёт звёзды, когда мейнтейнер его примет.'
Expand All @@ -593,7 +593,8 @@ ru:
proposed: 'Новая: {board}'
rules_title: 'Как начисляются звёзды'
rules_item: 'Лог загрузки, консоль U-Boot, фото, распиновка, отчёт ipctool'
rules_dump: 'Полный дамп флеш-памяти, которого нет в каталоге'
rules_dump: 'Полный дамп флеш-памяти, которого нет в каталоге, снятый ipctool'
rules_raw_dump: 'Полный дамп флеш-памяти, которого нет в каталоге, снятый программатором или по TFTP'
rules_none: 'Дамп, который уже есть в каталоге, или непринятый материал'
rules_note: 'Отчёты приносят звёзды, когда мейнтейнер их принимает, а не при загрузке. Камеры получают свои раз в сутки — за дни, в которые присылали снимки; звёзды камеры, оказавшейся поддельной, списываются.'
send_kinds_label: 'Что вы присылаете'
Expand Down
7 changes: 4 additions & 3 deletions data/locales/boards.zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ zh:
kind_yaml: 'ipctool 报告'
no_board: '未指定电路板'
new_link: '添加目录中没有的摄像头'
new_lede: '填写厂商和电路板,并附上照片:电路板正反面和标签。维护者发布你的报告时会把它加入目录;每张照片和每个文件可获得 {n} ★,我们还没有的完整闪存转储可获得 {dump} ★。'
new_dump_hint: '可选。如果摄像头上无法运行 ipctool(例如 U-Boot 设有密码),可以用编程器读取闪存芯片;我们还没有的转储可获得 {n} ★。'
new_lede: '填写厂商和电路板,并附上照片:电路板正反面和标签。维护者发布你的报告时会把它加入目录;每张照片和每个文件可获得 {n} ★,我们还没有的完整闪存转储:由 ipctool 制作可获得 {dump} ★,用编程器读取可获得 {raw} ★。'
new_dump_hint: '可选。如果摄像头上无法运行 ipctool(例如 U-Boot 设有密码),可以用编程器读取闪存芯片;我们还没有的转储可获得 {n} ★。之后为它补发的 ipctool 报告另得自己的星,转储的星数不变。'
code_get: '从摄像头发送 ipctool 报告'
code_add_ipctool: '添加这台摄像头的 ipctool 报告'
code_own: '请在一天内在摄像头上运行此命令。维护者接受后,报告归你所有并获得星星。'
Expand All @@ -537,7 +537,8 @@ zh:
proposed: '新:{board}'
rules_title: '星星如何计算'
rules_item: '启动日志、U-Boot 控制台、照片、引脚图、ipctool 报告'
rules_dump: '目录中没有的完整闪存转储'
rules_dump: '目录中没有的完整闪存转储,由 ipctool 制作'
rules_raw_dump: '目录中没有的完整闪存转储,用编程器或通过 TFTP 读取'
rules_none: '目录中已有的转储,或未通过的内容'
rules_note: '报告在维护者通过时计星,上传时不计。摄像头每晚结算一次,按其持续发送画面的天数计星;被认定为伪造的摄像头,其星星会被收回。'
send_kinds_label: '提交内容类型'
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/site/src/components/club/Club.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function Rules({ t }: { t: BoardsT }) {
<table class="w-full border-collapse">
<tbody>
{([
['rules_item', `+${STARS.item} ★`], ['rules_dump', `+${STARS.dump} ★`],
['rules_item', `+${STARS.item} ★`], ['rules_dump', `+${STARS.dump} ★`], ['rules_raw_dump', `+${STARS.rawDump} ★`],
['rules_join', `+${STARS.join} ★`], ['rules_month', `+${STARS.month} ★`], ['rules_rare', `+${STARS.rare} ★`],
['rules_none', '0'],
] as const).map(([k, v]) => (
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/site/src/components/club/NewCameraForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default function NewCameraForm({ locale }: { locale: Locale }) {

return (
<form class="grid gap-3 rounded-lg border-[1.5px] border-dashed border-[#e8c58f] bg-white p-4 text-sm" onSubmit={submit}>
<p class="m-0 text-body-secondary">{t('club.new_lede', { n: STARS.item, dump: STARS.dump })}</p>
<p class="m-0 text-body-secondary">{t('club.new_lede', { n: STARS.item, dump: STARS.dump, raw: STARS.rawDump })}</p>
<div class="grid gap-3 sm:grid-cols-[1fr_1fr_10rem]">
<label class="grid gap-1 text-[12.5px] text-body-secondary">{t('club.new_maker')}
<input required value={maker} maxLength={80} placeholder={t('club.new_maker_hint')}
Expand All @@ -105,7 +105,7 @@ export default function NewCameraForm({ locale }: { locale: Locale }) {
<label class="grid gap-1 text-[12.5px] text-body-secondary">{t('club.send_dump')}
<input type="file" onChange={(e) => setDump((e.target as HTMLInputElement).files?.[0] ?? null)} class="text-sm text-body" />
</label>
<p class="m-0 text-[12px] text-body-secondary">{t('club.new_dump_hint', { n: STARS.dump })}</p>
<p class="m-0 text-[12px] text-body-secondary">{t('club.new_dump_hint', { n: STARS.rawDump })}</p>
{dump && (
<label class="flex items-start gap-2 text-[12.5px] text-body-secondary">
<input type="checkbox" checked={publicDump} onChange={(e) => setPublicDump((e.target as HTMLInputElement).checked)} class="mt-0.5" />
Expand Down
6 changes: 6 additions & 0 deletions frontend/apps/site/src/components/club/SendForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ describe('the send form', () => {
expect(queryByText(/from power-on to the login prompt/)).toBeNull();
});

test('a dump is offered for 3 to 10 stars: a programmer read earns 3, ipctool 10', () => {
const { getByRole } = render(<SendForm model="anjoy-ms-j10" kind="photo" locale="en" t={t} />);
expect(getByRole('button', { name: /Full flash dump/ }).textContent).toContain('+3–10 ★');
expect(getByRole('button', { name: /Photos/ }).textContent).toContain('+1 ★');
});

test('a dump is private unless its owner ticks the box', async () => {
const sent = capture();
const { container, getByText } = render(<SendForm model="anjoy-ms-j10" kind="backup" locale="en" t={t} />);
Expand Down
3 changes: 2 additions & 1 deletion frontend/apps/site/src/components/club/SendForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export default function SendForm({ model, kind, locale, t, note }: {
);
}

const reward = (k: SendKind) => t('club.reward', { n: k === 'backup' ? STARS.dump : STARS.item });
// A dump earns 10 from ipctool, 3 from a programmer (#458): which this is shows only once it is read.
const reward = (k: SendKind) => t('club.reward', { n: k === 'backup' ? `${STARS.rawDump}–${STARS.dump}` : STARS.item });
return (
<form class="grid gap-2.5 rounded-lg border-[1.5px] border-dashed border-[#e8c58f] bg-white p-3.5 text-sm" onSubmit={submit}>
<div class="flex flex-wrap gap-1.5" role="group" aria-label={t('club.send_kinds_label')}>
Expand Down
7 changes: 4 additions & 3 deletions frontend/apps/site/src/i18n/boards.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@
"new_board_hint": "What is printed on the board, or the model on the box",
"new_boot_log": "Boot log or U-Boot console",
"new_boot_log_hint": "Either one: the whole boot from power-on to the login prompt, or U-Boot's console — autoboot stopped with Ctrl+C, then help, printenv and version.",
"new_dump_hint": "Optional. Read the chip with a programmer when ipctool cannot run on the camera, for example behind a U-Boot password; a dump nobody sent before earns {n} ★.",
"new_dump_hint": "Optional. Read the chip with a programmer when ipctool cannot run on the camera, for example behind a U-Boot password; a dump nobody sent before earns {n} ★. ipctool's report sent for it later earns its own star and leaves the dump's as they are.",
"new_ipctool": "ipctool's output",
"new_lede": "Name the maker and the board, and add photos of it: the board's front and back, and the label. A maintainer adds it to the catalogue when they publish your report; each photo and file earns {n} ★, and a whole-flash dump nobody sent before {dump} ★.",
"new_lede": "Name the maker and the board, and add photos of it: the board's front and back, and the label. A maintainer adds it to the catalogue when they publish your report; each photo and file earns {n} ★, and a whole-flash dump nobody sent before {dump} ★ from ipctool, or {raw} ★ read with a programmer.",
"new_link": "Add a camera that is not in the catalogue",
"new_maker": "Maker",
"new_maker_hint": "Xiongmai, Jooan, Hikvision…",
Expand Down Expand Up @@ -171,13 +171,14 @@
"review_proposal": "Proposed by the sender",
"review_title": "Review queue",
"reward": "+{n} ★",
"rules_dump": "Full flash dump the catalogue doesn't have",
"rules_dump": "Full flash dump the catalogue doesn't have, taken by ipctool",
"rules_item": "Boot log, U-Boot console, photo, pinout, ipctool report",
"rules_join": "A camera you linked has sent pictures for 30 days since, real ones on 20 separate days",
"rules_month": "Every further 30 days that camera keeps sending real pictures",
"rules_none": "A dump the catalogue already holds, or anything not accepted",
"rules_note": "Reports earn stars when a maintainer accepts them, never on upload. Cameras earn theirs once a night, from the days they kept sending pictures; stars for a camera found to be fake are taken back.",
"rules_rare": "The first camera on the wall with its chip or its sensor",
"rules_raw_dump": "Full flash dump the catalogue doesn't have, read with a programmer or over TFTP",
"rules_title": "How stars work",
"send_another": "Send something else",
"send_button": "Send to the catalogue",
Expand Down
7 changes: 4 additions & 3 deletions frontend/apps/site/src/i18n/boards.ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@
"new_board_hint": "Что напечатано на плате или модель на коробке",
"new_boot_log": "Лог загрузки или консоль U-Boot",
"new_boot_log_hint": "Подойдёт любой: вся загрузка от включения до приглашения входа или консоль U-Boot — автозагрузка остановлена Ctrl+C, затем help, printenv и version.",
"new_dump_hint": "Необязательно. Снимите флеш программатором, если ipctool на камере не запустить, например когда U-Boot закрыт паролем; дамп, которого у нас ещё нет, приносит {n} ★.",
"new_dump_hint": "Необязательно. Снимите флеш программатором, если ipctool на камере не запустить, например когда U-Boot закрыт паролем; дамп, которого у нас ещё нет, приносит {n} ★. Отчёт ipctool, присланный к нему позже, приносит свою звезду, а за дамп остаётся столько же.",
"new_ipctool": "Вывод ipctool",
"new_lede": "Укажите производителя и плату и приложите фото: плату с обеих сторон и наклейку. Мейнтейнер добавит её в каталог, когда опубликует ваш отчёт; каждое фото и файл приносят {n} ★, а полный дамп флеша, которого у нас ещё нет, — {dump} ★.",
"new_lede": "Укажите производителя и плату и приложите фото: плату с обеих сторон и наклейку. Мейнтейнер добавит её в каталог, когда опубликует ваш отчёт; каждое фото и файл приносят {n} ★, а полный дамп флеша, которого у нас ещё нет, — {dump} ★ от ipctool или {raw} ★, снятый программатором.",
"new_link": "Добавить камеру, которой нет в каталоге",
"new_maker": "Производитель",
"new_maker_hint": "Xiongmai, Jooan, Hikvision…",
Expand Down Expand Up @@ -173,13 +173,14 @@
"review_proposal": "Предложено отправителем",
"review_title": "Очередь проверки",
"reward": "+{n} ★",
"rules_dump": "Полный дамп флеш-памяти, которого нет в каталоге",
"rules_dump": "Полный дамп флеш-памяти, которого нет в каталоге, снятый ipctool",
"rules_item": "Лог загрузки, консоль U-Boot, фото, распиновка, отчёт ipctool",
"rules_join": "Привязанная вами камера присылает снимки 30 дней, настоящие — в 20 разных днях",
"rules_month": "Каждые следующие 30 дней, в которые камера присылает настоящие снимки",
"rules_none": "Дамп, который уже есть в каталоге, или непринятый материал",
"rules_note": "Отчёты приносят звёзды, когда мейнтейнер их принимает, а не при загрузке. Камеры получают свои раз в сутки — за дни, в которые присылали снимки; звёзды камеры, оказавшейся поддельной, списываются.",
"rules_rare": "Первая камера на стене с таким чипом или сенсором",
"rules_raw_dump": "Полный дамп флеш-памяти, которого нет в каталоге, снятый программатором или по TFTP",
"rules_title": "Как начисляются звёзды",
"send_another": "Прислать что-то ещё",
"send_button": "Отправить в каталог",
Expand Down
Loading
Loading