コード例 #1
0
ファイル: get_host.py プロジェクト: 40a/jetfire
    def get(self):
        try:
            page = int(request.args.get('page', 1))
        except ValueError:
            page = 1

        skip = app.config['NUMBER_OF_ITEMS_PER_PAGE'] * (page - 1)
        allhosts = self.get_pagedhosts(skip, app.config['NUMBER_OF_ITEMS_PER_PAGE'])

        pagination = Pagination(css_framework='bootstrap3', page=page, total=common.countHosts(), record_name='host', per_page= app.config['NUMBER_OF_ITEMS_PER_PAGE'])
        return flask.render_template('gethost.html', allhosts=allhosts, pagination=pagination)
コード例 #2
0
ファイル: get_host.py プロジェクト: 40a/jetfire
    def get_searchHosts(self, hostname):
        try:
            page = int(request.args.get('page', 1))
        except ValueError:
            page = 1

        skip = app.config['NUMBER_OF_ITEMS_PER_PAGE'] * (page - 1)

        getallhosts = GetAllHosts()
        searchHosts = getallhosts.get_pagedhosts(skip, app.config['NUMBER_OF_ITEMS_PER_PAGE'], hostname)

        pagination = Pagination(page=page, total=common.countHosts(hostname), found=hostname, record_name='host', per_page= app.config['NUMBER_OF_ITEMS_PER_PAGE'])
        return flask.render_template('gethost.html', allhosts=searchHosts, pagination=pagination)
コード例 #3
0
    def get(self):
        try:
            page = int(request.args.get('page', 1))
        except ValueError:
            page = 1

        skip = app.config['NUMBER_OF_ITEMS_PER_PAGE'] * (page - 1)
        allhosts = self.get_pagedhosts(skip,
                                       app.config['NUMBER_OF_ITEMS_PER_PAGE'])

        pagination = Pagination(
            css_framework='bootstrap3',
            page=page,
            total=common.countHosts(),
            record_name='host',
            per_page=app.config['NUMBER_OF_ITEMS_PER_PAGE'])
        return flask.render_template('gethost.html',
                                     allhosts=allhosts,
                                     pagination=pagination)
コード例 #4
0
    def get_searchHosts(self, hostname):
        try:
            page = int(request.args.get('page', 1))
        except ValueError:
            page = 1

        skip = app.config['NUMBER_OF_ITEMS_PER_PAGE'] * (page - 1)

        getallhosts = GetAllHosts()
        searchHosts = getallhosts.get_pagedhosts(
            skip, app.config['NUMBER_OF_ITEMS_PER_PAGE'], hostname)

        pagination = Pagination(
            page=page,
            total=common.countHosts(hostname),
            found=hostname,
            record_name='host',
            per_page=app.config['NUMBER_OF_ITEMS_PER_PAGE'])
        return flask.render_template('gethost.html',
                                     allhosts=searchHosts,
                                     pagination=pagination)