{{extend 'layout.html'}} {{if request.function=='index':}}

{{=T("Available databases and tables")}}

{{if not databases:}}{{=T("No databases in this application")}}{{pass}} {{for db in sorted(databases):}} {{for table in databases[db].tables:}} {{qry='%s.%s.id>0'%(db,table)}} {{tbl=databases[db][table]}} {{if hasattr(tbl,'_primarykey'):}} {{if tbl._primarykey:}} {{firstkey=tbl[tbl._primarykey[0]]}} {{if firstkey.type in ['string','text']:}} {{qry='%s.%s.%s!=""'%(db,table,firstkey.name)}} {{else:}} {{qry='%s.%s.%s>0'%(db,table,firstkey.name)}} {{pass}} {{else:}} {{qry=''}} {{pass}} {{pass}}

{{=A("%s.%s" % (db,table),_href=URL('select',args=[db],vars=dict(query=qry)))}}

[ {{=A(str(T('insert new'))+' '+table,_href=URL('insert',args=[db,table]))}} ]

{{pass}} {{pass}} {{elif request.function=='select':}}

{{=XML(str(T("database %s select"))%A(request.args[0],_href=URL('index'))) }}

{{if table:}} [ {{=A(str(T('insert new %s'))%table,_href=URL('insert',args=[request.args[0],table]))}} ]

{{=T("Rows in table")}}


{{else:}}

{{=T("Rows selected")}}


{{pass}} {{=form}}

{{=T('The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.')}}
{{=T('Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.')}}
{{=T('"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN')}}



{{=nrows}} {{=T("selected")}}

{{if start>0:}}[ {{=A(T('previous 100 rows'),_href=URL('select',args=request.args[0],vars=dict(start=start-100)))}} ]{{pass}} {{if stop {{linkto=URL('update',args=request.args[0])}} {{upload=URL('download',args=request.args[0])}} {{=SQLTABLE(rows,linkto,upload,orderby=True,_class='sortable')}} {{pass}}

{{=T("Import/Export")}}


[ {{=T("export as csv file")}} ] {{if table:}} {{=FORM(str(T('or import from csv file'))+" ",INPUT(_type='file',_name='csvfile'),INPUT(_type='hidden',_value=table,_name='table'),INPUT(_type='submit',_value='import'))}} {{pass}} {{elif request.function=='insert':}}

{{=T("database")}} {{=A(request.args[0],_href=URL('index'))}} {{if hasattr(table,'_primarykey'):}} {{fieldname=table._primarykey[0]}} {{dbname=request.args[0]}} {{tablename=request.args[1]}} {{cond = table[fieldname].type in ['string','text'] and '!=""' or '>0'}} {{=T("table")}} {{=A(tablename,_href=URL('select',args=dbname,vars=dict(query='%s.%s.%s%s'%(dbname,tablename,fieldname,cond))))}} {{else:}} {{=T("table")}} {{=A(request.args[1],_href=URL('select',args=request.args[0],vars=dict(query='%s.%s.id>0'%tuple(request.args[:2]))))}} {{pass}}

{{=T("New Record")}}


{{=form}} {{elif request.function=='update':}}

{{=T("database")}} {{=A(request.args[0],_href=URL('index'))}} {{if hasattr(table,'_primarykey'):}} {{fieldname=request.vars.keys()[0]}} {{dbname=request.args[0]}} {{tablename=request.args[1]}} {{cond = table[fieldname].type in ['string','text'] and '!=""' or '>0'}} {{=T("table")}} {{=A(tablename,_href=URL('select',args=dbname,vars=dict(query='%s.%s.%s%s'%(dbname,tablename,fieldname,cond))))}} {{=T("record")}} {{=A('%s=%s'%request.vars.items()[0],_href=URL('update',args=request.args[:2],vars=request.vars))}} {{else:}} {{=T("table")}} {{=A(request.args[1],_href=URL('select',args=request.args[0],vars=dict(query='%s.%s.id>0'%tuple(request.args[:2]))))}} {{=T("record id")}} {{=A(request.args[2],_href=URL('update',args=request.args[:3]))}} {{pass}}

{{=T("Edit current record")}}



{{=form}} {{elif request.function=='state':}}

{{=T("Internal State")}}

{{=T("Current request")}}

{{=BEAUTIFY(request)}}

{{=T("Current response")}}

{{=BEAUTIFY(response)}}

{{=T("Current session")}}

{{=BEAUTIFY(session)}} {{elif request.function == 'ccache':}}

Cache

Statistics

Overview

Hit Ratio: {{=total['ratio']}}% ({{=total['hits']}} hits and {{=total['misses']}} misses)

Size of cache: {{=total['objects']}} items, {{=total['bytes']}} bytes {{if total['bytes'] > 524287:}} ({{="%.0d" % (total['bytes'] / 1048576)}} MB) {{pass}}

Cache contains items up to {{="%02d" % total['oldest'][0]}} hours {{="%02d" % total['oldest'][1]}} minutes {{="%02d" % total['oldest'][2]}} seconds old.

RAM

Hit Ratio: {{=ram['ratio']}}% ({{=ram['hits']}} hits and {{=ram['misses']}} misses)

Size of cache: {{=ram['objects']}} items, {{=ram['bytes']}} bytes {{if ram['bytes'] > 524287:}} ({{=ram['bytes'] / 1048576}} MB) {{pass}}

RAM contains items up to {{="%02d" % ram['oldest'][0]}} hours {{="%02d" % ram['oldest'][1]}} minutes {{="%02d" % ram['oldest'][2]}} seconds old.

DISK

Hit Ratio: {{=disk['ratio']}}% ({{=disk['hits']}} hits and {{=disk['misses']}} misses)

Size of cache: {{=disk['objects']}} items, {{=disk['bytes']}} bytes {{if disk['bytes'] > 524287:}} ({{=disk['bytes'] / 1048576}} MB) {{pass}}

DISK contains items up to {{="%02d" % disk['oldest'][0]}} hours {{="%02d" % disk['oldest'][1]}} minutes {{="%02d" % disk['oldest'][2]}} seconds old.

Manage Cache

{{=form}}

{{pass}}