Skip to content

Commit 69ac165

Browse files
authored
Merge pull request #59 from skylord123/fixes
Bunch of fixes and an improvement
2 parents cd6e638 + f6f2ab2 commit 69ac165

13 files changed

+364
-332
lines changed

src/docker-config-actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ module.exports = function (RED: Red) {
147147
}
148148

149149

150-
RED.httpAdmin.post("/configSearch", function (req, res) {
150+
RED.httpAdmin.post("/configSearch", RED.auth.needsPermission('flows.write'), function (req, res) {
151151
RED.log.debug("POST /configSearch");
152152

153153
const nodeId = req.body.id;

src/docker-configuration.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
<script type="text/x-red" data-template-name="docker-configuration">
2424
<div class="form-row">
25-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
26-
<input type="text" id="node-input-name">
25+
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
26+
<input type="text" id="node-config-input-name">
2727
</div>
2828
<div class="form-row">
2929
<label for="node-config-input-host"><i class="icon-bookmark"></i> Host/Path to docker.sock</label>

src/docker-configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = function (RED: Red) {
2323

2424
let node: DockerConfiguration = this;
2525
node.host = n.host;
26-
node.port = n.port;
26+
node.port = n.port || "2375";
2727
node.options = n.options;
2828
node.ca = n.ca;
2929
node.key = n.key;

src/docker-container-actions.html

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
imagetype: { value: "" },
1616
pullimage: { value: false },
1717
deletecontainer: { value: false },
18+
outputFinished: { value: false },
1819
stream: { value: false },
19-
createOptions: {},
20-
startOptions: {},
20+
createOptions: { value: "{}" },
21+
startOptions: { value: "{}" },
2122
createOptionsType: {},
2223
startOptionsType: {}
2324
},
@@ -74,28 +75,35 @@
7475
let name = element.Names[0].replace('/', '');
7576
dataArray.push(name);
7677
});
78+
console.log("dataArray", dataArray);
7779
});
7880

79-
80-
8181
$("#node-input-container").typedInput({
82-
types: ["str", "msg"],
83-
typeField: "#node-input-containertype",
84-
autoComplete: function (val) {
85-
var matches = [];
86-
dataArray.forEach(v => {
87-
var i = v.toLowerCase().indexOf(val.toLowerCase());
88-
if (i > -1) {
89-
matches.push({
90-
value: v,
91-
label: v,
92-
i: i
93-
})
82+
type: "node-input-container",
83+
types: [
84+
{
85+
value: "str",
86+
label: "string",
87+
icon: "red/images/typedInput/az.svg",
88+
autoComplete: function (val) {
89+
console.log("autocomplete", val);
90+
var matches = [];
91+
dataArray.forEach(v => {
92+
var i = v.toLowerCase().indexOf(val.toLowerCase());
93+
if (i > -1) {
94+
matches.push({
95+
value: v,
96+
label: v,
97+
i: i
98+
})
99+
}
100+
});
101+
matches.sort(function (A, B) { return A.i - B.i })
102+
return matches
94103
}
95-
});
96-
matches.sort(function (A, B) { return A.i - B.i })
97-
return matches
98-
}
104+
},
105+
"msg"
106+
],
99107
});
100108

101109
$("#node-input-image").typedInput({
@@ -205,13 +213,13 @@
205213
<i id="node-config-lookup-uuid-icon" class="fa fa-plus-square"></i>
206214
</a>
207215
</div>
208-
<div class="form-row" id="options">
216+
<div class="form-row">
209217
<label for="node-input-image"><i class="icon-tag"></i> Image</label>
210218
<input type="text" id="node-input-image">
211219
<input type="hidden" id="node-input-imagetype">
212220

213221
</div>
214-
<div class="form-row" id="options">
222+
<div class="form-row">
215223
<label for="node-input-options"><i class="icon-tag"></i> Options/Command</label>
216224
<input type="text" id="node-input-options">
217225
<input type="hidden" id="node-input-optionstype">
@@ -222,23 +230,26 @@
222230
<input type="checkbox" id="node-input-stream" style="width:auto">
223231
</div>
224232
<div id="pull-options">
225-
<div class="form-row" id="options">
233+
<div class="form-row">
226234
<label for="node-input-createOptions"><i class="icon-tag"></i> createOptions</label>
227235
<input type="text" id="node-input-createOptions">
228236
<input type="hidden" id="node-input-createOptionsType">
229237

230238
</div>
231-
<div class="form-row" id="options">
239+
<div class="form-row">
232240
<label for="node-input-startOptions"><i class="icon-tag"></i> startOptions</label>
233241
<input type="text" id="node-input-startOptions">
234242
<input type="hidden" id="node-input-startOptionsType">
235-
236243
</div>
237-
<div class="form-row" >
244+
<div class="form-row">
238245
<label for="node-input-deletecontainer"><i class="icon-tag"></i> Delete Container after run</label>
239246
<input type="checkbox" id="node-input-deletecontainer" style="width:auto">
240247
</div>
241-
<div class="form-row" >
248+
<div class="form-row">
249+
<label for="node-input-outputFinished"><i class="icon-tag"></i> Output full stdout on finish</label>
250+
<input type="checkbox" id="node-input-outputFinished" style="width:auto">
251+
</div>
252+
<div class="form-row">
242253
<label for="node-input-pullimage"><i class="icon-tag"></i> Pull Image Always</label>
243254
<input type="checkbox" id="node-input-pullimage" style="width:auto">
244255
<div class="form-tips" id="hint_v1">

0 commit comments

Comments
 (0)