{
const path = getDevicePath();
updateDeviceSetting([...path, 'name'], e.target.value);
}}
className="w-full px-3 py-2 border border-neutral-300 rounded-lg"
/>
{device.type.charAt(0).toUpperCase() + device.type.slice(1)}
{deviceData.base_url !== undefined && (
)}
{
const newUrl = e.target.value;
const devicePath = getDevicePath();
const newConfig = JSON.parse(JSON.stringify(config));
let dev = newConfig;
for (const k of devicePath) dev = dev[k];
if (isOutsideBase(newUrl, dev.base_url || '')) clearBaseAndCache(dev);
dev.url = newUrl;
setConfig(newConfig);
}}
className="flex-1 px-3 py-2 border border-neutral-300 rounded-lg"
/>
{mediaSetFiles && (
)}
{deviceData.cache !== undefined && (
)}
{deviceData.mode !== undefined && (
{
const path = getDevicePath();
updateDeviceSetting([...path, 'mode'], parseInt(e.target.value));
}}
className="w-full px-3 py-2 border border-neutral-300 rounded-lg"
/>
)}
{deviceData.type && (
{deviceData.type}
)}
{deviceData.baud !== undefined && (
{
const path = getDevicePath();
updateDeviceSetting([...path, 'baud'], parseInt(e.target.value));
}}
className="w-full px-3 py-2 border border-neutral-300 rounded-lg"
/>
)}