mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 10:06:26 +00:00
Initial commit
This commit is contained in:
33
manager/src/frontend/js/app/host/reconfigure.js
Normal file
33
manager/src/frontend/js/app/host/reconfigure.js
Normal file
@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
import Mn from 'backbone.marionette';
|
||||
|
||||
const template = require('./reconfigure.ejs');
|
||||
const Api = require('../api');
|
||||
const App = require('../main');
|
||||
|
||||
module.exports = Mn.View.extend({
|
||||
template: template,
|
||||
|
||||
ui: {
|
||||
buttons: 'form button',
|
||||
reconfigure: 'button.reconfigure'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click @ui.reconfigure': function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
this.ui.buttons.prop('disabled', true).addClass('btn-disabled');
|
||||
|
||||
Api.Hosts.reconfigure(this.model.get('_id'))
|
||||
.then((/*result*/) => {
|
||||
App.UI.closeModal();
|
||||
})
|
||||
.catch(err => {
|
||||
alert(err.message);
|
||||
this.ui.buttons.prop('disabled', false).removeClass('btn-disabled');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user