|
|
|
@ -85,15 +85,10 @@ export default function Processes() { |
|
|
|
|
refreshLock = false |
|
|
|
|
} |
|
|
|
|
let output = async (process: ProcessInterface) => { |
|
|
|
|
let response = await fetch(`http://fmw.sipachev.sv/system-monitoring/processes/${process.id}/output`, |
|
|
|
|
{ |
|
|
|
|
method: 'GET', |
|
|
|
|
headers: { |
|
|
|
|
'X-Plugin-Token': 'passw0rd', |
|
|
|
|
'X-Pagination-Count': '0', |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
const output: string = await response.text() |
|
|
|
|
const { data: output } = await smClient.getProcessOutput({ |
|
|
|
|
id: process.id |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
let a = document.createElement("a"); |
|
|
|
|
let file = new Blob([output], {type: 'plain/text'}); |
|
|
|
|
a.href = URL.createObjectURL(file); |
|
|
|
@ -126,18 +121,12 @@ export default function Processes() { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
lock = true |
|
|
|
|
let url = `http://fmw.sipachev.sv/system-monitoring/processes/${selectedProcess.id}/repeat` |
|
|
|
|
let data = { |
|
|
|
|
|
|
|
|
|
await smClient.repeatProcess({ |
|
|
|
|
id: selectedProcess.id, |
|
|
|
|
requestId: dialogId |
|
|
|
|
} |
|
|
|
|
let response = await fetch(url, { |
|
|
|
|
method: 'POST', |
|
|
|
|
headers: { |
|
|
|
|
'Content-Type': 'application/json;charset=utf-8', |
|
|
|
|
'X-Plugin-Token': 'passw0rd' |
|
|
|
|
}, |
|
|
|
|
body: JSON.stringify(data) |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
lock = false |
|
|
|
|
setSelectedProcess(null) |
|
|
|
|
setOpen(false) |
|
|
|
|