diff --git a/tailbone/templates/appinfo/index.mako b/tailbone/templates/appinfo/index.mako index 75032c1f..faaea935 100644 --- a/tailbone/templates/appinfo/index.mako +++ b/tailbone/templates/appinfo/index.mako @@ -1,8 +1,7 @@ ## -*- coding: utf-8; -*- -<%inherit file="/master/index.mako" /> +<%inherit file="wuttaweb:templates/appinfo/index.mako" /> <%def name="page_content()"> -
- <${b}-collapse class="panel" open> - - - -
-
- <${b}-table :data="configFiles"> - - <${b}-table-column field="priority" - label="Priority" - v-slot="props"> - {{ props.row.priority }} - - - <${b}-table-column field="path" - label="File Path" - v-slot="props"> - {{ props.row.path }} - - - -
-
- - - <${b}-collapse class="panel" - :open="false"> - - - -
-
- ${grid.render_vue_tag()} -
-
- - - -<%def name="modify_vue_vars()"> - ${parent.modify_vue_vars()} - + ${parent.page_content()} diff --git a/tailbone/templates/grids/complete.mako b/tailbone/templates/grids/complete.mako index c136273b..5d406512 100644 --- a/tailbone/templates/grids/complete.mako +++ b/tailbone/templates/grids/complete.mako @@ -257,6 +257,9 @@ loading: false, ajaxDataUrl: ${json.dumps(getattr(grid, 'ajax_data_url', request.path_url))|n}, + ## nb. this tracks whether grid.fetchFirstData() happened + fetchedFirstData: false, + savingDefaults: false, data: ${grid.vue_component}CurrentData, @@ -519,6 +522,17 @@ ...this.getFilterParams()} }, + ## nb. this is meant to call for a grid which is hidden at + ## first, when it is first being shown to the user. and if + ## it was initialized with empty data set. + async fetchFirstData() { + if (this.fetchedFirstData) { + return + } + await this.loadAsyncData() + this.fetchedFirstData = true + }, + ## TODO: i noticed buefy docs show using `async` keyword here, ## so now i am too. knowing nothing at all of if/how this is ## supposed to improve anything. we shall see i guess diff --git a/tailbone/views/settings.py b/tailbone/views/settings.py index bda62ccc..4d99cb2a 100644 --- a/tailbone/views/settings.py +++ b/tailbone/views/settings.py @@ -71,10 +71,20 @@ class AppInfoView(MasterView): app.get_title()) def get_data(self, session=None): + """ """ + + # nb. init with empty data, only load it upon user request + if not self.request.GET.get('partial'): + return [] + + # TODO: pretty sure this is not cross-platform. probably some + # sort of pip methods belong on the app handler? or it should + # have a pip handler for all that? pip = os.path.join(sys.prefix, 'bin', 'pip') output = subprocess.check_output([pip, 'list', '--format=json']) data = json.loads(output.decode('utf_8').strip()) + # must avoid null values for sort to work right for pkg in data: pkg.setdefault('editable_project_location', '')