summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/widgets.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: toaster: use items and range instead of old APIsEd Bartosh2016-05-161-2/+2
| | | | | | | | | | | | Used items() and range() APIs instead of iteritems() and xrange() as latter don't exist in python 3 [YOCTO #9584] (Bitbake rev: f44986d41055ce7fa3128e1acb6968f9ccc355ba) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: get rid of using reduceEd Bartosh2016-05-161-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced compicated calls of reduce with more clear code. As reduce was removed from python 3 this change is mandatory for the code to work on both pythons. Here is an example change for illustration purposes: original code: querydict = dict(zip(or_keys, or_values)) query = reduce(operator.or_, map(lambda x: __get_q_for_val(x, querydict[x]), [k for k in querydict]))) replaced with: query = None for key, val in zip(or_keys, or_values): x = __get_q_for_val(k, val) query = query | x if query else x [YOCTO #9584] (Bitbake rev: 0a25b723431602dc5eeb10a4002872c05b390f23) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: set default visible and hideable columnsElliot Smith2016-01-151-0/+18
| | | | | | | | | | | | | | | | | | | | | | | Incorrect columns were shown by default in the "all builds", "project builds" and "all projects" pages. Set the "hidden" property on columns in these tables to hide the correct columns. Add a set_column_hidden() method to ToasterTable so that the "hidden" property can be overridden for the machines column in the project builds page (it shares a superclass with all builds). Make the time column on all builds page hideable. [YOCTO #8738] (Bitbake rev: be3982c71703eaa51e7f3352e0cb5b3af11c9ead) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: streamline construction of filter objectsElliot Smith2016-01-151-1/+0
| | | | | | | | | | | | | | In line with comments from review, remove the QuerysetFilter class (redundant) and convert ProjectFilters into a class with static methods. [YOCTO #8738] (Bitbake rev: 59379bf6467029223045c5ebef868729d8e02c86) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: convert project builds page to ToasterTableElliot Smith2016-01-151-1/+0
| | | | | | | | | | | | | Use the all builds ToasterTable as the basis for the project builds ToasterTable. [YOCTO #8738] (Bitbake rev: 87bcfb740dd2d9944e35a2a1f71cbf8ff3b266e9) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: implement date range filters for buildsElliot Smith2016-01-151-16/+16
| | | | | | | | | | | | | | | | | | | Implement the completed_on and started_on filtering for builds. Also separate the name of a filter ("filter" in the querystring) from its value ("filter_value" in the querystring). This enables filtering to be defined in the querystring more intuitively, and also makes it easier to add other types of filter (e.g. by day). [YOCTO #8738] (Bitbake rev: d47c32e88c2d4a423f4d94d49759e557f425a539) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: refactor ToasterTable filteringElliot Smith2016-01-151-50/+40
| | | | | | | | | | | | | | | | | The filter code for ToasterTable was difficult to follow and inflexible (not allowing different types of filter, for example). Refactor to a set of filter classes to make the structure cleaner and provide the flexibility needed for other filter types (e.g. date range filter). [YOCTO #8738] (Bitbake rev: 94031bb30bdaf665d0c8c68b591fcb7a17b6674d) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: convert all builds page to ToasterTableElliot Smith2016-01-151-5/+11
| | | | | | | | | | | | | | | | For better long-term maintainability, use ToasterTable instead of Django template and view code to display the all builds page. NB the builds.html template has been left in, as this will otherwise cause conflicts when merging the new theme. [YOCTO #8738] (Bitbake rev: e0590fc8103afeb4c5e613a826057555c8193d59) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Don't HTTP cache ToasterTable responsesElliot Smith2015-10-111-0/+6
| | | | | | | | | | | | | | | | | | | Django allows generated pages to be cached by default by the browser. This can result in stale data displaying for some pages. Instead, disable HTTP caching of ToasterTable responses, so that each time a ToasterTable view is displayed, its data is refreshed. This carries a performance penalty, but ensures that ToasterTable views (e.g. compatible layers) are correctly refreshed if the user navigates their history with forward/back. [YOCTO #7660] (Bitbake rev: 44dccd3018554915868d6c8fe5e22624a2fcdec5) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: ToasterTable remove unused class definitionMichael Wood2015-09-291-27/+0
| | | | | | | | | | Remove ToasterTemplateView as this isn't used by anything. (Bitbake rev: aa0b2dc6789cb6ae12511a4a930a4118337a162e) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add nocache option to the ToasterTable widgetMichael Wood2015-09-291-0/+7
| | | | | | | | | | | | | Useful for skipping the cache mechanism when debugging. Simply append nocache=true to the end of the url with the table in it. Also adds a debug message if the table is using cached data. (Bitbake rev: 3492c1570db9ecd728d9901bda1f02a2d7495f19) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: widgets ToasterTable Add more info to search field exceptionMichael Wood2015-09-291-1/+2
| | | | | | | | | | If we get a search fields exception then also print out the model name (Bitbake rev: 8152db1e35b9a3f35a25f801008f6fc61a6b11c4) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: widgets ToasterTable add logger to notify when cache hitMichael Wood2015-09-291-0/+4
| | | | | | | | | | Useful for debugging to remind you if you're hitting a cache or not (Bitbake rev: 68b9c2d95ab17ee2d16325862342126eb5c3c1a7) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: tables Move the title and name into the widgetMichael Wood2015-09-291-1/+8
| | | | | | | | | | | | For historical reasons this was being set in the urls definition. We can set this in the actual definition of the table and defaults in the widget. (Bitbake rev: 2f7949caec3c9194328c35b2e075eaae85409efe) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fix pylint errorsAlexandru Damian2015-08-191-0/+3
| | | | | | | | | | | | | | | | | | | | Prompted by issues discovered during running pylint on the toaster sources, this patch fixes: * missing import in toaster ui * improper call of function in toaster ui (logger.debug) * improper function definitions in bbcontroller * invalid references to objects in bldcontrol.models * proper initialization of object fields in ToasterTables Also inhibiting specific pylint errors in files where the problems are mis-identified. (Bitbake rev: 1c71955c416fb68455f7f70669aba4202c411807) Signed-off-by: Alexandru Damian <alexandru.damian@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: widgets Add a typeahead widgetMichael Wood2015-08-061-0/+52
| | | | | | | | | | | | | The typeahead behaviour is significantly different from searching in a table so we need a separate widget to do this. [YOCTO #7152] (Bitbake rev: 195c5407a9de29d97f2525b9ae6c827afb934e37) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: toastergui: Toastertables don't replace dash in cache keyMichael Wood2015-08-011-2/+2
| | | | | | | | | | | | | The dash character was being stripped from the cache key when we sanitise it for the memcache backend. This meant that we were getting a false hit on the cache and returning non descending results which are indicated by the dash prefix on the field name. (Bitbake rev: 18743274a94966d2cd8d17d163e4dbab501a8a52) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: toastertable Pass up the kwargs for setup_filterMichael Wood2015-06-261-6/+6
| | | | | | | | | | This allows us to setup_filter in tables using args such as the current project. (Bitbake rev: e0d59c32a7cff76d732a90cc6d507c7a9b68cb84) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Enable toastertable cacheMichael Wood2015-06-261-2/+5
| | | | | | | | | | | Enable the cache and fix warning on the toastertable cache which happens on the memcache backend "CacheKeyWarning: Cache key contains characters that will cause errors if used with memcached" (Bitbake rev: 330692e4e2e4dea59f70caa03001905ffff4860a) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: remove xhr_datatypeahead and xhr_XXXbuildAlexandru DAMIAN2015-06-121-3/+3
| | | | | | | | | | | | We remove the endpoints for XHR on the toastergui application. The endpoints are now replaced with calls to the respective REST endpoints (i.e. projectlayers, projecttargets, projectmachines). (Bitbake rev: 8e7a2c3b125a34fd9d6fa0442ab13290137ecc51) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add class template view for single-object pagesAlexandru DAMIAN2015-06-121-0/+26
| | | | | | | | | | | Adding ToasterTemplateView as prototype for all class-based views that display single objects; equivalent to ToasterTable for object lists. (Bitbake rev: d3edea773000a663f5883e04f477d853bff64cf6) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: toastertables raise errorsAlexandru DAMIAN2015-06-121-5/+7
| | | | | | | | | | | Modifies the widget code to raise the Exceptions to the user instead of printing then to stdout - making the programming errors much more visible. (Bitbake rev: 26dc19284e06a7ae35f75a243b2062f61e30f2ca) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: ToasterTables add computational fieldsAlexandru DAMIAN2015-06-121-3/+16
| | | | | | | | | | | | | | | | This patch adds the ability to pass a function to be computed for generating a field value in setting up a column in ToasterTables. Also adding "displayable" property that can be turned False for columns that are present in JSON data but are not part of the UI. Add the "id" column by default for all rows. (Bitbake rev: fb683135348b074412da154585c75865aad1eab0) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: toaster table add raw dataAlexandru DAMIAN2015-06-121-5/+11
| | | | | | | | | | | | | | | We add in a JSON response both the raw data and the rendered version for display. The rendered fields start with "static:" to mark a different "namespace". The toaster.js is updated to always display the "static:" version of a field, if it exists (and ignore the raw data unless the static rendering is missing). (Bitbake rev: 928ee3fd4b52ea14b7eb704f1f27351362a9d27a) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: toastertables REST refactoringAlexandru DAMIAN2015-06-121-28/+19
| | | | | | | | | | | | | | | | | | | This patch refactors the ToasterTables to bring them in line with REST principles - - all table pages now support the "format=json" GET parameter that returns the data in JSON format - the tables themselves This cleans up the URL namespace by aleviating the need to have two URLS for each table (one for the template and one for the data loading), and fixes minor things in the ToasterTable implementation. (Bitbake rev: 1778dac9fd39dae75c55bf2cf836cdd488dbc265) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Add an invalidate cache method on data update signalMichael Wood2015-05-291-2/+4
| | | | | | | | | | | Instead of relying on the cache expiring over an amount of time we can listen to the changed notification on the models to invalidate the cache. Also fixes overlapping cache names. (Bitbake rev: eb0b1450e421cf65b407b1ac0336ac24ffc626e8) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Port layerdetails to ToasterTablesMichael Wood2015-05-291-10/+7
| | | | | | | | | | | This ports the layerdetails page to using ToasterTables Also some whitespace and strict clean ups in the existing layerdetails js and html template. (Bitbake rev: 8ce35f81631e31539aeb82f8a85abbb3312e5097) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Add toaster table widgetMichael Wood2015-05-141-0/+316
This widget provides a common client and backend widget to support presenting data tables in Toaster. It provides; data loading, paging, page size, ordering, filtering, column toggling, caching, column defaults, counts and search. (Bitbake rev: b3a6fa4861bf4495fbd39e2abb18b3a46c6eac18) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>