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 c911391fd6
commit 5c449d9502
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 orderOptions = useShopStore.getState().order_options;
const orderOptionsData = useShopStore.getState().order_options_data;
const crateParams = useShopStore.getState().crateParams;
return JSON.stringify({
// additional fields can go here
crates: Array.from(crates.map((crate, _i) => ({
items: Array.from(crate.items.map((card, _) => ({
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,
options: FilterOptions(crateOptions, crate.options_data)

View File

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

View File

@ -18,7 +18,7 @@ const shop_data = {
},
no_crate: {
id: 'no_crate',
name: 'Spare cards',
name: 'Spare items',
price: 0,
hp: -1,
warnings_disabled: true,
@ -1421,6 +1421,26 @@ const shop_data = {
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: {
@ -1477,6 +1497,7 @@ const shop_data = {
'koster',
'eem_pwr_mod',
'kirdy',
'afws',
]}
],
},
@ -1491,7 +1512,7 @@ const shop_data = {
},
{
id: "spare",
name: "Spare cards",
name: "Spare items",
crate_mode: "no_crate",
items: [],
warnings: [],