mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Move render showEmpty into function
This commit is contained in:
parent
30a9d3ae8d
commit
181f163cb5
@ -38,6 +38,21 @@ module.exports = Mn.View.extend({
|
|||||||
console.error(err);
|
console.error(err);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showEmpty: function() {
|
||||||
|
let manage = App.Cache.User.canManage('redirection_hosts');
|
||||||
|
|
||||||
|
this.showChildView('list_region', new EmptyView({
|
||||||
|
title: App.i18n('redirection-hosts', 'empty'),
|
||||||
|
subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}),
|
||||||
|
link: manage ? App.i18n('redirection-hosts', 'add') : null,
|
||||||
|
btn_color: 'yellow',
|
||||||
|
permission: 'redirection_hosts',
|
||||||
|
action: function () {
|
||||||
|
App.Controller.showNginxRedirectionForm();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
regions: {
|
regions: {
|
||||||
list_region: '@ui.list_region'
|
list_region: '@ui.list_region'
|
||||||
},
|
},
|
||||||
@ -78,18 +93,7 @@ module.exports = Mn.View.extend({
|
|||||||
if (response && response.length) {
|
if (response && response.length) {
|
||||||
view.showData(response);
|
view.showData(response);
|
||||||
} else {
|
} else {
|
||||||
let manage = App.Cache.User.canManage('redirection_hosts');
|
view.showEmpty();
|
||||||
|
|
||||||
view.showChildView('list_region', new EmptyView({
|
|
||||||
title: App.i18n('redirection-hosts', 'empty'),
|
|
||||||
subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}),
|
|
||||||
link: manage ? App.i18n('redirection-hosts', 'add') : null,
|
|
||||||
btn_color: 'yellow',
|
|
||||||
permission: 'redirection_hosts',
|
|
||||||
action: function () {
|
|
||||||
App.Controller.showNginxRedirectionForm();
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user