示例#1
0
文件: wh_map.py 项目: rudykocur/pyeve
    def doGet(self, request):
        layout = IGBLayout()

        layout.addJs('dom.jsPlumb-1.6.4-min.js')
        layout.addJs('whMap.js')

        layout.setContent([
            Panel(heading=['Simple map'],
                  content=T.div(id='wormholeMap')[
                      T.div(class_='whRow')[
                          whSlotEmpty(),
                          whSlotEmpty(),
                          whSlot('J123456', 'Some data'),
                          whSlot('J098654', 'Some data 2'),
                          whSlotEmpty(),
                          whSlotEmpty(),
                      ],
                      T.div(class_='whRow')[
                          whSlotEmpty(),
                          whSlotEmpty(),
                          whSlotEmpty(),
                          whSlot('J432567', 'Some data 2'),
                          whSlotEmpty(),
                          whSlotEmpty(),
                      ],
                      T.div(class_='whRow')[
                          whSlotEmpty(),
                          whSlot('J111111', 'Some data 9'),
                          whSlot('J111112', 'Some data 8'),
                          whSlot('J111113', 'Some data 7'),
                          whSlot('J111114', 'Some data 6'),
                          whSlot('J111115', 'Some data 5'),
                      ],
                  ]
            )
        ])

        return layout
示例#2
0
    def renderResponse(self, helper, signatures):

        layout = IGBLayout()
        layout.addJs('common.js')
        layout.addJs('scanning.js')
        layout.addJs('loot.js')

        if helper.isTrusted:

            content = [
                Panel(
                    heading=[
                        self._renderHeader(helper),
                    ],
                    content=[
                        T.div(class_='row')[
                            T.div(class_='col-xs-8')[
                                T.textarea(class_="form-control",
                                           id="signaturesInput",
                                           rows="2",
                                           style="overflow: hidden; resize: none",
                                           placeholder="Paste scanning content here")
                            ],
                            T.div(class_='col-xs-4')[
                                T.button(class_='btn btn-default', id='processButton')['Submit'],
                                T.img(id='ajaxLoader', src='/static/images/ajax-loader.gif'),
                            ],

                        ]
                    ]
                ),
                Panel(heading=['Known signatures in ', T.strong[helper.systemName],
                               T.div(class_='pull-right')[
                                   T.a(href=self.getUrl('scanning/help'))['How to use this tool']
                               ]],
                      content=[
                          T.div(id='bookmarkContainer')[
                              self.getKnownSignaturesTable(signatures)
                          ],

                      ]),
                T.script[
                    """
                    $(document).ready(function() {
                        BookmarkManager.init({
                            container: document.getElementById('bookmarkContainer'),
                            processButton: document.getElementById('processButton'),
                            signaturesInput: document.getElementById('signaturesInput'),
                            ajaxLoader: document.getElementById('ajaxLoader'),

                            systemName: '%(system)s'
                        });

                        LootInterface.init();
                    });
                    """ % dict(system=helper.systemName)
                ]
            ]

            layout.setContent(content)

        return layout