.B "--json"
,
.B "--xml"
-and list outputs excluding top list.
+and list outputs.
.TP
.BI "--config " file
.B "--json"
,
.B "--xml"
-and list outputs excluding top list.
+and list outputs. The top list also requires
+.B "--begin"
+to be used at the same time with this option.
.TP
.BI "-5, --fiveminutes " [count]
.I count
parameter is used. All entries stored in the database will be shown if
.I count
-is set to 0.
+is set to 0. When used with
+.B "--begin"
+and optionally with
+.BR "--end" ,
+the list will be generated using the daily data instead of separate top entries.
+The availability of daily data defines the boundaries the date specific query
+can access.
.TP
.BI "-tr " [time]
isn't available in the database then the closest later date will be used.
.I date
supports the following formats: YYYY-MM-DD HH:MM and YYYY-MM-DD.
-This option can only be used with list outputs excluding top list.
+This option can only be used with list outputs.
.TP
.BI "-c, --cache " time
isn't available in the database then the closest earlier date will be used.
.I date
supports the following formats: YYYY-MM-DD HH:MM and YYYY-MM-DD.
-This option can only be used with list outputs excluding top list.
+This option can only be used with list outputs. The top list also requires
+.B "--begin"
+to be used at the same time with this option.
.TP
.BI "-5, --fiveminutes " [count]
.I count
parameter is used. All entries stored in the database will be shown if
.I count
-is set to 0.
+is set to 0. When used with
+.B "--begin"
+and optionally with
+.BR "--end" ,
+the list will be generated using the daily data instead of separate top entries.
+The availability of daily data defines the boundaries the date specific query
+can access.
.TP
.BI "--transparent " [enabled]
if (interface->active == 0) {
printf(" [disabled]");
}
- printf(" / %s\n\n", titlename);
+ printf(" / %s", titlename);
+
+ if (listtype == 4 && (strlen(databegin))) {
+ printf(" (%s -", databegin);
+ if (strlen(dataend)) {
+ printf(" %s)", dataend);
+ } else {
+ printf(">)");
+ }
+ }
+ printf("\n\n");
if (cfg.ostyle == 3) {
if (listtype == 4) {
}
printf("\n");
}
- if ((strlen(dataend) == 0 && datainfo.count > 0 && listtype < 4) || (strlen(dataend) > 0 && datainfo.count > 1)) {
+ if ((strlen(dataend) == 0 && datainfo.count > 0 && listtype < 4) || (strlen(dataend) > 0 && datainfo.count > 1 && listtype != 4)) {
/* use database update time for estimates */
d = localtime(&interface->updated);
if ( datalist_i->rx==0 || datalist_i->tx==0 || strlen(dataend)>0 ) {
/* note that using the linked list reverses the order */
/* most recent last in the linked list is considered the normal order */
if (strcmp(table, "top") == 0) {
- /* TODO: should data range selection be supported here? */
- sqlite3_snprintf(512, sql, "select * from (select id, strftime('%%s', date, 'utc'), rx, tx from %s where interface=%"PRId64" order by rx+tx desc %s) order by rx+tx asc;", table, (int64_t)ifaceid, limit);
+ if (strlen(dbegin)) {
+ if (resultlimit > 0) {
+ snprintf(limit, 64, "limit %"PRIu32"", resultlimit);
+ }
+ sqlite3_snprintf(512, sql, "select * from (select id, strftime('%%s', date, 'utc'), rx, tx from day where interface=%"PRId64" %s %s order by rx+tx desc %s) order by rx+tx asc;", (int64_t)ifaceid, dbegin, dend, limit);
+ } else {
+ sqlite3_snprintf(512, sql, "select * from (select id, strftime('%%s', date, 'utc'), rx, tx from top where interface=%"PRId64" order by rx+tx desc %s) order by rx+tx asc;", (int64_t)ifaceid, limit);
+ }
} else {
if (strlen(dbegin) && strlen(limit)) {
sqlite3_snprintf(512, sql, "select * from (select id, strftime('%%s', date, 'utc') as date, rx, tx from %s where interface=%"PRId64" %s %s order by date asc %s) order by date desc;", table, (int64_t)ifaceid, dbegin, dend, limit);
rowcount += datainfo.count;
width = 500;
- if (listtype >= 4 && (datainfo.count < 2 || strlen(ic->dataend) == 0)) { // less space needed when no estimate or sum is shown
+ if (listtype >= 4 && (datainfo.count < 2 || strlen(ic->dataend) == 0 || listtype == 4)) { // less space needed when no estimate or sum is shown
height = 86;
offsety = -16;
} else {
gdImageLine(ic->im, textx+2, texty+5, textx+296+offsetx, texty+5, ic->cline);
}
- if ((strlen(ic->dataend) == 0 && datainfo.count > 0 && listtype < 4) || (strlen(ic->dataend) > 0 && datainfo.count > 1)) {
+ if ((strlen(ic->dataend) == 0 && datainfo.count > 0 && listtype < 4) || (strlen(ic->dataend) > 0 && datainfo.count > 1 && listtype != 4)) {
d = localtime(&ic->interface.updated);
if ( datalist_i->rx==0 || datalist_i->tx==0 || strlen(ic->dataend)>0) {