-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgit-nodes.html
More file actions
101 lines (101 loc) · 3.84 KB
/
Copy pathgit-nodes.html
File metadata and controls
101 lines (101 loc) · 3.84 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<script type='text/javascript'>
RED.nodes.registerType('git-nodes', {
category: 'advanced',
color: '#888888',
defaults: {
label: { value: '' },
branch: { value: 'master' },
sourcebranch: { value: 'master' },
gitadd: { value: 'settings.js,package.json,.config.json,lib' },
gitrmcache: { value: 'nodes/*/x,nodes/*/y,nodes/*/z' },
debugging: { value: true},
git: { type: "git-nodes-config", required: false }
},
inputs: 0,
outputs: 0,
icon: 'icon.png',
label: function () {
return this.name || "git nodes";
},
button: {
onclick: function() {
//alert("")
var commitMessage = prompt("Input commit message")
//alert(commitMessage)
var node = this;
$.ajax({
url: "git-nodes/"+this.id,
data: { commitMessage: commitMessage },
type:"post",
success: function(resp) {
RED.notify(node._("git command success",{label:"git"}),"success");
},
error: function(jqXHR,textStatus,errorThrown) {
RED.notify(node._("git command error",{label:"git"}),"error");
}
});
}
}
});
</script>
<script type='text/x-red' data-template-name='git-nodes'>
<div class='form-row'>
<label for='node-input-label' style='width:150px;'><i class='fa fa-tag'></i> Name</label>
<input type='text' id='node-input-label' placeholder='' style='width:60%;'>
</div>
<div class="form-row">
<label for="node-input-branch" style='width:150px;'><i class="fa fa-pagelines"></i> branch</label>
<input type="text" id="node-input-branch" placeholder='master' style='width:60%;'>
</div>
<div class="form-row">
<label for="node-input-sourcebranch" style='width:150px;'><i class="fa fa-pagelines"></i> source branch</label>
<input type="text" id="node-input-sourcebranch" placeholder='master' style='width:60%;'>
<div style="padding-left:160px;">Source branch when creating a new branch</div>
</div>
<div class="form-row">
<label for="node-input-gitadd" style='width:150px;'><i class="fa fa-plus-circle"></i> git add</label>
<input type="text" id="node-input-gitadd" placeholder='settings.js,package.json' style='width:60%;'>
</div>
<div class="form-row">
<label for="node-input-gitrmcache" style='width:150px;'><i class="fa fa-minus-circle"></i> git rm</label>
<input type="text" id="node-input-gitrmcache" placeholder='nodes/*/x,nodes/*/y,nodes/*/z' style='width:60%;'>
</div>
<div class="form-row">
<label style='width:150px;'><i class="fa fa-sign-in"></i> Turns on debugging</label>
<input type="checkbox" id="node-input-debugging" style="display: inline-block; width: auto; vertical-align: top;">
<label for="node-input-debugging" style="width: 60%;"> </label>
</div>
<hr />
<div class="form-row">
<label for="node-input-git" style='width:150px;'><i class="fa fa-code-fork"></i> git repository</label>
<input type="text" id="node-input-git" style='width:60%;'>
</div>
</script>
<script type='text/x-red' data-help-name='git-nodes'>
<dl>
<dt>Press button</dt>
<dd>
git init<br />
git remote add origin<br />
git config --local user.name<br />
git config --local user.email<br />
git add flows.json<br />
git add xxx<br />
git rm --cached xxx<br />
git status<br />
git commit -m "xxx"<br />
git push -u origin master
</dd>
</dl>
<hr />
<dl>
<dt>git add</dt>
<dd>Input file name by Comma Separated Value.</dd>
<dt>git rm</dt>
<dd>Input file name by Comma Separated Value.</dd>
<dt>Turns on debugging</dt>
<dd>Show results on debug tab.</dd>
<dt>git repository (ssh)</dt>
<dd>ex: git@github.com:high-u/node-red-git-test.git</dd>
</dl>
</script>