Permalink
Browse files

1.03, admin: database size, log size

  • Loading branch information...
1 parent c676f15 commit 987b4dccd3fe0fd4b80e62733e60c05772450e5c @nopri committed Dec 27, 2013
Showing with 18 additions and 5 deletions.
  1. +1 −1 README.txt
  2. +7 −1 app.py
  3. +4 −3 messages.py
  4. +6 −0 template/default/admin.html
View
@@ -3,7 +3,7 @@ Simple Online Store application
(c) Noprianto <nop@tedut.com>
2010
GPL
-v1.02
+v1.03
SCREENSHOTS / USERS: https://github.com/nopri/onlinestore-multi/wiki
View
8 app.py
@@ -279,7 +279,7 @@ def pget(option, default='', strip=True, callback=None):
############################### CONSTANT ###############################
-VERSION = '1.02'
+VERSION = '1.03'
NAME = 'onlinestore-multi'
PRECISION = 2
TEMPLATE_DIR = CURDIR + PS + 'template'
@@ -2807,11 +2807,17 @@ def GET(self):
data = {}
data['menu'] = dadmin()
#
+ log_size_r = query('select count(id) as count from tr_log')
+ log_size = rget(log_size_r, 'count', default=0)
#
if isadmin():
data['version'] = VERSION
+ data['database_size'] = nf(os.path.getsize(DATA_FILE))
+ data['log_size'] = nf(log_size)
else:
data['version'] = ''
+ data['database_size'] = ''
+ data['log_size'] = ''
#
o = t.admin(title(ttl), data)
o = tplb(o)
View
@@ -1,6 +1,3 @@
-LANGS = {
-}
-
NUMBER_FORMAT = {
'default': {'decimal_point': '.', 'thousands_separator': ','},
'en_US' : {'decimal_point': '.', 'thousands_separator': ','},
@@ -295,6 +292,8 @@
'header_no_translation' : 'no translation',
'header_member_level' : 'membership level',
'header_app_version' : 'version',
+ 'header_database_size' : 'database size',
+ 'header_log_size' : 'log size',
'header_sys_site_description': 'store description',
'header_sys_site_keywords': 'store keywords',
'header_sys_extra_info' : 'extra information',
@@ -744,6 +743,8 @@
'header_no_translation' : 'tanpa terjemahan',
'header_member_level' : 'level keanggotaan',
'header_app_version' : 'versi',
+ 'header_database_size' : 'ukuran database',
+ 'header_log_size' : 'ukuran log',
'header_sys_site_description': 'deskripsi toko',
'header_sys_site_keywords': 'keyword toko',
'header_sys_extra_info' : 'informasi ekstra',
@@ -15,6 +15,12 @@
<tr>
<td width='15%'><b>$msg['header_app_version'].capitalize()</b></td><td>$data['version']</td>
</tr>
+ <tr>
+ <td width='15%'><b>$msg['header_database_size'].capitalize()</b></td><td>$data['database_size']</td>
+ </tr>
+ <tr>
+ <td width='15%'><b>$msg['header_log_size'].capitalize()</b></td><td>$data['log_size']</td>
+ </tr>
</table>
<br>

0 comments on commit 987b4dc

Please sign in to comment.