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/SIMPLE_01/index.html

129 lines
5.1 KiB

<div class="card" style="width:100%;" id="{{config.robot_key_str}}-card">
<div class="content">
<h1 class="ui center aligned icon header">SIMPLE_01: ПРОСТОЙ РОБОТ</h1>
<div class="ui message">
<div class="header">Применение:</div>
<p>Текст панели управления.</p>
<div class="header">Сотрудник:</div>
{% if UserInfoDict['UserNameUpperStr'] %}
<p>{{UserInfoDict['UserNameUpperStr']}}</p>
{% else %}
<p>Авторизация отключена в настройках оркестратора</p>
{% endif %}
</div>
<div class="ui segment" id="{{config.robot_key_str}}-segment">
<div class="ui two column very relaxed grid">
<div class="column">
<h3 class="ui center aligned icon header">СОСТОЯНИЕ</h3>
{% if config.robot_is_started_bool %}
<h2 class="ui center aligned icon header green">
<i class="circular play icon"></i>
Включен
</h2>
{% else %}
<h2 class="ui center aligned icon header red">
<i class="circular stop icon"></i>
Выключен
</h2>
{% endif %}
</div>
<div class="column">
<h3 class="ui center aligned icon header">ДЕЙСТВИЯ</h3>
<p class="ui center aligned"><button class="ui right labeled icon button" id="{{config.robot_key_str}}-log-btn" onclick="{{config.robot_key_str}}_logs()"><i class="right file alternate icon"></i> Скачать лог </button></p>
<p class="ui center aligned"><button class="ui right labeled icon button" id="{{config.robot_key_str}}-info-btn" onclick="{{config.robot_key_str}}_info()"><i class="right info icon"></i> Скачать инструкцию </button></p>
</div>
</div>
<div class="ui vertical divider">
</div>
</div>
{% if config.robot_is_started_bool %}
<p class="ui center aligned"><button onclick="{{config.robot_key_str}}_action_stop()" id="{{config.robot_key_str}}-action-stop" class="ui fluid right labeled icon button red"><i class="right stop icon"></i> Выключить робота </button></p>
{% else %}
<p class="ui center aligned"><button onclick="{{config.robot_key_str}}_action_start()" id="{{config.robot_key_str}}-action-start" class="ui fluid right labeled icon button green"><i class="right play icon"></i> Включить робота </button></p>
{% endif %}
<h3 class="ui center aligned icon header">ДОПОЛНИТЕЛЬНЫЕ МАТЕРИАЛЫ</h3>
<div class="ui raised segment" id="{{config.robot_key_str}}-raised-segment">
{% set additional_files = config.additional_files() %}
{% if additional_files|count > 0 %}
{% for item in additional_files %}
<div class="ui label teal">
<i class="file icon"></i> <a href="/{{config.robot_key_str}}/additional/{{item}}" download>{{item}}</a>
</div>
{% endfor %}
{% else %}
<h3>Нет доступных файлов</h3>
{% endif %}
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
// JS CODE GOES HERE
{{config.robot_key_str}}_logs = function () {
var l_now = new Date();
l_month_str = String(l_now.getMonth()+1)
if (l_month_str.length == 1){
l_month_str = "0"+l_month_str
}
l_day_str = String(l_now.getDate())
if (l_day_str.length == 1){
l_day_str = "0"+l_day_str
}
l_log_date_str = String(l_now.getFullYear())+"_"+l_month_str+"_"+l_day_str
l_log_date_str = window.prompt("Укажите дату лог файла для скачивания (формат: гггг_мм_дд)", l_log_date_str);
if (l_log_date_str != null) {
l_url_str = "/{{config.robot_key_str}}/logs/"+l_log_date_str+".log"
var link = document.createElement('a');
link.setAttribute('href', l_url_str);
link.setAttribute('download', l_log_date_str+".log");
link.click();
}
}
{{config.robot_key_str}}_info = function () {
l_url_str = "{{config.howto_url_str}}"
var link = document.createElement('a');
link.setAttribute('href', l_url_str);
link.click();
}
{{config.robot_key_str}}_action_start = function () {
$("#{{config.robot_key_str}}-action-start")[0].disabled=true
$.ajax({
type: "POST",
url: "/{{config.robot_key_str}}/action/start",
success:
function(in_settings)
{},
dataType:'json'
});
}
{{config.robot_key_str}}_action_stop = function () {
$("#{{config.robot_key_str}}-action-stop")[0].disabled=true
$.ajax({
type: "POST",
url: "/{{config.robot_key_str}}/action/stop",
success:
function(in_settings)
{},
dataType:'json'
});
}
});
</script>