Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
1.03, admin: database size, log size
Browse files Browse the repository at this point in the history
  • Loading branch information
nopri committed Dec 27, 2013
1 parent c676f15 commit 987b4dc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.txt
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion app.py
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions messages.py
@@ -1,6 +1,3 @@
LANGS = {
}

NUMBER_FORMAT = {
'default': {'decimal_point': '.', 'thousands_separator': ','},
'en_US' : {'decimal_point': '.', 'thousands_separator': ','},
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
6 changes: 6 additions & 0 deletions template/default/admin.html
Expand Up @@ -15,6 +15,12 @@ <h3>$msg['title_admin'].capitalize()</h3>
<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>

Expand Down

0 comments on commit 987b4dc

Please sign in to comment.