You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Orchestrator/Demo/HR_01/HR_officer01.js

75 lines
2.0 KiB

$('.ui.selection.dropdown')
.dropdown("clear")
;
var switchFlag = "1,";
document.getElementById("Vacancy1Status").innerHTML = "Робот на вакансию 1 оффлайн"
document.getElementById("Vacancy2Status").innerHTML = "Робот на вакансию 2 оффлайн"
var btn1 = document.createElement("Button")
btn1.innerHTML = "Старт"
btn1.onclick = function() {
if (switchFlag == "1,"){
document.getElementById("Vacancy1Status").innerHTML = "Робот на вакансию 1 онлайн"
}
else {
document.getElementById("Vacancy2Status").innerHTML = "Робот на вакансию 2 онлайн"
}
}
var btn2 = document.createElement("Button")
btn2.innerHTML = "Стоп"
btn2.onclick = function() {
if (switchFlag == "1,"){
document.getElementById("Vacancy1Status").innerHTML = "Робот на вакансию 1 оффлайн"
}
else {
document.getElementById("Vacancy2Status").innerHTML = "Робот на вакансию 2 оффлайн"
}
}
function get_data(i)
{
var link = document.createElement('a');
if (i == 'question') {
link.setAttribute('href', '/HR_officer01/questions');
link.setAttribute('download', 'Questions.csv');
link.click();
} else if (i == "results") {
link.setAttribute('href', '/HR_officer01/results');
link.setAttribute('download', 'All_results.csv');
link.click();
} else if (i == "logs"){
link.setAttribute('href', '/HR_officer01/logs');
link.setAttribute('download', 'log.txt');
link.click();
}
return false;
}
function bot_change() {
switchFlag = $('.ui.selection.dropdown').dropdown("get value")
if ($('.ui.selection.dropdown').dropdown("get value") == "1,") {
document.getElementById("conteiner").appendChild(btn1)
document.getElementById("conteiner").appendChild(btn2)
}
else if ($('.ui.selection.dropdown').dropdown("get value") == "0,"){
document.getElementById("conteiner").appendChild(btn1)
document.getElementById("conteiner").appendChild(btn2)
}
}