var commonModal = require('client/components/modal_common/index');
var config = require('./config.json');
var __ = require('locale/client/dashboard.lang.json');
var request = require('../../request');

function pop(obj, parent, callback) {
  config.fields[0].info = __[config.fields[0].field].replace('{0}', obj.name);

  var props = {
    __: __,
    parent: parent,
    config: config,
    onInitialize: function(refs) {},
    onConfirm: function(refs, cb) {
      var data = {
        external_gateway_info: null
      };
      request.updateRouter(obj.id, data).then((res) => {
        callback && callback(res.router);
        cb(true);
      });
    },
    onAction: function() {}
  };

  commonModal(props);
}

module.exports = pop;

@@ -193,16 +193,100 @@
 quest');
+%0Avar getErrorMessage = require('client/applications/dashboard/utils/error_message');
 %0A%0Afuncti
@@ -719,16 +719,157 @@
 (true);%0A
+      %7D).catch(function(error) %7B%0A        cb(false, getErrorMessage(error));%0A        refs.btn.setState(%7B%0A          disabled: true%0A        %7D);%0A
       %7D)

add catch error to disable_gateway in router page