gonets/FRONT/DEV/src/store/settings/config/networkSettings.ts
test ee350c1852
Some checks failed
ci/woodpecker/manual/woodpecker Pipeline failed
Добавление настроек и их функциональности
2025-07-04 15:07:41 +05:00

34 lines
No EOL
1 KiB
TypeScript

import {useIpStore} from "../../ipStore";
import {NetworkService} from "../../../api/request";
const createNetworkSettings = () => {
const { ipAddress } = useIpStore.getState();
return [
{
id: 'clean-network',
type: 'button',
label: 'Очистить данные сессии',
sectionId: 'Точки доступа',
defaultValue: 'Очистить',
action: async ()=>{
try {
const res = await NetworkService.clearNetwork(ipAddress);
console.log(res);
}catch (e){
console.error(e);
alert('Данные не были удалены: '+ e)
}
},
},
{
id: 'export-network',
type: 'button',
label: 'Экспорт данных точек доступа',
sectionId: 'Точки доступа',
defaultValue: 'Экспортировать',
},
] as const;
};
export const networkSettings = createNetworkSettings();