update : 07.07.2025 15:18:20,19

This commit is contained in:
Sabron 2025-07-07 15:18:20 +07:00
parent 09b76d7be6
commit 6b7e4d9f01
6 changed files with 330 additions and 46 deletions

View File

@ -100,11 +100,11 @@
</div>
</div> <!-- /.row -->
<div class="col-md-10">
<div class="card card-primary card-outline">
<div class="card card-primary card-outline" style="height: 88vh;">
<div class="card-header">
<h3 class="card-title">Горнотранспортное оборудование</h3>
</div>
<div class="card-body table-responsive p-0" style="height: 88vh; padding-left: 0;">
<div class="card-body table-responsive p-0" style="padding-left: 0;">
<table id="id_table" class="table table-bordered table-hover table-head-fixed text-nowrap">
<thead>
<tr role="row">
@ -132,23 +132,84 @@
{% endif %}
"
>
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
<i class="fas fa-info"></i>
</a>
</td>
<td style="width: 15px;">
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
{{ catalog.date_time }}
</a>
</td>
<td>
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
{{ catalog.text_event }}
</a>
</td>
</tr>
<div class="modal fade" id="modal-edit_{{catalog.id}}">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" {% if catalog.level_event > 2 %} style="background-color:red;" {%endif%} >
<h4 class="modal-title" >Дата события : {{ catalog.date_time }} </h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Уровень : </label>
<div class="col-sm-9">
{% if catalog.level_event == 0 %}
<input class="form-control" type="text" readonly value="Информация">
{% elif catalog.level_event == 1 %}
<input class="form-control" type="text" readonly value="Предупреждение">
{% elif catalog.level_event == 2 %}
<input class="form-control" type="text" readonly value="Ошибка">
{% elif catalog.level_event == 3 %}
<input class="form-control" type="text" readonly value="Критическое">
{% elif catalog.level_event == 4 %}
<input class="form-control" type="text" readonly value="Авария">
{% endif %}
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Источник : </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="Горнотранспортное оборудование">
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Время получения: </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="{{ catalog.date_time}}">
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Время прочтения: </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="{{ catalog.read_date_time}}">
</div>
</div>
<div class="form-group row">
<label for="id_audio_file" class="col-sm-3 col-form-label">Подробности: </label>
<div class="col-sm-9">
<textarea class="form-control" disabled="">{{catalog.text_event}}</textarea>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
{% endfor %}
{% endif %}
</tbody>

View File

@ -100,11 +100,11 @@
</div>
</div> <!-- /.row -->
<div class="col-md-10">
<div class="card card-primary card-outline">
<div class="card card-primary card-outline" style="height: 88vh;">
<div class="card-header">
<h3 class="card-title">Прочие</h3>
</div>
<div class="card-body table-responsive p-0" style="height: 88vh; padding-left: 0;">
<div class="card-body table-responsive p-0" style="padding-left: 0;">
<table id="id_table" class="table table-bordered table-hover table-head-fixed text-nowrap">
<thead>
<tr role="row">
@ -131,24 +131,84 @@
{% endif %}
"
>
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
<i class="fas fa-info"></i>
</a>
</td>
<td style="width: 15px;">
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
{{ catalog.date_time }}
</a>
</td>
<td>
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
{{ catalog.text_event }}
</a>
</td>
</tr>
{% endfor %}
<div class="modal fade" id="modal-edit_{{catalog.id}}">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" {% if catalog.level_event > 2 %} style="background-color:red;" {%endif%} >
<h4 class="modal-title" >Дата события : {{ catalog.date_time }} </h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Уровень : </label>
<div class="col-sm-9">
{% if catalog.level_event == 0 %}
<input class="form-control" type="text" readonly value="Информация">
{% elif catalog.level_event == 1 %}
<input class="form-control" type="text" readonly value="Предупреждение">
{% elif catalog.level_event == 2 %}
<input class="form-control" type="text" readonly value="Ошибка">
{% elif catalog.level_event == 3 %}
<input class="form-control" type="text" readonly value="Критическое">
{% elif catalog.level_event == 4 %}
<input class="form-control" type="text" readonly value="Авария">
{% endif %}
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Источник : </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="Прочие">
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Время получения: </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="{{ catalog.date_time}}">
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Время прочтения: </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="{{ catalog.read_date_time}}">
</div>
</div>
<div class="form-group row">
<label for="id_audio_file" class="col-sm-3 col-form-label">Подробности: </label>
<div class="col-sm-9">
<textarea class="form-control" disabled="">{{catalog.text_event}}</textarea>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div> {% endfor %}
{% endif %}
</tbody>
</table>

View File

@ -57,7 +57,7 @@
<div class="container-fluid ">
<div class="row">
<div class="col-md-2">
<div class="card card-primary card-outline card-tabs" style="height: 88vh;">
<div class="card card-primary card-outline" style="height: 88vh;">
<div class="card-header">
<h3 class="card-title">Журналы событий</h3>
</div>
@ -100,11 +100,11 @@
</div>
</div> <!-- /.row -->
<div class="col-md-10">
<div class="card card-primary card-outline">
<div class="card card-primary card-outline" style="height: 88vh;">
<div class="card-header">
<h3 class="card-title">Системные события</h3>
</div>
<div class="card-body table-responsive p-0" style="height: 88vh; padding-left: 0;">
<div class="card-body table-responsive p-0" style="padding-left: 0;">
<table id="id_table" class="table table-bordered table-hover table-head-fixed text-nowrap">
<thead>
<tr role="row">
@ -127,23 +127,83 @@
{% endif %}
"
>
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
<i class="fas fa-info"></i>
</a>
</td>
<td style="width: 15px;">
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
{{ catalog.date_time }}
</a>
</td>
<td>
<a href="?id={{catalog.id}}">
{{ catalog.text_event }}
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
{{ catalog.text_event }}
</a>
</td>
</tr>
<div class="modal fade" id="modal-edit_{{catalog.id}}">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" {% if catalog.level_event > 2 %} style="background-color:red;" {%endif%} >
<h4 class="modal-title" >Дата события : {{ catalog.date_time }} </h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Уровень : </label>
<div class="col-sm-9">
{% if catalog.level_event == 0 %}
<input class="form-control" type="text" readonly value="Информация">
{% elif catalog.level_event == 1 %}
<input class="form-control" type="text" readonly value="Предупреждение">
{% elif catalog.level_event == 2 %}
<input class="form-control" type="text" readonly value="Ошибка">
{% elif catalog.level_event == 3 %}
<input class="form-control" type="text" readonly value="Критическое">
{% elif catalog.level_event == 4 %}
<input class="form-control" type="text" readonly value="Авария">
{% endif %}
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Источник : </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="Система">
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Время получения: </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="{{ catalog.date_time}}">
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Время прочтения: </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="{{ catalog.read_date_time}}">
</div>
</div>
<div class="form-group row">
<label for="id_audio_file" class="col-sm-3 col-form-label">Подробности: </label>
<div class="col-sm-9">
<textarea class="form-control" disabled="">{{catalog.text_event}}</textarea>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
{% endfor %}
{% endif %}
</tbody>
@ -155,6 +215,8 @@
</div>
</section>
{% endblock %}
{% block script_footer %}

View File

@ -100,11 +100,11 @@
</div>
</div> <!-- /.row -->
<div class="col-md-10">
<div class="card card-primary card-outline">
<div class="card card-primary card-outline" style="height: 88vh;">
<div class="card-header">
<h3 class="card-title">Персонал</h3>
</div>
<div class="card-body table-responsive p-0" style="height: 88vh; padding-left: 0;">
<div class="card-body table-responsive p-0" style="padding-left: 0;">
<table id="id_table" class="table table-bordered table-hover table-head-fixed text-nowrap">
<thead>
<tr role="row">
@ -131,23 +131,84 @@
{% endif %}
"
>
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
<i class="fas fa-info"></i>
</a>
</td>
<td style="width: 15px;">
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
{{ catalog.date_time }}
</a>
</td>
<td>
<a href="?id={{catalog.id}}">
<a class="action-form" data-target="#modal-edit_{{catalog.id}}" data-toggle="modal" style="cursor:pointer;">
{{ catalog.text_event }}
</a>
</td>
</tr>
<div class="modal fade" id="modal-edit_{{catalog.id}}">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" {% if catalog.level_event > 2 %} style="background-color:red;" {%endif%} >
<h4 class="modal-title" >Дата события : {{ catalog.date_time }} </h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Уровень : </label>
<div class="col-sm-9">
{% if catalog.level_event == 0 %}
<input class="form-control" type="text" readonly value="Информация">
{% elif catalog.level_event == 1 %}
<input class="form-control" type="text" readonly value="Предупреждение">
{% elif catalog.level_event == 2 %}
<input class="form-control" type="text" readonly value="Ошибка">
{% elif catalog.level_event == 3 %}
<input class="form-control" type="text" readonly value="Критическое">
{% elif catalog.level_event == 4 %}
<input class="form-control" type="text" readonly value="Авария">
{% endif %}
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Источник : </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="Персонал">
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Время получения: </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="{{ catalog.date_time}}">
</div>
</div>
<div class="form-group row">
<label for="id_name" class="col-sm-3 col-form-label">Время прочтения: </label>
<div class="col-sm-9">
<input class="form-control" type="text" readonly value="{{ catalog.read_date_time}}">
</div>
</div>
<div class="form-group row">
<label for="id_audio_file" class="col-sm-3 col-form-label">Подробности: </label>
<div class="col-sm-9">
<textarea class="form-control" disabled="">{{catalog.text_event}}</textarea>
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
{% endfor %}
{% endif %}
</tbody>

View File

@ -127,12 +127,17 @@ def load_usgs(**kwargs):
source="usgs",
)
eventsmodule.write_events(
level_event = 1,
section = 10,
level_event = settings.EVENT_LEVEL_WARNING,
section = settings.EVENT_SECTION_OTHERS,
text_event = f'Землятрясение в точке "{region}" , источник usgs'
)
except Exception as err:
eventsmodule.write_events(
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_OTHERS,
text_event = f'Ошибка синхронизации с системой "usgs"'
)
logging.error(traceback.format_exc())
@ -195,8 +200,8 @@ def load_seishub(**kwargs):
source="АСФ ГС СО РАН",
)
eventsmodule.write_events(
level_event = 1,
section = 10,
level_event = settings.EVEEVENT_LEVEL_WARNING,
section = settings.EVENT_SECTION_OTHERS,
text_event = f'Землятрясение в точке "{region}" , источник АСФ ГС СО РАН'
)
@ -238,6 +243,11 @@ def load_seishub(**kwargs):
region_str = region_str + my_var
except Exception as err:
eventsmodule.write_events(
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_OTHERS,
text_event = f'Ошибка синхронизации с системой "АСФ ГС СО РАН"'
)
logging.error(traceback.format_exc())
@ -277,13 +287,18 @@ def load_gsras(**kwargs):
source="gsras",
)
eventsmodule.write_events(
level_event = 1,
section = 10,
level_event = settings.EVENT_LEVEL_WARNING,
section = settings.EVENT_SECTION_OTHERS,
text_event = f'Землятрясение в точке "{cols[9].text.strip()}" , источник gsras'
)
except Exception as err:
eventsmodule.write_events(
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_OTHERS,
text_event = f'Ошибка синхронизации с системой "gsras"'
)
logging.error(traceback.format_exc())
logging.error(cols)
logging.error(
@ -336,8 +351,8 @@ def load_sigi(**kwargs):
source="SIGI",
)
eventsmodule.write_events(
level_event = 1,
section = 10,
level_event = settings.EVENT_LEVEL_WARNING,
section = settings.EVENT_SECTION_OTHERS,
text_event = f'Землятрясение в точке "{info}" , источник SIGI'
)
@ -348,6 +363,11 @@ def load_sigi(**kwargs):
earthquake.save()
except Exception as err:
eventsmodule.write_events(
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_OTHERS,
text_event = f'Ошибка синхронизации с системой "SIGI"'
)
logging.error(traceback.format_exc())
logging.error(data)
@ -358,7 +378,7 @@ def load_earthquake():
if manage !=ino:
settingsmodule.set_settings('manage_lic', 'Неправомерное использование программного продукта. Вы стали жертвой подделки программного обеспечения')
eventsmodule.write_system(
level_event = 3,
level_event = settings.EVENT_LEVEL_CRITICAL,
text_event= f"Неправомерное использование программного продукта. Вы стали жертвой подделки программного обеспечения"
)
return
@ -492,8 +512,8 @@ def load_asc(): #
except Exception as err:
eventsmodule.write_events(
level_event = 2,
section = 1,
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_GTO,
text_event = f'Ошибка синхронизации с АСК'
)
logging.error(traceback.format_exc())
@ -632,8 +652,8 @@ def load_edds():
return None
except Exception as err:
eventsmodule.write_events(
level_event = 2,
section = 1,
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_GTO,
text_event = f'Ошибка синхронизации с ЕДДС'
)
logging.error(traceback.format_exc())
@ -743,8 +763,8 @@ def load_sotekom():
return None
except Exception as err:
eventsmodule.write_events(
level_event = 2,
section = 1,
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_GTO,
text_event = f'Ошибка синхронизации с СоюзТехноКом'
)
logging.error(traceback.format_exc())
@ -877,8 +897,8 @@ def load_asd():
return None
except Exception as err:
eventsmodule.write_events(
level_event = 2,
section = 1,
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_GTO,
text_event = f'Ошибка синхронизации с АСД "Карьер"'
)
logging.error(traceback.format_exc())
@ -977,10 +997,15 @@ def load_hetonis():
update_time = datetime.now()
)
else:
if data['online'] =='1':
worker.update_time = datetime.now()
worker.name = data['name']
worker.active = True
if data['online'] =='1':
worker.update_time = datetime.now()
worker.active = True
else:
worker.active = False
worker.save()
continue
response_worker=session.get(f"{wadress}/findIdPerson/?id={data['id']}",headers = Headers, verify=False)
if response_worker.status_code == 200:
data_worker = response_worker.json()
@ -1001,8 +1026,8 @@ def load_hetonis():
session.close()
except Exception as err:
eventsmodule.write_events(
level_event = 2,
section = 2,
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_WORKERS,
text_event = f'Ошибка интеграции с системой HETONIS'
)
logging.error(traceback.format_exc())
@ -1013,7 +1038,7 @@ def load_navigation():
if manage !=ino:
settingsmodule.set_settings('manage_lic', 'Неправомерное использование программного продукта. Вы стали жертвой подделки программного обеспечения')
eventsmodule.write_system(
level_event = 3,
level_event = settings.EVENT_LEVEL_CRITICAL,
text_event= f"Неправомерное использование программного продукта. Вы стали жертвой подделки программного обеспечения"
)
return
@ -1091,6 +1116,11 @@ def test_circuit():
earthquake.date_time = timezone.now()
earthquake.save()
except Exception:
eventsmodule.write_events(
level_event = settings.EVENT_LEVEL_ERROR,
section = settings.EVENT_SECTION_WORKERS,
text_event = f'Ошибка синхронизации с системой "RadiusAPI"'
)
logging.error(traceback.format_exc())

View File

@ -14,6 +14,16 @@ SECTION_LIST = (
(10, "Прочие"),
)
EVENT_LEVEL_INFORMATION = 0 # Информация
EVENT_LEVEL_WARNING = 1 # Предупреждение
EVENT_LEVEL_ERROR = 2 # Ошибка
EVENT_LEVEL_CRITICAL = 3, # Критическое
EVENT_LEVEL_CRASH = 4 # Авария,
EVENT_SECTION_SYSTEM = 0 # Система
EVENT_SECTION_GTO = 1 # Горнотранспортное оборудование
EVENT_SECTION_WORKERS = 2 # Персонал
EVENT_SECTION_OTHERS= 10 # Прочие
LANGUAGE_CODE = "ru"
TIME_ZONE = "Asia/Krasnoyarsk"