2013-11-03 22:29:20 +01:00
|
|
|
|
2020-03-01 18:06:22 +01:00
|
|
|
<script type="text/html" data-template-name="MySQLdatabase">
|
2013-11-03 22:29:20 +01:00
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-config-input-host"><i class="fa fa-globe"></i> <span data-i18n="mysql.label.host"></span></label>
|
2015-01-19 10:46:29 +01:00
|
|
|
<input type="text" id="node-config-input-host">
|
2013-11-03 22:29:20 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-config-input-port"><i class="fa fa-random"></i> <span data-i18n="mysql.label.port"></span></label>
|
2015-01-19 10:46:29 +01:00
|
|
|
<input type="text" id="node-config-input-port">
|
2013-11-03 22:29:20 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-config-input-user"><i class="fa fa-user"></i> <span data-i18n="mysql.label.user"></span></label>
|
2015-01-19 10:46:29 +01:00
|
|
|
<input type="text" id="node-config-input-user">
|
2013-11-03 22:29:20 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-config-input-pass"><i class="fa fa-lock"></i> <span data-i18n="mysql.label.password"></label>
|
2015-01-19 10:46:29 +01:00
|
|
|
<input type="password" id="node-config-input-password">
|
2013-11-03 22:29:20 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-config-input-db"><i class="fa fa-database"></i> <span data-i18n="mysql.label.database"></span></label>
|
2015-01-19 10:46:29 +01:00
|
|
|
<input type="text" id="node-config-input-db">
|
2013-11-03 22:29:20 +01:00
|
|
|
</div>
|
2014-07-04 18:26:20 +02:00
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-config-input-tz"><i class="fa fa-clock-o"></i> <span data-i18n="mysql.label.timezone"></span></label>
|
2015-01-19 10:46:29 +01:00
|
|
|
<input type="text" id="node-config-input-tz">
|
2014-07-04 18:26:20 +02:00
|
|
|
</div>
|
2020-04-18 19:03:59 +02:00
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-config-input-charset"><i class="fa fa-language"></i> <span data-i18n="mysql.label.charset"></span></label>
|
2020-04-18 19:03:59 +02:00
|
|
|
<input type="text" id="node-config-input-charset">
|
|
|
|
</div>
|
2020-03-20 15:59:08 +01:00
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
|
|
|
<input type="text" id="node-config-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
2020-03-20 15:59:08 +01:00
|
|
|
</div>
|
2013-11-03 22:29:20 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('MySQLdatabase',{
|
|
|
|
category: 'config',
|
|
|
|
defaults: {
|
2020-03-20 15:59:08 +01:00
|
|
|
name: {value:""},
|
2013-11-03 22:29:20 +01:00
|
|
|
host: {value:"127.0.0.1",required:true},
|
|
|
|
port: {value:"3306",required:true},
|
2014-07-04 18:26:20 +02:00
|
|
|
db: {value:"",required:true},
|
2020-04-18 19:03:59 +02:00
|
|
|
tz: {value:""},
|
|
|
|
charset: {value:"UTF8"}
|
2013-11-03 22:29:20 +01:00
|
|
|
},
|
2015-01-19 10:46:29 +01:00
|
|
|
credentials: {
|
|
|
|
user: {type: "text"},
|
|
|
|
password: {type: "password"}
|
|
|
|
},
|
2013-11-03 22:29:20 +01:00
|
|
|
label: function() {
|
2020-03-20 15:59:08 +01:00
|
|
|
return this.name || this.db;
|
2013-11-03 22:29:20 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2020-03-01 18:06:22 +01:00
|
|
|
<script type="text/html" data-template-name="mysql">
|
2013-11-03 22:29:20 +01:00
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-input-mydb"><i class="fa fa-database"></i> <span data-i18n="mysql.label.database"></label>
|
2013-11-03 22:29:20 +01:00
|
|
|
<input type="text" id="node-input-mydb">
|
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2021-10-27 14:42:27 +02:00
|
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
|
|
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
2013-11-03 22:29:20 +01:00
|
|
|
</div>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('mysql',{
|
|
|
|
category: 'storage-input',
|
|
|
|
color:"#e97b00",
|
|
|
|
defaults: {
|
|
|
|
mydb: {type:"MySQLdatabase",required:true},
|
|
|
|
name: {value:""}
|
|
|
|
},
|
|
|
|
inputs:1,
|
|
|
|
outputs:1,
|
|
|
|
icon: "db.png",
|
|
|
|
label: function() {
|
|
|
|
var levelNode = RED.nodes.node(this.mydb);
|
|
|
|
return this.name||(levelNode?levelNode.label():"mysql");
|
|
|
|
},
|
2020-03-20 15:59:08 +01:00
|
|
|
labelStyle: function() {
|
2013-11-03 22:29:20 +01:00
|
|
|
return this.name?"node_label_italic":"";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|