0byt3m1n1
Path:
/
home
/
mgatv524
/
www
/
midiatech
/
views
/
[
Home
]
File: report-schedule-page.twig
{# /* * Xibo - Digital Signage - http://www.xibo.org.uk * Copyright (C) 2019 Xibo Signage Ltd * * This file is part of Xibo. * * Xibo is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * Xibo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Xibo. If not, see <http://www.gnu.org/licenses/>. * */ #} {% extends "authed.twig" %} {% import "inline.twig" as inline %} {% block actionMenu %} <ul class="nav nav-pills pull-right"> <li class="btn btn-success btn-xs"><a class="btns" href="{{ urlFor("stats.proofofplay.view") }}"><i class="fa fa-th-list" aria-hidden="true"></i> {% trans "Back to dashboard" %}</a></li> <li class="btn btn-info btn-xs"><a class="btns" href="{{ urlFor("savedreport.view") }}"><i class="fa fa-eye" aria-hidden="true"></i> {% trans "Saved Reports" %}</a></li> </ul> {% endblock %} {% block pageContent %} <div class="widget"> <div class="widget-title">{% trans "Report Schedule" %} <span class="fa fa-info-circle" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="{% trans "The report will be available 6AM every day." %}"></span> </div> <div class="widget-body"> <div class="XiboGrid" id="{{ random() }}" data-grid-name="reportscheduleView"> <div class="XiboFilter well"> <div class="FilterDiv" id="Filter"> <form class="form-inline"> {% set title %}{% trans "ID" %}{% endset %} {{ inline.number("reportScheduleId", title ) }} <div class="form-group "> <label class="control-label" title="" for="name" accesskey="">{% trans "Name" %}</label> <div> <div class="input-group"> <input class="form-control" name="name" type="text" id="name" value=""> <span class="input-group-addon"> <input title="{% trans "Use Regex?" %}" type="checkbox" id="useRegexForName" name="useRegexForName"> </span> </div> </div> </div> {% set title %}{% trans "Owner" %}{% endset %} {% set helpText %}{% trans "Show items owned by the selected User." %}{% endset %} {% set users = [{userId: null, userName: ""}]|merge(users) %} {{ inline.dropdown("userId", "single", title, null, users, "userId", "userName", helpText, "selectPicker", "", "", "", attributes) }} {% set title %}{% trans "Type" %}{% endset %} {% set helpText %}{% trans "Show items belong to a report." %}{% endset %} {% set reports = [{name: null, description: ""}]|merge(availableReports) %} {{ inline.dropdown("reportName", "single", title, null, reports, "name", "description", helpText, "selectPicker", "", "", "", attributes) }} {% set title %}{% trans "Only my schedules?" %}{% endset %} {{ inline.checkbox("onlyMySchedules", title, 1) }} </form> </div> </div> <div class="XiboData"> <table id="reportschedules" class="table table-striped"> <thead> <tr> <th>{% trans "Name" %}</th> <th>{% trans "Report Name" %}</th> <th>{% trans "Schedule" %}</th> <th>{% trans "Owner" %}</th> <th>{% trans "Last Run" %}</th> <th>{% trans "Next Run" %}</th> <th>{% trans "Previous Run" %}</th> <th>{% trans "Active" %}</th> <th>{% trans "Failed Message" %}</th> <th>{% trans "Created" %}</th> <th></th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> </div> {% endblock %} {% block javaScript %} <script type="text/javascript"> $(function () { $('[data-toggle="popover"]').popover(); }); var table; $(document).ready(function() { let url_string = window.location.href; let url = new URL(url_string); let reportScheduleId = url.searchParams.get("reportScheduleId"); let reportName = url.searchParams.get("reportName"); if (reportScheduleId !== undefined && reportScheduleId != null) { $('#reportScheduleId').val(reportScheduleId); } if (reportName !== undefined && reportName != null) { // Grid will be reloaded again $('#reportName').val(reportName).trigger('change'); } table = $("#reportschedules").DataTable({ "language": dataTablesLanguage, serverSide: true, stateSave: true, stateDuration: 0, stateLoadCallback: function (settings, callback) { var data = {}; $.ajax({ type: "GET", async: false, url: "{{ urlFor("user.pref") }}?preference=reportscheduleGrid", dataType: 'json', success: function (json) { try { if (json.success) { data = JSON.parse(json.data.value); } } catch (e) { // Do nothing } } }); return data; }, stateSaveCallback: function (settings, data) { $.ajax({ type: "POST", url: "{{ urlFor("user.pref") }}", data: { preference: [{ option: "reportscheduleGrid", value: JSON.stringify(data) }] } }); }, filter: false, searchDelay: 3000, "order": [[ 1, "asc"]], ajax: { "url": "{{ urlFor("reportschedule.search") }}", "data": function(d) { $.extend(d, $("#reportschedules").closest(".XiboGrid").find(".FilterDiv form").serializeObject()); } }, "columns": [ { "data": "name"}, { "data": "reportName"}, { "data": "schedule"}, { "data": "owner"}, { "data": "lastRunDt", "render": dataTableDateFromUnix }, { "orderable": false, "data": "nextRunDt", "render": dataTableDateFromUnix }, { "data": "previousRunDt", "render": dataTableDateFromUnix, "visible": false }, { "data": "isActive", "render": function (data, type, row) { if (type !== "display") return data; var icon = ""; if (data == 1) icon = "fa-check"; else icon = "fa-times"; return "<span class='fa " + icon + "' title='" + (row.isActiveDescription) + "'></span>"; }, "visible": false }, { "data": "message", "render": function (data, type, row) { if (type !== "display") return data; var icon = ""; if (data !== null) icon = "fa-exclamation-triangle"; else icon = ""; return "<span class='fa " + icon + "' title='" + (row.message) + "'></span>"; }, "visible": false }, { "data": "createdDt", "render": dataTableDateFromUnix }, { "orderable": false, "data": dataTableButtonsColumn } ] }); table.on('draw', dataTableDraw); table.on('processing.dt', dataTableProcessing); dataTableAddButtons(table, $('#reportschedules_wrapper').find('.col-sm-6').eq(1)); }) </script> {% endblock %}