1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Update 21-httprequest.html

This commit is contained in:
jonferreira 2018-11-15 17:11:40 +00:00 committed by GitHub
parent 21ce23d27d
commit 86bb5503ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,11 +25,17 @@
<option value="use" data-i18n="httpin.setby"></option> <option value="use" data-i18n="httpin.setby"></option>
</select> </select>
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="node-input-url"><i class="fa fa-globe"></i> <span data-i18n="httpin.label.url"></span></label> <label for="node-input-url"><i class="fa fa-globe"></i> <span data-i18n="httpin.label.url"></span></label>
<input id="node-input-url" type="text" placeholder="http://"> <input id="node-input-url" type="text" placeholder="http://">
</div> </div>
<div class="form-row node-input-usePayloadAsParameters-row">
<input type="checkbox" id="node-input-usePayloadAsParameters" style="display: inline-block; width: auto; vertical-align: top;">
<label for="node-input-usePayloadAsParameters" style="width: auto" data-i18n="httpin.label.usePayloadAsParameters"></label>
</div>
<div class="form-row"> <div class="form-row">
<input type="checkbox" id="node-input-usetls" style="display: inline-block; width: auto; vertical-align: top;"> <input type="checkbox" id="node-input-usetls" style="display: inline-block; width: auto; vertical-align: top;">
<label for="node-input-usetls" style="width: auto" data-i18n="httpin.use-tls"></label> <label for="node-input-usetls" style="width: auto" data-i18n="httpin.use-tls"></label>
@ -149,6 +155,7 @@
name: {value:""}, name: {value:""},
method:{value:"GET"}, method:{value:"GET"},
ret: {value:"txt"}, ret: {value:"txt"},
usePayloadAsParameters: {value: false},
url:{value:"",validate:function(v) { return (v.trim().length === 0) || (v.indexOf("://") === -1) || (v.trim().indexOf("http") === 0)} }, url:{value:"",validate:function(v) { return (v.trim().length === 0) || (v.indexOf("://") === -1) || (v.trim().indexOf("http") === 0)} },
tls: {type:"tls-config",required: false}, tls: {type:"tls-config",required: false},
proxy: {type:"http proxy",required: false} proxy: {type:"http proxy",required: false}
@ -179,6 +186,13 @@
$('#node-input-password').val(''); $('#node-input-password').val('');
} }
}); });
$("#node-input-method").change(function() {
if ($(this).val() == "GET") {
$(".node-input-usePayloadAsParameters-row").show();
} else {
$(".node-input-usePayloadAsParameters-row").hide();
}
});
if (this.credentials.user || this.credentials.has_password) { if (this.credentials.user || this.credentials.has_password) {
$('#node-input-useAuth').prop('checked', true); $('#node-input-useAuth').prop('checked', true);
} else { } else {