forked from alsotang/goagent_monitor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index_handler.py
77 lines (65 loc) · 1.61 KB
/
index_handler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# coding: utf-8
import webapp2
from google.appengine.api import urlfetch
from google.appengine.api import memcache
from monitor_config import google_analytics_code
class IndexHandler(webapp2.RequestHandler):
def get(self, cluster_id=None):
PAGE0 = '''
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
'''
PAGE1 = '''
</title>
<style type="text/css">
<!--
.title {
color: #9F0000;
font-weight: bold;
}
.content {font-size: 15px}
body {
/*background-image: url(images/night.jpg);
background-repeat: no-repeat;
background-attachment: fixed;*/
}
-->
</style>
'''
PAGE2 = '''
</head>
<body>
<center>
<p> </p>
<form action="https://www.google.com/search"><input name="ie" type="hidden" value="UTF-8"><input name="oe" type="hidden" value="UTF-8"><input name="aq" type="hidden" value="t"><input name="rls" type="hidden" value="org.mozilla:zh-CN:official"><input name="client" type="hidden" value="firefox-a"><input name="q" type="text"><input value="谷歌搜索" type="submit"></form>
<h1>
'''
PAGE3 = '''
</h1>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<tr>
<td colspan="3" align="center" valign="top">
'''
PAGE4 = '''
</td>
</tr>
</table>
</center>
</body>
</html>
'''
name = "GoAgent流量监控器"
message = "详见:https://github.com/wwqgtxx/goagent_monitor"
PAGE = PAGE0+ name + PAGE1 + google_analytics_code + PAGE2 + name + PAGE3 + message + PAGE4
self.response.write(PAGE)
app = webapp2.WSGIApplication([
# (r'/api', ApiHandler),
(r'/', IndexHandler)
], debug=True)