Univention Bugzilla – Attachment 5307 Details for
Bug 31915
Improve performance of App Center frontend: App Detail dialog can open instantly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Simply remove the tools.umcpCommand('appcenter/get', {'application': app.id})
bug31915.patch (text/plain), 10.20 KB, created by
Dirk Wiesenthal
on 2013-07-08 13:14:26 CEST
(
hide
)
Description:
Simply remove the tools.umcpCommand('appcenter/get', {'application': app.id})
Filename:
MIME Type:
Creator:
Dirk Wiesenthal
Created:
2013-07-08 13:14:26 CEST
Size:
10.20 KB
patch
obsolete
>Index: debian/changelog >=================================================================== >--- debian/changelog (Revision 42129) >+++ debian/changelog (Arbeitskopie) >@@ -1,3 +1,9 @@ >+univention-management-console-module-appcenter (3.0.4-1) unstable; urgency=low >+ >+ * Performance: Speedup updates by committing files only once (Bug #31228) >+ >+ -- Dirk Wiesenthal <wiesenthal@univention.de> Mon, 08 Jul 2013 13:03:36 +0200 >+ > univention-management-console-module-appcenter (3.0.3-1) unstable; urgency=low > > * Use independent apt.Cache when getting package sections (Bug #31662) >Index: umc/js/appcenter/AppCenterPage.js >=================================================================== >--- umc/js/appcenter/AppCenterPage.js (Revision 42129) >+++ umc/js/appcenter/AppCenterPage.js (Arbeitskopie) >@@ -137,6 +137,7 @@ > this.addChild(this._searchSidebar); > > this._grid = new GalleryPane({ >+ showTooltips: false, > region: 'center', > > style: 'height: 100%; width: 100%;', >@@ -203,8 +204,9 @@ > this._searchSidebar.on('search', lang.hitch(this, 'filterApplications')); > > this.own(this._grid.on('.dgrid-row:click', lang.hitch(this, function(evt) { >- this._show_details(this._grid.row(evt)); >- topic.publish('/umc/actions', this.moduleID, this.moduleFlavor, this._grid.row(evt).id, 'show'); >+ var app = this._grid.row(evt).data; >+ this._show_details(app); >+ topic.publish('/umc/actions', this.moduleID, this.moduleFlavor, app.id, 'show'); > }))); > > this._buildRenderingDeferred.resolve(); // for apps.js >@@ -228,144 +230,132 @@ > > // inspired by PackagesPage._show_details > _show_details: function(app) { >- this.standby(true); >+ var width = 550; // mimic the default of dialog.confirm > >- tools.umcpCommand('appcenter/get', {'application': app.id}).then( >- lang.hitch(this, function(data) { >- this.standby(false); >- var app = data.result; >- var width = 550; // mimic the default of dialog.confirm >+ var label_style = 'vertical-align:top;text-align:right;padding-left:1em;padding-right:.5em;white-space:nowrap;font-weight:bold;'; >+ var data_style = 'vertical-align:top;padding-bottom:.25em;'; > >- var label_style = 'vertical-align:top;text-align:right;padding-left:1em;padding-right:.5em;white-space:nowrap;font-weight:bold;'; >- var data_style = 'vertical-align:top;padding-bottom:.25em;'; >- >- var txt = "<h1>" + _("Details for Application '%(name)s'", app) + "</h1>"; >- txt += "<table>\n"; >- var fields = this._detail_field_order(); >- array.forEach(fields, lang.hitch(this, function(key) { >- var label = this._detail_field_label(key); >- var value = app[key]; >- var detail_func = this['_detail_field_custom_' + key]; >- if (detail_func) { >- value = lang.hitch(this, detail_func)(app); >- } >- if (!value) { >- return; // continue >- } >- if (label) { >- txt += "<tr>\n"; >- txt += "<td style='" + label_style + "'>" + label + "</td>\n"; >- txt += "<td style='" + data_style + "'>" + value + "</td>\n"; >- txt += "</tr>\n"; >- } >- })); >- txt += "</table>\n"; >- var buttons = []; >- if (!app.allows_using && this._udm_accessible) { >- var label = app.can_update ? _('Upgrade') : _('Install'); // call it Install/Upgrade, although it is request >- buttons.push({ >- name: 'request', >- label: label, >- callback: lang.hitch(this, function() { >- this._show_license_request(); >- }) >- }); >- } >- if (app.allows_using && app.can_install) { >- buttons.push({ >- name: 'install', >- label: _("Install"), >- callback: lang.hitch(this, function() { >- if (app.licenseagreement) { >- // before installing, user must agree on license terms >- var content = '<h1>' + _('License agreement') + '</h1>'; >- content += '<div style="max-height:250px; overflow:auto;">' + >- this.formatTxt(app.licenseagreement) + >- '</div>'; >- dialog.confirm(content, [{ >- name: 'decline', >- label: _('Cancel'), >- 'default': true >- }, { >- name: 'accept', >- label: _('Accept license') >- }], _('License agreement')).then(lang.hitch(this, function(response) { >- if (response == 'accept') { >- this._call_installer('install', app); >- } >- })); >- } else { >+ var txt = "<h1>" + _("Details for Application '%(name)s'", app) + "</h1>"; >+ txt += "<table>\n"; >+ var fields = this._detail_field_order(); >+ array.forEach(fields, lang.hitch(this, function(key) { >+ var label = this._detail_field_label(key); >+ var value = app[key]; >+ var detail_func = this['_detail_field_custom_' + key]; >+ if (detail_func) { >+ value = lang.hitch(this, detail_func)(app); >+ } >+ if (!value) { >+ return; // continue >+ } >+ if (label) { >+ txt += "<tr>\n"; >+ txt += "<td style='" + label_style + "'>" + label + "</td>\n"; >+ txt += "<td style='" + data_style + "'>" + value + "</td>\n"; >+ txt += "</tr>\n"; >+ } >+ })); >+ txt += "</table>\n"; >+ var buttons = []; >+ if (!app.allows_using && this._udm_accessible) { >+ var label = app.can_update ? _('Upgrade') : _('Install'); // call it Install/Upgrade, although it is request >+ buttons.push({ >+ name: 'request', >+ label: label, >+ callback: lang.hitch(this, function() { >+ this._show_license_request(); >+ }) >+ }); >+ } >+ if (app.allows_using && app.can_install) { >+ buttons.push({ >+ name: 'install', >+ label: _("Install"), >+ callback: lang.hitch(this, function() { >+ if (app.licenseagreement) { >+ // before installing, user must agree on license terms >+ var content = '<h1>' + _('License agreement') + '</h1>'; >+ content += '<div style="max-height:250px; overflow:auto;">' + >+ this.formatTxt(app.licenseagreement) + >+ '</div>'; >+ dialog.confirm(content, [{ >+ name: 'decline', >+ label: _('Cancel'), >+ 'default': true >+ }, { >+ name: 'accept', >+ label: _('Accept license') >+ }], _('License agreement')).then(lang.hitch(this, function(response) { >+ if (response == 'accept') { > this._call_installer('install', app); > } >- }) >- }); >- } >- if (app.allows_using && app.can_update) { >- buttons.push({ >- name: 'update', >- label: _("Upgrade"), >- callback: lang.hitch(this, function() { >- this.upgradeApp(app); >- }) >- }); >- } >- if (app.can_uninstall) { >- buttons.push({ >- name: 'uninstall', >- label: _("Uninstall"), >- callback: lang.hitch(this, function() { >- this._call_installer('uninstall', app); >- }) >- }); >- if (UMCApplication.getModule(app.umc_module, app.umc_flavor)) { >- buttons.push({ >- name: 'open', >- label: _("Open"), >- callback: lang.hitch(this, function() { >- topic.publish('/umc/modules/open', app.umc_module, app.umc_flavor); >- }) >- }); >+ })); >+ } else { >+ this._call_installer('install', app); > } >- } >- // always: a button to close the dialog. >+ }) >+ }); >+ } >+ if (app.allows_using && app.can_update) { >+ buttons.push({ >+ name: 'update', >+ label: _("Upgrade"), >+ callback: lang.hitch(this, function() { >+ this.upgradeApp(app); >+ }) >+ }); >+ } >+ if (app.can_uninstall) { >+ buttons.push({ >+ name: 'uninstall', >+ label: _("Uninstall"), >+ callback: lang.hitch(this, function() { >+ this._call_installer('uninstall', app); >+ }) >+ }); >+ if (UMCApplication.getModule(app.umc_module, app.umc_flavor)) { > buttons.push({ >- name: 'cancel', >- 'default': true, >- label: _("Close") >+ name: 'open', >+ label: _("Open"), >+ callback: lang.hitch(this, function() { >+ topic.publish('/umc/modules/open', app.umc_module, app.umc_flavor); >+ }) > }); >+ } >+ } >+ // always: a button to close the dialog. >+ buttons.push({ >+ name: 'cancel', >+ 'default': true, >+ label: _("Close") >+ }); > >- var dialogText = new Text({ >- 'class': 'umcConfirmDialogText', >- content: txt >- }); >- var confirmDialog = new ConfirmDialog({ >- title: _('Application details'), >- message: dialogText, >- options: buttons >- }); >+ var dialogText = new Text({ >+ 'class': 'umcConfirmDialogText', >+ content: txt >+ }); >+ var confirmDialog = new ConfirmDialog({ >+ title: _('Application details'), >+ message: dialogText, >+ options: buttons >+ }); > >- // decorate screenshot images with a Lightbox >- var lightbox; >- query('.umcScreenshot', confirmDialog.domNode).forEach(function(imgNode) { >- lightbox = new Lightbox({ href: imgNode.src }, imgNode); >- imgNode.onload = function() { >- confirmDialog.resize(); >- }; >- }); >+ // decorate screenshot images with a Lightbox >+ var lightbox; >+ query('.umcScreenshot', confirmDialog.domNode).forEach(function(imgNode) { >+ lightbox = new Lightbox({ href: imgNode.src }, imgNode); >+ imgNode.onload = function() { >+ confirmDialog.resize(); >+ }; >+ }); > >- // connect to 'onConfirm' event to close the dialog in any case >- confirmDialog.on('confirm', function() { >- confirmDialog.close(); >- }); >+ // connect to 'onConfirm' event to close the dialog in any case >+ confirmDialog.on('confirm', function() { >+ confirmDialog.close(); >+ }); > >- // show the confirmation dialog >- confirmDialog.show(); >- >- }), >- lang.hitch(this, function() { >- this.standby(false); >- }) >- ); >+ // show the confirmation dialog >+ confirmDialog.show(); > }, > > _package_changes_one: function(changes, label) { >Index: umc/python/appcenter/__init__.py >=================================================================== >--- umc/python/appcenter/__init__.py (Revision 42129) >+++ umc/python/appcenter/__init__.py (Arbeitskopie) >@@ -135,12 +135,6 @@ > for application in applications: > if pattern.search(application.name): > props = application.to_dict(self.package_manager) >- >- # delete larger entries >- for ikey in ('readmeupdate', 'licenseagreement'): >- if ikey in props: >- del props[ikey] >- > result.append(props) > return result >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31915
: 5307