node-red-contrib-covid19
Version:
A node-red node to gather information about the statistics of COVID-19 (Corona) virus.
117 lines (107 loc) • 5.76 kB
HTML
/**
* Copyright 2020 Nemanja Vukmirovic
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
<script type="text/javascript">
RED.nodes.registerType('worldwide',{
category: 'COVID19',
color: '#a6bbcf',
defaults: {
name: {value:""},
infected:{value: true},
deaths:{value: true},
recovered:{value: true},
active:{value: false},
critical:{value: false},
todaycases:{value: false},
todaydeaths:{value: false},
casepermilion:{value: false},
deathspermilion:{value: false},
},
inputs:1,
outputs:1,
icon: "/icons/icon.png",
label: function() {
return this.name||"worldwide";
},
});
</script>
<script type="text/html" data-template-name="worldwide">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<p><strong> Countries:</strong></p>
</div>
<div class="form-row">
<p><strong> Cases:</strong></p>
</div>
<div class="form-row">
<label for="node-input-infected" style="width:70%;">Cases count:</label>
<input type="checkbox" id="node-input-infected" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-deaths" style="width:70%;">Deaths count:</label>
<input type="checkbox" id="node-input-deaths" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-recovered" style="width:70%;">Recovered count:</label>
<input type="checkbox" id="node-input-recovered" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-active" style="width:70%;">Active count:</label>
<input type="checkbox" id="node-input-active" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-critical" style="width:70%;">Critical count:</label>
<input type="checkbox" id="node-input-critical" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-todaycases" style="width:70%;">Today count:</label>
<input type="checkbox" id="node-input-todaycases" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-todaydeaths" style="width:70%;">Today Deaths count:</label>
<input type="checkbox" id="node-input-todaydeaths" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-casepermilion" style="width:70%;">Cases Per One Milion count:</label>
<input type="checkbox" id="node-input-casepermilion" style="display: inline-block; width: auto; vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-deathspermilion" style="width:70%;">Deaths Per One Milion count:</label>
<input type="checkbox" id="node-input-deathspermilion" style="display: inline-block; width: auto; vertical-align: top;">
</div>
</script>
<script type="text/html" data-help-name="worldwide">
<p>A simple node that returns statistics on <strong> COVID-19 (Corona) </strong>virus.</p>
<h3><strong>Outputs</strong></h3>
<ol class="node-ports">
<ul>
<li><i><strong>Cases:</strong></i>msg.covid19.cases will contain a number of infected cases. </li>
<li><i><strong>Deaths:</strong></i> msg.covid19.deaths will contain a number of death cases.</li>
<li><i><strong>Recovered:</strong></i> msg.covid19.recovered will contain a number of recovered cases.</i></li>
<li><i><strong>Active:</strong></i> msg.covid19.active will contain a number of currently active cases.</i></li>
<li><i><strong>Critical:</strong></i> msg.covid19.critical will contain a number of currently critical cases.</i></li>
<li><i><strong>Today:</strong></i> msg.covid19.todaycases will contain a number of daily new infected cases.</i></li>
<li><i><strong>Deaths Today:</strong></i> msg.covid19.todaydeaths will contain a number of daily death cases.</i></li>
<li><i><strong>Per One Milion:</strong></i> msg.covid19.casemilion will contain a number of cases per one milion of population.</i></li>
<li><i><strong>Deaths Per One Milion:</strong></i> msg.covid19.deathsmilion will contain a number of deaths per one milion of population.</i></li>
<li><i><strong>Updated:</strong></i> msg.covid19.updated will contain a timestamp of last statistics update</i></li>
<li><i><strong>Affected Countries:</strong></i> msg.covid19.affectedCountries will contain a number of infected countries</i></li>
</ul></p>
<p>
</ol>
</script>