-
Notifications
You must be signed in to change notification settings - Fork 1
/
gphotos.html
87 lines (76 loc) · 2.28 KB
/
gphotos.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<script type="text/javascript">
RED.nodes.registerType('photo-account',
{
category: 'config',
defaults:
{
name: {value:""}
},
credentials:
{
username: {type:"text"},
password: {type:"password"}
},
label: "Gphoto Account",
});
</script>
<script type="text/x-red" data-template-name="photo-account">
<p> Google username and password:<br>
<b> Please make a new account just for this instead of pasting your google account details into node-red...<br>
</b></p>
<div class="form-row">
<label for="node-config-input-username"><i class="icon-tag"></i> Username</label>
<input type="text" id="node-config-input-username">
</div>
<div class="form-row">
<label for="node-config-input-password"><i class="icon-tag"></i> Password</label>
<input type="password" id="node-config-input-password">
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType('upload-photo',
{
category: 'Google Photos',
defaults:
{
name: {value:""},
fileName: {value:""},
albumName: {value:""},
account: {type:'photo-account', required:true},
},
inputs: 1,
outputs: 1,
icon: "arrow-in.png",
label: function()
{
return this,name || "Upload Photo";
}
});
</script>
<script type="text/x-red" data-template-name="upload-photo">
<div class="form-row">
<label for="node-input-account"><i class='fa fa-tag'></i> Account </label>
<input type='text' id='node-input-account'/>
</div>
<div class="form-row">
<label for="node-input-fileName"><i class='fa fa-tag'></i> File Name </label>
<input type='text' id='node-input-fileName'/>
</div>
<div class="form-row">
<label for="node-input-album"><i class='fa fa-tag'></i> Album </label>
<input type='text' id='node-input-albumName'/>
</div>
</script>
<script type="text/x-red" data-help-name="upload-photo">
<p>
<br> <b> fileName: </b> name of the image on the filesystem
<br> <b> albumName: </b> gphotos to insert the image into
<br><br>
Also takes an object with the following properties: <br>
<b> msg.payload </b> fileName <br>
<b> OR </b> <br>
<b> msg.payload.fileName </b> and <b> msg.payload.albumName </b>
<br>
Missing properties are filled in by the node-settings, if missing name or album nothing will be uploaded
</p>
</script>