Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
JonL1 authored Feb 7, 2022
0 parents commit d1a14c6
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
35 changes: 35 additions & 0 deletions fakevars.hjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[
{
type: 'fakevars',
module : 'fakevars',
action : 'assign',
groupTitle : 'Fakevars',
groupIcon : 'fad fa-lg fa-equals comp-flows',
title : 'Fakevars - @@var(name)@@',
icon : 'fad fa-lg fa-equals comp-flows',
properties : [
{
group: 'Info',
variables: [
{ name: 'info_Text', type: 'static', help: '🧪 EXPERIMENTAL</br>ℹ️ This action will only run if your NODE_ENV is set to development</br>☢️ Do not store sensitive data and then leave the code publicly available.'}
]},
{
group: 'Variables',
variables: [
{ name: 'get', optionName: 'getvars', key: 'var', keyValue: 'value', title: 'GET', type: 'grid', defaultValue: {}, serverDataBindings: true,
columns: [
{ field: 'var', caption: 'Name', size: '30%', editable: {type: 'text'}},
{ field: 'value', caption: 'Value', size: '70%', editable: {type: 'datapicker'}}]},
{ name: 'post', optionName: 'postvars', key: 'var', keyValue: 'value', title: 'POST', type: 'grid', defaultValue: {}, serverDataBindings: true,
columns: [
{ field: 'var', caption: 'Name', size: '30%', editable: {type: 'text'}},
{ field: 'value', caption: 'Value', size: '70%', editable: {type: 'datapicker'}}]},
]},
{
group: 'Output',
variables: [
{ name: 'output', optionName: 'output', title: 'Output', initValue: false, defaultValue: false, type: 'boolean'}
]}
]
}
]
22 changes: 22 additions & 0 deletions fakevars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
assign: function (options) {
if (process.env.NODE_ENV == 'development') {
options = this.parse(options)
if (options.getvars) {
this.set({
$_GET: options.getvars
});
}
if (options.postvars) {
this.set({
$_POST: options.postvars
});
}
return {
"$_GET": this.global.data.$_GET,
"$_POST": this.global.data.$_POST
}
}
}
}

0 comments on commit d1a14c6

Please sign in to comment.