Ignore:
Timestamp:
27 May 2012, 00:28:10 (13 years ago)
Author:
uli
Message:

Do not use session anymore to store requested logfile names in datacenter.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/browser
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r8515 r8529  
    12031203    show_button = _(u'Show')
    12041204
    1205     def update(self, show=None, logname=None, back=None):
    1206         session = ISession(self.request)['waeup.kofa']
     1205    def update(self, back=None):
    12071206        if back is not None:
    12081207            self.redirect(self.url(self.context))
    1209             return
    1210         if logname is not None:
    1211             session['logname'] = logname
    1212         if show is not None:
    1213             self.redirect(self.url(self.context, '@@show'))
    12141208            return
    12151209        self.files = self.context.getLogFiles()
     
    12241218    search_button = _('Search')
    12251219    back_button = _('Back')
     1220    placeholder = _('Enter a regular expression here...')
    12261221
    12271222    def label(self):
    12281223        return "Logfile %s" % self.filename
    12291224
    1230     def update(self, back=None, query=None):
     1225    def update(self, back=None, query=None, logname=None):
    12311226        if os.name != 'posix':
    12321227            self.flash(
     
    12351230            self.redirect(self.url(self.context, '@@logs'))
    12361231            return
    1237         session = ISession(self.request)['waeup.kofa']
    1238         logname = session.get('logname', None)
    12391232        if back is not None or logname is None:
    12401233            self.redirect(self.url(self.context, '@@logs'))
    12411234            return
    12421235        self.filename = logname
    1243         form = self.request.form
    1244         self.query = ''
    1245         query = form.get('query')
     1236        self.query = query
    12461237        if search is None or not query:
    12471238            return
    1248         self.query = query
    12491239        try:
    1250             self.grepresult = ''.join(
     1240            self.result = ''.join(
    12511241                self.context.queryLogfiles(logname, query))
    12521242        except ValueError:
    1253             self.flash(_('Not a valid search expression.' ))
     1243            self.flash(_('Invalid search expression.'))
     1244            return
     1245        if not self.result:
     1246            self.flash(_('No search results found.'))
    12541247        return
    12551248
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterimport4page.pt

    r7811 r8529  
    1717  <input class="btn primary" type="submit" name="finish"
    1818    tal:attributes="value view/back_button" />
     19</form>
     20<form method="POST" i18n:domain="waeup.kofa" action="@@show">
    1921  <input class="btn" type="submit" name="showlog"
    2022    tal:attributes="value view/show_button" />
     23  <input type="hidden" name="logname" tal:attributes="value string:datacenter.log" />
    2124</form>
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterlogspage.pt

    r7811 r8529  
    33  Currently no log files are available.
    44  </p>
    5   <table tal:condition="files" class="condensed-table">
     5  <table tal:condition="files" class="table condensed-table">
    66    <thead>
    77      <tr>
     
    2020          tal:attributes="class python: repeat['file'].odd() and 'odd' or 'even'">
    2121        <td class="text-center">
    22           <form method="POST">
    23             <input i18n:translate="" type="submit" class="btn primary" name="show"
    24                 tal:attributes="value view/show_button" />
    25             <input type="hidden" name="logname" tal:attributes="value file/name" />
     22          <form method="POST" action="@@show">
     23            <input i18n:translate="" type="submit" class="btn primary"
     24                   name="show" tal:attributes="value view/show_button" />
     25            <input type="hidden" name="logname"
     26                   tal:attributes="value file/name" />
    2627          </form></td>
    2728        <td tal:content="file/name">file.name</td>
     
    3233  </table>
    3334  <form method="POST">
     35    <button class="btn primary">
     36      <img tal:attributes="src static/actionicon_reload.png" />
     37      <span i18n:translate="">Reload Page</span>
     38    </button>
    3439    <input i18n:translate="" type="submit" class="btn" name="back"
    3540        tal:attributes="value view/back_button"/>
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterlogsshowfilepage.pt

    r7749 r8529  
    1 <form method="post">
     1<form method="post" class="form-horizontal">
    22  <input type="text" name="query"
    3          tal:attributes="value view/query" />
    4     <input class="btn primary" type="submit" name="search"
    5       tal:attributes="value view/search_button"/>
    6     <input class="btn" type="submit" name="back"
    7       tal:attributes="value view/back_button"/>
     3         tal:attributes="value view/query; placeholder view/placeholder" />
     4  <input class="btn primary" type="submit" name="search"
     5         tal:attributes="value view/search_button" />
     6  <input class="btn" type="submit" name="back"
     7         tal:attributes="value view/back_button" />
     8  <input type="hidden" name="logname"
     9         tal:attributes="value view/filename" />
    810</form>
    911
    10 <div tal:condition="view/grepresult|nothing">
    11   <pre tal:content="structure view/grepresult">
     12<div tal:condition="view/result|nothing">
     13  <pre tal:content="structure view/result">
    1214    GREPRESULT
    1315  </pre>
Note: See TracChangeset for help on using the changeset viewer.