projects
/
squid-reports.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eff4ed4
)
Отслеживание даты начала данных в БД.
master
author
Roman Bazalevsky
<rvb@rvb.name>
Mon, 16 Dec 2019 09:53:04 +0000
(12:53 +0300)
committer
Roman Bazalevsky
<rvb@rvb.name>
Mon, 16 Dec 2019 09:53:04 +0000
(12:53 +0300)
web/api.php
patch
|
blob
|
history
web/squid.js
patch
|
blob
|
history
diff --git
a/web/api.php
b/web/api.php
index 4da8707b54134d0533794522845713cc9cc09de9..dbb7100e6a34ef9cd7758596853e8a366675d925 100644
(file)
--- a/
web/api.php
+++ b/
web/api.php
@@
-61,6
+61,8
@@
$data["site-header"] = $site_header;
connect_db();
$data["site-header"] = $site_header;
connect_db();
+
+ $startdate = exec_query("select min(access_date) sd from access_log");
$cats = exec_query("select mnemo,name,description from rep_cat");
$cats = exec_query("select mnemo,name,description from rep_cat");
@@
-80,6
+82,7
@@
$data["dictionaries"] = Array( "user_id" => $users, "host_id" => $hosts);
$data["online_refresh"] = $online_refresh;
$data["online_history"] = $online_history;
$data["dictionaries"] = Array( "user_id" => $users, "host_id" => $hosts);
$data["online_refresh"] = $online_refresh;
$data["online_history"] = $online_history;
+ $data["start_date"] = $startdate[0]["sd"];
break;
break;
diff --git
a/web/squid.js
b/web/squid.js
index 0260b100f068e4d6333a41b41f81e565a5f09b19..8c85cca80d44497397d0bb22cf06987ac18cbf05 100644
(file)
--- a/
web/squid.js
+++ b/
web/squid.js
@@
-33,6
+33,7
@@
online_connections = null
online_hosts = []
timer = null
online_hosts = []
timer = null
+start_date = null
assigned_colors = []
assigned_colors = []
@@
-144,6
+145,9
@@
function UpdatePageProps(props) {
refresh = props["online_refresh"]
online_history = props["online_history"]
refresh = props["online_refresh"]
online_history = props["online_history"]
+ start_date = new Date(props["start_date"])
+ start_date.setHours(0,0,0,0)
+
cats = props["cats"]
for (var i in res["columns"]) {
cats = props["cats"]
for (var i in res["columns"]) {
@@
-653,6
+657,12
@@
function DateLeft() {
var delta = Math.round(((dTo.getTime() - dFrom.getTime()))/(86400*1000))
dTo.setDate(dTo.getDate() - (1 + delta))
dFrom.setDate(dFrom.getDate() - (1 + delta))
var delta = Math.round(((dTo.getTime() - dFrom.getTime()))/(86400*1000))
dTo.setDate(dTo.getDate() - (1 + delta))
dFrom.setDate(dFrom.getDate() - (1 + delta))
+ if (dTo<start_date) {
+ dTo = start_date
+ }
+ if (dFrom<start_date) {
+ dFrom = start_date
+ }
date_from = toDate(dFrom)
date_to = toDate(dTo)
SetDates()
date_from = toDate(dFrom)
date_to = toDate(dTo)
SetDates()