Add AFWS item to the shop and update bundle

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2024-08-05 10:26:56 +08:00
parent 60f8574a8c
commit 5e5246e8ae
5 changed files with 30 additions and 8 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

View File

@ -65,12 +65,13 @@ export function CratesToJSON(crates) {
const crateOptions = useShopStore.getState().crate_options; const crateOptions = useShopStore.getState().crate_options;
const orderOptions = useShopStore.getState().order_options; const orderOptions = useShopStore.getState().order_options;
const orderOptionsData = useShopStore.getState().order_options_data; const orderOptionsData = useShopStore.getState().order_options_data;
const crateParams = useShopStore.getState().crateParams;
return JSON.stringify({ return JSON.stringify({
// additional fields can go here // additional fields can go here
crates: Array.from(crates.map((crate, _i) => ({ crates: Array.from(crates.map((crate, _i) => ({
items: Array.from(crate.items.map((card, _) => ({ items: Array.from(crate.items.map((card, _) => ({
pn: card.name_number, pn: card.name_number,
options: (card.options_data && card.options) ? FilterOptions(card.options, card.options_data) : null options: (card.options_data && card[crateParams(crate.crate_mode).options]) ? FilterOptions(card[crateParams(crate.crate_mode).options], card.options_data) : null
}))), }))),
type: crate.crate_mode, type: crate.crate_mode,
options: FilterOptions(crateOptions, crate.options_data) options: FilterOptions(crateOptions, crate.options_data)

View File

@ -27,10 +27,9 @@ const hostname = (params) => {
} }
const labels = text.split('.'); const labels = text.split('.');
for (const label of labels) { for (const label of labels) {
if (label.length < 1 || label.length > maxLabelLength) { if (label.length < 1
return false; || label.length > maxLabelLength
} || !labelRegex.test(label)) {
if (!labelRegex.test(label)) {
return false; return false;
} }
} }

View File

@ -18,7 +18,7 @@ const shop_data = {
}, },
no_crate: { no_crate: {
id: 'no_crate', id: 'no_crate',
name: 'Spare cards', name: 'Spare items',
price: 0, price: 0,
hp: -1, hp: -1,
warnings_disabled: true, warnings_disabled: true,
@ -1443,6 +1443,26 @@ const shop_data = {
hp: 8, hp: 8,
}, },
}, },
'afws': {
id: 'afws',
name: 'Subscription',
name_number: 'AFWS',
name_codename: '',
price: 800,
image: '/images/shop/graphic-03_AFWS.svg',
specs: [
"Artiq Firmware Service for one variant for one year.",
"Includes support at helpdesk.",
"Included with purchase of any Carrier with no additional cost.",
],
crateless: true,
crateless_options: [
{type: "Line", args: {title: "Variant name", outvar: "variant_name", fallback: "",
tip: "Variant name can be found on the sticker on top of the crate. If you don't have one, leave the preferred name here."}},
],
size: 'big',
warnings: [],
},
}, },
columns: { columns: {
@ -1500,6 +1520,7 @@ const shop_data = {
'koster', 'koster',
'eem_pwr_mod', 'eem_pwr_mod',
'kirdy', 'kirdy',
'afws',
]} ]}
], ],
}, },
@ -1514,7 +1535,7 @@ const shop_data = {
}, },
{ {
id: "spare", id: "spare",
name: "Spare cards", name: "Spare items",
crate_mode: "no_crate", crate_mode: "no_crate",
items: [], items: [],
warnings: [], warnings: [],