update : 22.01.2025 15:12:10,27
This commit is contained in:
parent
2ec34bce5d
commit
77915757fd
@ -262,7 +262,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="id_seism_pass_sigi" class="col-sm-1 col-form-label">Пароль : </label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="seism_pass_sigi" value='{{seism_pass_sigi}}' placeholder='' class="form-control" autofocus="" id="id_seism_pass_sigi">
|
||||
<input type="password" name="seism_pass_sigi" value='{{seism_pass_sigi}}' placeholder='' class="form-control" autofocus="" id="id_seism_pass_sigi">
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.card-body -->
|
||||
@ -316,7 +316,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="id_gtopass" class="col-sm-1 col-form-label">Пароль : </label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="gtopass" value='{{gtopass}}' form="oset_save" placeholder='Пароль' class="form-control" autofocus="" id="id_gtopass">
|
||||
<input type="password" name="gtopass" value='{{gtopass}}' form="oset_save" placeholder='Пароль' class="form-control" autofocus="" id="id_gtopass">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
@ -403,7 +403,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="id_wpass" class="col-sm-1 col-form-label">Пароль : </label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="wpass" value='{{wpass}}' placeholder='Пароль' class="form-control" autofocus="" id="id_wpass">
|
||||
<input type="password" name="wpass" value='{{wpass}}' placeholder='Пароль' class="form-control" autofocus="" id="id_wpass">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
@ -458,7 +458,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="id_plapass" class="col-sm-1 col-form-label">Пароль : </label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" name="plapass" value='{{plapass}}' placeholder='Пароль' class="form-control" autofocus="" id="id_plapass">
|
||||
<input type="password" name="plapass" value='{{plapass}}' placeholder='Пароль' class="form-control" autofocus="" id="id_plapass">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
|
||||
@ -4,7 +4,13 @@
|
||||
|
||||
|
||||
{% block header_link %}
|
||||
<link type="text/css" rel="stylesheet" href="{% static '/css/speedometer.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<!-- daterange picker -->
|
||||
<link rel="stylesheet" href="{% static 'lte/plugins/daterangepicker/daterangepicker.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
|
||||
<!-- Select2 -->
|
||||
<link rel="stylesheet" href="{% static 'lte/plugins/select2/css/select2.min.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<link rel="stylesheet" href="{% static 'lte/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
|
||||
{% endblock header_link %}
|
||||
|
||||
{% block info_title %}
|
||||
@ -39,11 +45,13 @@
|
||||
{% if not user.profile.isredonly %}
|
||||
<a href="../seismicproc/add/" type="button" class="btn bg-gradient-primary float-left" style="margin-right:20px;">Добавить</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'unload' %}" class="btn btn-primary">Выгрузка в CSV</a>
|
||||
<button type="button" onclick="showsettings()" class="btn btn-primary" style="margin-right:20px;">Отбор</button>
|
||||
<button onclick="download()" class="btn btn-primary" style="margin-right:20px;">Выгрузка в CSV</button>
|
||||
|
||||
</div>
|
||||
{% block pagination %}
|
||||
{% if is_paginated %}
|
||||
<div class="row">
|
||||
<div class="card-tools">
|
||||
<ul class="pagination pagination no-margin text-sm">
|
||||
{% if 1 < start_page_list %}
|
||||
<li class="paginate_button page-item" id="mypaginator_next">
|
||||
@ -172,38 +180,85 @@
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="content text-sm">
|
||||
<div class="container-fluid ">
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="modal-default">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Отбор</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- Date range -->
|
||||
<div class="form-group">
|
||||
<label>Период:</label>
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" class="form-control float-right" id="daterange">
|
||||
</div>
|
||||
<!-- /.input group -->
|
||||
</div>
|
||||
<!-- /.form group -->
|
||||
<div class="form-group">
|
||||
<label>Источник</label>
|
||||
<select id="source" class="select2" multiple="multiple" data-placeholder="Select a State" style="width: 100%;">
|
||||
<option value="АСФ ГС СО РАН" >АСФ ГС СО РАН</option>
|
||||
<option value="gsras" >GRAS</option>
|
||||
<option value="SIGI" >SIGI</option>
|
||||
<option value="usgs" >USGS</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<!-- /.form-group -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" onclick="cancelparametrs()" class="btn btn-default">Отмена</button>
|
||||
<button type="button" onclick="showparametrs()" class="btn btn-success">Принять</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block script_footer %}
|
||||
<script src="{% static 'js/gauge.min.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<script src="{% static 'js/speedometer.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
<!-- date-range-picker -->
|
||||
<script src="{% static 'lte/plugins/daterangepicker/daterangepicker.js' %}?ver={% settings_value 'APP_VER' %}"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
/* $("#id_table").DataTable({
|
||||
"responsive": true,
|
||||
"lengthChange": false,
|
||||
"autoWidth": false,
|
||||
"searching": false,
|
||||
"paging": false,
|
||||
"info": false,
|
||||
|
||||
"buttons": [
|
||||
"excel",
|
||||
"pdf",
|
||||
"print","copyHtml5"],
|
||||
|
||||
}).buttons().container().appendTo('#id_table_wrapper .col-md-6:eq(0)');
|
||||
*/
|
||||
|
||||
$('.datepick').daterangepicker({
|
||||
$('#daterange').daterangepicker({
|
||||
showDropdowns: true,
|
||||
timePicker: false,
|
||||
timePickerIncrement: 5,
|
||||
timePicker24Hour: true,
|
||||
drops: "auto",
|
||||
singleDatePicker: true,
|
||||
startDate:new Date(2025, 0, 1),
|
||||
timePicker: false,
|
||||
lang: 'ru',
|
||||
locale: {
|
||||
@ -249,51 +304,90 @@
|
||||
|
||||
});
|
||||
|
||||
function reportshow() {
|
||||
var DataStart = $("#id_datestart").val();
|
||||
var DataStop = $("#id_datestop").val();
|
||||
if (DataStart.trim() == "") {
|
||||
$("#id_datestart").css('border', "3px solid #80bdff").focus();
|
||||
return false;
|
||||
} else {
|
||||
$("#id_datestart").css('border', "1px solid rgb(206, 212, 218)");
|
||||
}
|
||||
if (DataStop.trim() == "") {
|
||||
$("#id_datestop").css('border', "3px solid #80bdff").focus();
|
||||
return false;
|
||||
} else {
|
||||
$("#id_datestop").css('border', "1px solid rgb(206, 212, 218)");
|
||||
}
|
||||
|
||||
if (!!DataStart) {
|
||||
$("#reportPanelBody").html('<div class="overlay"><i class="fas fa-3x fa-sync-alt fa-spin"></i></div>')
|
||||
$.ajax({
|
||||
type: 'POST', // метод отправки
|
||||
url: window.location.pathname+'?name=reportvalue',
|
||||
data: {
|
||||
"DataStart": DataStart,
|
||||
"DataStop": DataStop,
|
||||
"metod": 'create',
|
||||
},
|
||||
success: function (data) {
|
||||
$('#card_param').CardWidget('collapse')
|
||||
document.getElementById('reportPanel').style.height = '';
|
||||
$("#reportPanelBody").html(data); // при успешном получении ответа от сервера, заносим полученные данные в элемент с классом answer
|
||||
|
||||
|
||||
},
|
||||
error: function (dataerr) {
|
||||
$("#reportPanelBody").html(dataerr); // при успешном получении ответа от сервера, заносим полученные данные в элемент с классом answer
|
||||
|
||||
},
|
||||
timeout: 60000 // sets timeout to 3 seconds
|
||||
function findGetParameter(parameterName) {
|
||||
var result = null,
|
||||
tmp = [];
|
||||
location.search
|
||||
.substr(1)
|
||||
.split("&")
|
||||
.forEach(function (item) {
|
||||
tmp = item.split("=");
|
||||
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function showsettings() {
|
||||
var date_start = findGetParameter('date_start')
|
||||
if (date_start != null) {
|
||||
$("#daterange").data('daterangepicker').setStartDate(date_start)
|
||||
}
|
||||
var date_end = findGetParameter('date_end')
|
||||
if (date_end != null) {
|
||||
$("#daterange").data('daterangepicker').setEndDate(date_end)
|
||||
}
|
||||
var source = findGetParameter('source')
|
||||
if (source != null) {
|
||||
$('#source').select2().val(source.split(',')).trigger("change");
|
||||
}
|
||||
console.log(source)
|
||||
$('#modal-default').modal()
|
||||
$('#modal-default').modal({ keyboard: false })
|
||||
$('#modal-default').modal('show')
|
||||
|
||||
}
|
||||
function cancel() {
|
||||
document.location.href = "/geoproc/";
|
||||
|
||||
|
||||
function showparametrs() {
|
||||
$('#modal-default').modal('hide')
|
||||
var DataStart = $("#daterange").data('daterangepicker').startDate._d;
|
||||
var DataStop = $("#daterange").data('daterangepicker').endDate._d;
|
||||
var x = 0
|
||||
var id_source = $("#source").select2('data');
|
||||
sources = []
|
||||
sources_name = "Источники : "
|
||||
for (var i = 0; i < id_source.length; i++) {
|
||||
sources.push(id_source[i].id)
|
||||
//sources = sources + "," + id_source[i].id
|
||||
sources_name = sources_name + "," + id_source[i].text
|
||||
x++
|
||||
}
|
||||
query = 'date_start='+DataStart.toLocaleString()+"&date_end="+DataStop.toLocaleString();
|
||||
if (sources != "")
|
||||
{
|
||||
query=query+ '&source='+sources;
|
||||
}
|
||||
window.location.search = query
|
||||
|
||||
}
|
||||
|
||||
function download() {
|
||||
$('#modal-default').modal('hide')
|
||||
var DataStart = $("#daterange").data('daterangepicker').startDate._d;
|
||||
var DataStop = $("#daterange").data('daterangepicker').endDate._d;
|
||||
var x = 0
|
||||
var id_source = $("#source").select2('data');
|
||||
sources = []
|
||||
sources_name = "Источники : "
|
||||
for (var i = 0; i < id_source.length; i++) {
|
||||
sources.push(id_source[i].id)
|
||||
//sources = sources + "," + id_source[i].id
|
||||
sources_name = sources_name + "," + id_source[i].text
|
||||
x++
|
||||
}
|
||||
query = 'unload/?date_start='+DataStart.toLocaleString()+"&date_end="+DataStop.toLocaleString();
|
||||
if (sources != "")
|
||||
{
|
||||
query=query+ '&source='+sources;
|
||||
}
|
||||
window.location.href = query
|
||||
|
||||
}
|
||||
|
||||
|
||||
function cancelparametrs() {
|
||||
window.location.search = "";
|
||||
}
|
||||
|
||||
function CallPrint(strid) {
|
||||
@ -308,6 +402,7 @@
|
||||
WinPrint.close();
|
||||
prtContent.innerHTML = strOldOne;
|
||||
}
|
||||
</script>
|
||||
|
||||
</script>
|
||||
{% endblock script_footer %}
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import datetime
|
||||
import math
|
||||
import traceback
|
||||
import os
|
||||
import io
|
||||
import json
|
||||
|
||||
|
||||
from datetime import datetime,timedelta
|
||||
from django.shortcuts import render
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.views.decorators.cache import never_cache
|
||||
from django.shortcuts import redirect
|
||||
from django.db.models import Q
|
||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
@ -89,10 +89,20 @@ def seismicproc_delete(request):
|
||||
@never_cache
|
||||
def main_index(request):
|
||||
try:
|
||||
param=request.GET.dict()
|
||||
catalog_list=Earthquake.objects.order_by("-date_time").all()
|
||||
get_param=request.GET.dict()
|
||||
print(get_param)
|
||||
myquery = Q()
|
||||
if 'date_start' in get_param:
|
||||
date_start = datetime.strptime(get_param['date_start'], "%d.%m.%Y, %H:%M:%S")
|
||||
date_end = datetime.strptime(get_param['date_end'], "%d.%m.%Y, %H:%M:%S")
|
||||
myquery &= Q(date_time__range=[date_start,date_end])
|
||||
if 'source' in get_param:
|
||||
source = get_param['source'].split(',')
|
||||
print(source)
|
||||
myquery &= Q(source__in=source)
|
||||
catalog_list=Earthquake.objects.filter(myquery).order_by("-date_time").all()
|
||||
catalog_count = catalog_list.count()
|
||||
paginator = Paginator(catalog_list, 50)
|
||||
paginator = Paginator(catalog_list, 30)
|
||||
page_number = request.GET.get('page',1)
|
||||
page=paginator.get_page(page_number)
|
||||
num_pages=page.paginator.num_pages
|
||||
@ -138,7 +148,7 @@ def main_index(request):
|
||||
|
||||
def earthquake_list(request):
|
||||
try:
|
||||
two_days_ago = datetime.datetime.now() - datetime.timedelta(days=2)
|
||||
two_days_ago = datetime.now() - timedelta(days=2)
|
||||
earthquakes = (Earthquake.objects.
|
||||
filter(date_time__gt=two_days_ago).
|
||||
order_by("-date_time").
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
import csv
|
||||
|
||||
|
||||
from datetime import datetime,timedelta
|
||||
from django.http import StreamingHttpResponse
|
||||
from django.db.models import Q
|
||||
|
||||
from apps.seismicproc.models.model_earthquake import Earthquake
|
||||
|
||||
@ -12,7 +15,18 @@ class Echo:
|
||||
|
||||
|
||||
def dump_to_csv(request):
|
||||
rows = list(Earthquake.objects.order_by("-date_time").all().values_list(
|
||||
get_param=request.GET.dict()
|
||||
print(get_param)
|
||||
myquery = Q()
|
||||
if 'date_start' in get_param:
|
||||
date_start = datetime.strptime(get_param['date_start'], "%d.%m.%Y, %H:%M:%S")
|
||||
date_end = datetime.strptime(get_param['date_end'], "%d.%m.%Y, %H:%M:%S")
|
||||
myquery &= Q(date_time__range=[date_start,date_end])
|
||||
if 'source' in get_param:
|
||||
source = get_param['source'].split(',')
|
||||
myquery &= Q(source__in=source)
|
||||
|
||||
rows = list(Earthquake.objects.filter(myquery).order_by("-date_time").all().values_list(
|
||||
"date_time",
|
||||
"latitude",
|
||||
"longitude",
|
||||
@ -21,7 +35,6 @@ def dump_to_csv(request):
|
||||
"region",
|
||||
"source",
|
||||
))
|
||||
|
||||
pseudo_buffer = Echo()
|
||||
writer = csv.writer(pseudo_buffer, delimiter=';')
|
||||
rows.insert(0, (
|
||||
|
||||
5
update_info.json
Normal file
5
update_info.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": "1.0.06.1",
|
||||
"date_release": "2025-01-22",
|
||||
"description": ""
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user