Commit d94b4395 authored by Juorder Antonio's avatar Juorder Antonio

fix problem with add record on dns zone, and fix with parch the returned...

fix problem with add record on dns zone, and fix with parch the returned object once added it, to add over again.
parent 6ca838ef
module.exports = {"main":{"js":"/665473bundle.js"}} module.exports = {"main":{"js":"/648276bundle.js"}}
\ No newline at end of file \ No newline at end of file
...@@ -7,7 +7,7 @@ import Constants from '../../utils/constants.jsx'; ...@@ -7,7 +7,7 @@ import Constants from '../../utils/constants.jsx';
//import * as GlobalActions from '../../action_creators/global_actions.jsx'; //import * as GlobalActions from '../../action_creators/global_actions.jsx';
import EventStore from '../../stores/event_store.jsx'; import EventStore from '../../stores/event_store.jsx';
import DomainStore from '../../stores/domain_store.jsx'; import DomainStore from '../../stores/domain_store.jsx';
import Client from '../../utils/client.jsx'; import * as Client from '../../utils/client.jsx';
import Pagination from '../pagination.jsx'; import Pagination from '../pagination.jsx';
const Labels = Constants.Labels; const Labels = Constants.Labels;
...@@ -86,6 +86,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -86,6 +86,7 @@ export default class DNSZoneForm extends React.Component {
addDNSRequest() { addDNSRequest() {
const records = this.defaultRows; const records = this.defaultRows;
const zoneDNS = this.zoneDNS; const zoneDNS = this.zoneDNS;
const domain = this.props.domain;
const request = { const request = {
name: this.props.domain.name, name: this.props.domain.name,
kind: 'Master', kind: 'Master',
...@@ -101,7 +102,7 @@ export default class DNSZoneForm extends React.Component { ...@@ -101,7 +102,7 @@ export default class DNSZoneForm extends React.Component {
const oldContent = button.innerHTML; const oldContent = button.innerHTML;
button.innerHTML = '<i className=\'fa fa-spinner fa-spin\'></i> Creando Zona DNS'; button.innerHTML = '<i className=\'fa fa-spinner fa-spin\'></i> Creando Zona DNS';
if (zoneDNS) { if (zoneDNS) {
return zoneDNS.createOrModifyRecords(records, (err, data) => { return zoneDNS.createOrModifyRecords(records, (err) => {
if (err) { if (err) {
Utils.toggleStatusButtons('.savedns', false); Utils.toggleStatusButtons('.savedns', false);
button.innerHTML = oldContent; button.innerHTML = oldContent;
...@@ -118,22 +119,35 @@ export default class DNSZoneForm extends React.Component { ...@@ -118,22 +119,35 @@ export default class DNSZoneForm extends React.Component {
}); });
} }
this.newRows = []; return Client.getZone(domain.name, (zone) => {
this.newRows = [];
DomainStore.setZoneDNS(data); DomainStore.setZoneDNS(zone);
Utils.toggleStatusButtons('.savedns', false); Utils.toggleStatusButtons('.savedns', false);
button.innerHTML = oldContent; button.innerHTML = oldContent;
return EventStore.emitToast({ return EventStore.emitToast({
type: 'success', type: 'success',
title: 'Creación Zona DNS', title: 'Creación Zona DNS',
body: 'Se ha registrado su nuevo DNS éxitoxamente.', body: 'Se ha registrado su nuevo DNS éxitoxamente.',
options: { options: {
timeOut: 6000, timeOut: 6000,
extendedTimeOut: 2500, extendedTimeOut: 2500,
closeButton: true closeButton: true
} }
});
}, () => {
return EventStore.emitToast({
type: 'error',
title: 'Creación Zona DNS',
body: 'Ha ocurrido un error al recuperar su zona DNS',
options: {
timeOut: 6000,
extendedTimeOut: 2500,
closeButton: true
}
});
}); });
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment