Commit d437e359 authored by Adam Rambousek's avatar Adam Rambousek
Browse files

fix #156 statistiky

parent 81f26498
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -152,7 +152,7 @@ LogSeparator=" "
# Example: "ftp.domain.com"
# Example: "ftp.domain.com"
# Example: "domain.com"
# Example: "domain.com"
#
#
SiteDomain="tecu public21-188.cloud.ics.muni.cz:8040 localhost:3000"
SiteDomain="tezaurus"




# Enter here all other possible domain names, addresses or virtual host
# Enter here all other possible domain names, addresses or virtual host
@@ -167,7 +167,7 @@ SiteDomain="tecu public21-188.cloud.ics.muni.cz:8040 localhost:3000"
# Note: You can also use @/mypath/myfile if list of aliases are in a file.
# Note: You can also use @/mypath/myfile if list of aliases are in a file.
# Example: "www.myserver.com localhost 127.0.0.1 REGEX[mydomain\.(net|org)$]"
# Example: "www.myserver.com localhost 127.0.0.1 REGEX[mydomain\.(net|org)$]"
#
#
HostAliases="tecu public21-188.cloud.ics.muni.cz 147.251.21.188"
HostAliases=""




# If you want to have hosts reported by name instead of ip address, AWStats
# If you want to have hosts reported by name instead of ip address, AWStats
+47 −0
Original line number Original line Diff line number Diff line
<!doctype html>
<html lang="cz">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Podrobné statistiky</title>
<style>
html, body {height:100%;}
body {margin:0}
</style>
</head>
<body>
Podrobné statistiky pro měsíc: <select name="month" id="month">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select> <select name="year" id="year"></select> <button id="submit" onclick="showstat()">zobrazit</button>
<br/>
<iframe id="stat" style="width:99%;border:none;height:95%;display:block;">
</iframe>
<script type="text/javascript">
var today = new Date();
var year = today.getFullYear();
var sel = document.getElementById('year');
for (var i = 2020; i<=year; i++) {
  var opt = document.createElement('option');
  opt.appendChild(document.createTextNode(i));
  opt.value = i;
  sel.appendChild(opt);
}

function showstat() {
  var year = document.getElementById('year').value;
  var mon = document.getElementById('month').value;
  var url = '/tecu?action=fullstat&year='+year+'&month='+mon;
  document.getElementById('stat').src = url;
}
</script>
</body></html>
+32 −25
Original line number Original line Diff line number Diff line
@@ -2193,6 +2193,13 @@ def do_GET(request, response)
        $stderr.puts e.backtrace
        $stderr.puts e.backtrace
      end
      end
      response.set_redirect(WEBrick::HTTPStatus::TemporaryRedirect, '/tezaurus/deletedTerms')
      response.set_redirect(WEBrick::HTTPStatus::TemporaryRedirect, '/tezaurus/deletedTerms')
    when 'fullstat'
      result = ''
      if request.query['year'].to_s != '' and request.query['month'].to_s != ''
        result = `/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -staticlinks -month=#{request.query['month'].to_s} -year=#{request.query['year'].to_s} -output -config=tecu -configdir=/var/lib/deb-server/files/tecu/stats`
      end
      response.body = result
      response['Content-Type'] = 'text/html; charset=utf-8'
    end
    end
  end
  end