- unless @edit[:new][:emstype].blank?
  .form-group
    %label.control-label.col-md-2
      = _('Hostname or IP address')
    .col-md-8
      = text_field_tag("hostname",
        @edit[:new][:hostname],
        :maxlength         => MAX_HOSTNAME_LEN,
        "class"            => "form-control",
        "data-miq_observe" => {:interval => '.5', :url => url}.to_json,
        :title             => _('Hostname or IPv4/IPv6 address'))
  .form-group
    %label.control-label.col-md-2
      = _('Port')
    .col-md-8
      = text_field_tag("port",
        @edit[:new][:port],
        :maxlength         => 5,
        "class"            => "form-control",
        "data-miq_observe" => {:interval => '.5', :url => url}.to_json)

- unless @edit[:new][:emstype].blank?
  .form-group
    %label.control-label.col-md-2
      = _('Hostname or IP address')
    .col-md-4
      = text_field_tag("hostname",
        @edit[:new][:hostname],
        :maxlength         => MAX_HOSTNAME_LEN,
        "class"            => "form-control",
        "data-miq_observe" => {:interval => '.5', :url => url}.to_json,
        :title             => _('Hostname or IPv4/IPv6 address'))
  .form-group
    %label.control-label.col-md-2
      = _('Port')
    .col-md-2
      = text_field_tag("port",
        @edit[:new][:port],
        :maxlength         => 5,
        "class"            => "form-control",
        "data-miq_observe" => {:interval => '.5', :url => url}.to_json)

Reduce IP and port input field length
Reduce IP and port input field length