Skip to content

Support environment, string and credentials for accountname and key. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
AZURE_ACCOUNTNAME=
AZURE_KEY=
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ $RECYCLE.BIN/
# Node.js dependencies
node_modules
node_modules/*
# Lock files should not be committed
package-lock.json
# Add nodered folder for docker container
nodered/*
!nodered/.gitkeep

# Tar G-Zipped files
*.tgz
Expand Down Expand Up @@ -57,3 +62,8 @@ Temporary Items

# VS Code
.vscode
!.vscode/lauch.json

====
# env file
.env
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Dockerfile
docker-compose.yml
.env
.gitignore
.env-sample
.git
.vscode
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Node-RED",
"address": "localhost",
"port": 9229,
"localRoot": "${workspaceFolder}",
"remoteRoot": "/package_src"
}
]
}
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM nodered/node-red:4.0.8

FROM nodered/node-red:4.0.8-22

# package
USER root

COPY ./ /package_src/
RUN cd /package_src/ && npm install


RUN npm install /package_src/

# defaults
USER node-red

ENTRYPOINT ["./entrypoint.sh"]

36 changes: 31 additions & 5 deletions azuretablestorage.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,44 @@
color: '#00abec',
defaults: {
name: { value: "Azure Table Storage" },
debug: { value: false }
debug: { value: false },
accountname: { value: "", required: true },
accountname_type: { value: "str" },
key: { value: "", required: true },
key_type: { value: "str" },
},
inputs: 1,
outputs: 1,
icon: "azurestorage.png",
label: function () {
return this.name || "Azure Table Storage";
},
credentials: {
accountname: { type: "text" },
key: { type: "text" }
}
oneditprepare: function () {
$('#node-input-accountname').typedInput({
default: 'str',
types: ['str', 'cred', 'env'],
});

$('#node-input-accountname').typedInput('value', this.accountname);
$('#node-input-accountname').typedInput('type', this.accountname_type);


$('#node-input-key').typedInput({
default: 'str',
types: ['str', 'cred', 'env'],
});

$('#node-input-key').typedInput('value', this.key);
$('#node-input-key').typedInput('type', this.key_type);

},
oneditsave: function () {
this.accountname = $('#node-input-accountname').typedInput('value');
this.accountname_type = $('#node-input-accountname').typedInput('type');

this.key = $('#node-input-key').typedInput('value');
this.key_type = $('#node-input-key').typedInput('type');
},
});
</script>

Expand Down
Loading