Univention Bugzilla – Attachment 5432 Details for
Bug 25100
Kein Default-Button im Bestätigungsdialog
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Default button in umc-module-services
bug25100.patch (text/plain), 5.19 KB, created by
Dirk Wiesenthal
on 2013-09-16 09:15:31 CEST
(
hide
)
Description:
Default button in umc-module-services
Filename:
MIME Type:
Creator:
Dirk Wiesenthal
Created:
2013-09-16 09:15:31 CEST
Size:
5.19 KB
patch
obsolete
>Index: umc/js/services.js >=================================================================== >--- umc/js/services.js (Revision 44049) >+++ umc/js/services.js (Arbeitskopie) >@@ -70,9 +70,10 @@ > callback: lang.hitch(this, function(data) { > if (data.length) { > var command = 'services/start'; >+ var action = _('Start services'); > var confirmMessage = _('Please confirm to start the following services: '); > var errorMessage = _('Starting the following services failed: '); >- this._changeState(data, command, confirmMessage, errorMessage); >+ this._changeState(data, command, action, confirmMessage, errorMessage); > } > }), > isStandardAction: false, >@@ -83,9 +84,10 @@ > callback: lang.hitch(this, function(data) { > if (data.length) { > var command = 'services/stop'; >+ var action = _('Stop services'); > var confirmMessage = _('Please confirm to stop the following services: '); > var errorMessage = _('Stopping the following services failed: '); >- this._changeState(data, command, confirmMessage, errorMessage); >+ this._changeState(data, command, action, confirmMessage, errorMessage); > } > }), > isStandardAction: false, >@@ -96,9 +98,10 @@ > callback: lang.hitch(this, function(data) { > if (data.length) { > var command = 'services/restart'; >+ var action = _('Restart services'); > var confirmMessage = _('Please confirm to restart the following services: '); > var errorMessage = _('Restarting the following services failed: '); >- this._changeState(data, command, confirmMessage, errorMessage); >+ this._changeState(data, command, action, confirmMessage, errorMessage); > } > }), > isStandardAction: false, >@@ -108,9 +111,10 @@ > label: _('Start automatically'), > callback: lang.hitch(this, function(data) { > var command = 'services/start_auto'; >+ var action = _('Start automatically'); > var confirmMessage = _('Please confirm to automatically start the following services: '); > var errorMessage = _('Could not change start type of the following services: '); >- this._changeState(data, command, confirmMessage, errorMessage); >+ this._changeState(data, command, action, confirmMessage, errorMessage); > }), > isStandardAction: false, > isMultiAction: true >@@ -119,9 +123,10 @@ > label: _('Start manually'), > callback: lang.hitch(this, function(data) { > var command = 'services/start_manual'; >+ var action = _('Start manually'); > var confirmMessage = _('Please confirm to manually start the following services: '); > var errorMessage = _('Could not change start type of the following services: '); >- this._changeState(data, command, confirmMessage, errorMessage); >+ this._changeState(data, command, action, confirmMessage, errorMessage); > }), > isStandardAction: false, > isMultiAction: true >@@ -130,9 +135,10 @@ > label: _('Start never'), > callback: lang.hitch(this, function(data) { > var command = 'services/start_never'; >+ var action = _('Start never'); > var confirmMessage = _('Please confirm to never start the following services: '); > var errorMessage = _('Could not change start type of the following services: '); >- this._changeState(data, command, confirmMessage, errorMessage); >+ this._changeState(data, command, action, confirmMessage, errorMessage); > }), > isStandardAction: false, > isMultiAction: true >@@ -207,9 +213,9 @@ > titlePane.addChild(this._searchWidget); > > this._page.startup(); >- }, >+ }, > >- _changeState: function(data, command, confirmMessage, errorMessage) { >+ _changeState: function(data, command, action, confirmMessage, errorMessage) { > confirmMessage += '<ul>'; > array.forEach(data, function(idata) { > confirmMessage += '<li>' + idata + '</li>'; >@@ -217,30 +223,25 @@ > confirmMessage += '</ul>'; > > dialog.confirm(confirmMessage, [{ >- label: _('OK'), >+ label: _('Cancel'), >+ 'default': true >+ }, { >+ label: action, > callback: lang.hitch(this, function() { >- this.standby(true); >- tools.umcpCommand(command, data).then( >- lang.hitch(this, function(response) { >- this.standby(false); >- if (response.result.success === false) { >- errorMessage += '<ul>'; >- array.forEach(response.result.objects, function(item) { >- errorMessage += '<li>' + item + '</li>'; >- }); >- errorMessage += '</ul>'; >- dialog.alert(errorMessage); >- } >- data = this._searchWidget.get('value'); >- this._grid.filter(data); >- }), lang.hitch(this, function() { >- this.standby(false); >- }) >- ); >+ var operation = tools.umcpCommand(command, data).then(lang.hitch(this, function(response) { >+ if (response.result.success === false) { >+ errorMessage += '<ul>'; >+ array.forEach(response.result.objects, function(item) { >+ errorMessage += '<li>' + item + '</li>'; >+ }); >+ errorMessage += '</ul>'; >+ dialog.alert(errorMessage); >+ } >+ data = this._searchWidget.gatherFormValues(); >+ this._grid.filter(data); >+ })); >+ this.standbyDuring(operation); > }) >- }, { >- 'default': true, >- label: _('Cancel') > }]); > } > });
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 25100
: 5432