Commit 0bc73cd3 authored by martin hou's avatar martin hou

feat: adding factory reset button

parent 721e15db
...@@ -862,6 +862,15 @@ export function Home() { ...@@ -862,6 +862,15 @@ export function Home() {
await releaseJensen(); await releaseJensen();
} }
const handleFactoryReset= async () => {
let jensen = await getJensen();
if (jensen == null) return;
if (!confirm('Are you sure ?\n\nYou may lost all data on device.')) return;
let rst = await jensen.factoryReset(120);
Logger.info('jensen', 'factory-reset', JSON.stringify(rst));
await releaseJensen();
}
return ( return (
<> <>
<div className="btn-container" style={{ display: 'flex', flexDirection: 'row', gap: '16px', padding: '16px', alignItems: 'center', flexWrap: 'wrap' }}> <div className="btn-container" style={{ display: 'flex', flexDirection: 'row', gap: '16px', padding: '16px', alignItems: 'center', flexWrap: 'wrap' }}>
...@@ -909,6 +918,7 @@ export function Home() { ...@@ -909,6 +918,7 @@ export function Home() {
<button onClick={switchAudioInputDevice}>Switch Audio Input Device</button> <button onClick={switchAudioInputDevice}>Switch Audio Input Device</button>
<button onClick={handleReadBlock}>Read Block</button> <button onClick={handleReadBlock}>Read Block</button>
<button onClick={handleTransferX}>Transer Filex</button> <button onClick={handleTransferX}>Transer Filex</button>
<button onClick={handleFactoryReset}>Factory Reset</button>
<span style={{ marginLeft: '8px' }}>Interval(ms): </span> <span style={{ marginLeft: '8px' }}>Interval(ms): </span>
<input <input
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment