Add warning of too large interval for feedparser

To close #408
This commit is contained in:
Dave Conway-Jones
2018-03-11 21:10:37 +00:00
parent 0253f67882
commit f92f16fd08
4 changed files with 11 additions and 8 deletions

View File

@@ -6,7 +6,7 @@
</div>
<div class="form-row">
<label for="node-input-interval"><i class="fa fa-repeat"></i> <span data-i18n="feedparse.label.refresh"></span></label>
<input type="text" id="node-input-interval" style="width: 50px"> <span data-i18n="feedparse.label.minutes"></span>
<input type="text" id="node-input-interval" style="width:60px"> <span data-i18n="feedparse.label.minutes"></span>
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
@@ -19,6 +19,7 @@
<p>The <code>msg.topic</code> contains the original article link. The <code>msg.payload</code>
contains the description, and <code>msg.article</code> contains the complete article object,
which has properties such as <code>.title</code>, <code>.summary</code>, <code>.date</code> and so on.</p>
<p>The Refresh interval cannot be greater than 35790 minutes (approx 24.8 days).
</script>
<script type="text/javascript">
@@ -28,13 +29,13 @@
defaults: {
name: {value:""},
url: {value:"", required:true},
interval: { value:15, required: true,validate:RED.validators.number()}
interval: { value:15, required:true, validate:function(v) {return (!isNaN(parseInt(v)) && (parseInt(v) <= 35790))} }
},
inputs:0,
outputs:1,
icon: "feed.png",
label: function() {
return this.name||this.url;
return this.name||this.url||"feedparser";
},
labelStyle: function() {
return this.name?"node_label_italic":"";