полный рефакторинг всей системы
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
40
src/services/settingsService.js
Normal file
40
src/services/settingsService.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import { api8001 } from './api.js'
|
||||
|
||||
export async function fetchSettings() {
|
||||
const { data } = await api8001.get('/settings')
|
||||
return data
|
||||
}
|
||||
|
||||
export async function saveSettings(name, prompt) {
|
||||
await api8001.post('/settings', { name, promt: prompt })
|
||||
}
|
||||
|
||||
export async function fetchLogs() {
|
||||
const { data } = await api8001.get('/logs')
|
||||
return data.logs ?? []
|
||||
}
|
||||
|
||||
export async function fetchTasks() {
|
||||
const { data } = await api8001.get('/get_tasks_offset')
|
||||
return data ?? []
|
||||
}
|
||||
|
||||
export async function deleteTask(id) {
|
||||
await api8001.delete(`/delete_task/${id}`)
|
||||
}
|
||||
|
||||
export async function startParser1(time) {
|
||||
await api8001.post('/parser_1', { time })
|
||||
}
|
||||
|
||||
export async function startParser2() {
|
||||
await api8001.post('/parser_2')
|
||||
}
|
||||
|
||||
export async function downloadAll(dataStart, dataFinish, fieldName) {
|
||||
return api8001.post(
|
||||
'/download_all',
|
||||
{ data_start: dataStart, data_finish: dataFinish, field_name: fieldName },
|
||||
{ responseType: 'blob' },
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user