mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-11-04 01:15:14 +00:00 
			
		
		
		
	Merge pull request #1036 from BjoernAkAManf/master
Allows hostname instead of ip for streams
This commit is contained in:
		@@ -14,8 +14,8 @@
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col-sm-8 col-md-8">
 | 
			
		||||
                    <div class="form-group">
 | 
			
		||||
                        <label class="form-label"><%- i18n('streams', 'forward-ip') %><span class="form-required">*</span></label>
 | 
			
		||||
                        <input type="text" name="forward_ip" class="form-control text-monospace" placeholder="000.000.000.000" value="<%- forward_ip %>" autocomplete="off" maxlength="15" required>
 | 
			
		||||
                        <label class="form-label"><%- i18n('streams', 'forwarding-host') %><span class="form-required">*</span></label>
 | 
			
		||||
                        <input type="text" name="forwarding_host" class="form-control text-monospace" placeholder="example.com or 10.0.0.1 or 2001:db8:3333:4444:5555:6666:7777:8888" value="<%- forwarding_host %>" autocomplete="off" maxlength="255" required>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col-sm-4 col-md-4">
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ module.exports = Mn.View.extend({
 | 
			
		||||
 | 
			
		||||
    ui: {
 | 
			
		||||
        form:       'form',
 | 
			
		||||
        forward_ip: 'input[name="forward_ip"]',
 | 
			
		||||
        forwarding_host: 'input[name="forwarding_host"]',
 | 
			
		||||
        type_error: '.forward-type-error',
 | 
			
		||||
        buttons:    '.modal-footer button',
 | 
			
		||||
        switches:   '.custom-switch-input',
 | 
			
		||||
@@ -76,13 +76,6 @@ module.exports = Mn.View.extend({
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    onRender: function () {
 | 
			
		||||
        this.ui.forward_ip.mask('099.099.099.099', {
 | 
			
		||||
            clearIfNotMatch: true,
 | 
			
		||||
            placeholder:     '000.000.000.000'
 | 
			
		||||
        });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    initialize: function (options) {
 | 
			
		||||
        if (typeof options.model === 'undefined' || !options.model) {
 | 
			
		||||
            this.model = new StreamModel.Model();
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@
 | 
			
		||||
    </div>
 | 
			
		||||
</td>
 | 
			
		||||
<td>
 | 
			
		||||
    <div class="text-monospace"><%- forward_ip %>:<%- forwarding_port %></div>
 | 
			
		||||
    <div class="text-monospace"><%- forwarding_host %>:<%- forwarding_port %></div>
 | 
			
		||||
</td>
 | 
			
		||||
<td>
 | 
			
		||||
    <div>
 | 
			
		||||
 
 | 
			
		||||
@@ -162,7 +162,7 @@
 | 
			
		||||
      "add": "Add Stream",
 | 
			
		||||
      "form-title": "{id, select, undefined{New} other{Edit}} Stream",
 | 
			
		||||
      "incoming-port": "Incoming Port",
 | 
			
		||||
      "forward-ip": "Forward IP",
 | 
			
		||||
      "forwarding-host": "Forward Host",
 | 
			
		||||
      "forwarding-port": "Forward Port",
 | 
			
		||||
      "tcp-forwarding": "TCP Forwarding",
 | 
			
		||||
      "udp-forwarding": "UDP Forwarding",
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ const model = Backbone.Model.extend({
 | 
			
		||||
            created_on:      null,
 | 
			
		||||
            modified_on:     null,
 | 
			
		||||
            incoming_port:   null,
 | 
			
		||||
            forward_ip:      null,
 | 
			
		||||
            forwarding_host: null,
 | 
			
		||||
            forwarding_port: null,
 | 
			
		||||
            tcp_forwarding:  true,
 | 
			
		||||
            udp_forwarding:  false,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user