diff --git a/.wappler/migrations/MyDB/20250107052729_Added db_signatureData.js b/.wappler/migrations/MyDB/20250107052729_Added db_signatureData.js new file mode 100644 index 0000000..731bfa8 --- /dev/null +++ b/.wappler/migrations/MyDB/20250107052729_Added db_signatureData.js @@ -0,0 +1,15 @@ + +exports.up = function(knex) { + return knex.schema + .table('da', async function (table) { + table.string('db_signatureData'); + }) + +}; + +exports.down = function(knex) { + return knex.schema + .table('da', async function (table) { + table.dropColumn('db_signatureData'); + }) +}; diff --git a/.wappler/migrations/MyDB/20250107202732_Fixed trainerSelected - wrote case in field.js b/.wappler/migrations/MyDB/20250107202732_Fixed trainerSelected - wrote case in field.js new file mode 100644 index 0000000..55ab9f0 --- /dev/null +++ b/.wappler/migrations/MyDB/20250107202732_Fixed trainerSelected - wrote case in field.js @@ -0,0 +1,15 @@ + +exports.up = function(knex) { + return knex.schema + .table('da', async function (table) { + table.renameColumn('db_TrainerSelected', 'db_trainerSelected'); + }) + +}; + +exports.down = function(knex) { + return knex.schema + .table('da', async function (table) { + table.renameColumn('db_trainerSelected', 'db_TrainerSelected'); + }) +}; diff --git a/.wappler/migrations/MyDB/20250107203115_update b/.wappler/migrations/MyDB/20250107203115_update new file mode 100644 index 0000000..e69de29 diff --git a/.wappler/migrations/MyDB/20250107203140_wrong case dspshortcode.js b/.wappler/migrations/MyDB/20250107203140_wrong case dspshortcode.js new file mode 100644 index 0000000..6662fea --- /dev/null +++ b/.wappler/migrations/MyDB/20250107203140_wrong case dspshortcode.js @@ -0,0 +1,15 @@ + +exports.up = function(knex) { + return knex.schema + .table('da', async function (table) { + table.renameColumn('DSPShortCode', 'dspShortCode'); + }) + +}; + +exports.down = function(knex) { + return knex.schema + .table('da', async function (table) { + table.renameColumn('dspShortCode', 'DSPShortCode'); + }) +}; diff --git a/.wappler/migrations/MyDB/20250107221729_Removed fields to sub table.js b/.wappler/migrations/MyDB/20250107221729_Removed fields to sub table.js new file mode 100644 index 0000000..f41a750 --- /dev/null +++ b/.wappler/migrations/MyDB/20250107221729_Removed fields to sub table.js @@ -0,0 +1,21 @@ + +exports.up = function(knex) { + return knex.schema + .table('da', async function (table) { + table.dropColumn('db_employeeID'); + table.dropColumn('getStartTime'); + table.dropColumn('getEndTime'); + table.dropColumn('getStationCode'); + }) + +}; + +exports.down = function(knex) { + return knex.schema + .table('da', async function (table) { + table.string('db_employeeID', 255); + table.string('getStartTime', 255); + table.string('getEndTime', 255); + table.string('getStationCode', 255); + }) +}; diff --git a/.wappler/migrations/MyDB/20250107221912_change signatureData to text from string 255.js b/.wappler/migrations/MyDB/20250107221912_change signatureData to text from string 255.js new file mode 100644 index 0000000..723aedd --- /dev/null +++ b/.wappler/migrations/MyDB/20250107221912_change signatureData to text from string 255.js @@ -0,0 +1,15 @@ + +exports.up = function(knex) { + return knex.schema + .table('da', async function (table) { + table.text('db_signatureData').alter(); + }) + +}; + +exports.down = function(knex) { + return knex.schema + .table('da', async function (table) { + table.string('db_signatureData', 255).alter(); + }) +}; diff --git a/.wappler/migrations/MyDB/20250107222437_new table da meta for holding statuses on da.js b/.wappler/migrations/MyDB/20250107222437_new table da meta for holding statuses on da.js new file mode 100644 index 0000000..242e852 --- /dev/null +++ b/.wappler/migrations/MyDB/20250107222437_new table da meta for holding statuses on da.js @@ -0,0 +1,13 @@ + +exports.up = function(knex) { + return knex.schema + .createTable('da_meta', async function (table) { + table.increments('id'); + }) + +}; + +exports.down = function(knex) { + return knex.schema + .dropTable('da_meta') +}; diff --git a/.wappler/project.json b/.wappler/project.json index 2281e67..c00bcf9 100644 --- a/.wappler/project.json +++ b/.wappler/project.json @@ -216,6 +216,15 @@ ], "services": {} } + }, + "ssh_key": { + "ertfastfiller_ed25519": { + "ssh-key-file": "/.wappler/.ssh/ertfastfiller_ed25519.pub", + "name": "ertfastfiller_ed25519", + "type": "ed25519", + "fingerprint": "64:50:e4:41:ed:26:78:df:fb:27:4a:cf:a7:58:02:2a", + "id": 44250508 + } } } } diff --git a/.wappler/targets/Development/app/modules/connections/MyDB.json b/.wappler/targets/Development/app/modules/connections/MyDB.json index e72b15b..b830bc0 100644 --- a/.wappler/targets/Development/app/modules/connections/MyDB.json +++ b/.wappler/targets/Development/app/modules/connections/MyDB.json @@ -11,7 +11,10 @@ "password": "3qx02yqcNDOuQZUC", "database": "db_training" }, - "tz": "utc" + "tz": "utc", + "meta": {} }, - "fileName": "MyDB.json" + "fileName": "MyDB.json", + "actionFilePath": "file:///C:/WapplerProjects/app/modules/connections/MyDB.json", + "serverType": "node" } \ No newline at end of file diff --git a/.wappler/targets/Development/databases/MyDB.json b/.wappler/targets/Development/databases/MyDB.json index 8383130..cbca4a4 100644 --- a/.wappler/targets/Development/databases/MyDB.json +++ b/.wappler/targets/Development/databases/MyDB.json @@ -19,7 +19,7 @@ "nullable": false } }, - "DSPShortCode": { + "dspShortCode": { "db": { "type": "string", "maxLength": 255, @@ -43,39 +43,7 @@ "nullable": true } }, - "db_employeeID": { - "db": { - "type": "string", - "maxLength": 255, - "primary": false, - "nullable": true - } - }, - "getStartTime": { - "db": { - "type": "string", - "maxLength": 255, - "primary": false, - "nullable": true - } - }, - "getEndTime": { - "db": { - "type": "string", - "maxLength": 255, - "primary": false, - "nullable": true - } - }, - "db_TrainerSelected": { - "db": { - "type": "string", - "maxLength": 255, - "primary": false, - "nullable": true - } - }, - "getStationCode": { + "db_trainerSelected": { "db": { "type": "string", "maxLength": 255, @@ -98,6 +66,26 @@ "primary": false, "nullable": true } + }, + "db_signatureData": { + "db": { + "type": "text", + "maxLength": 65535, + "primary": false, + "nullable": true + } + } + }, + "db": {} + }, + "da_meta": { + "columns": { + "id": { + "db": { + "type": "increments", + "primary": true, + "nullable": false + } } }, "db": {} diff --git a/app/api/myInsert.json b/app/api/myInsert.json index 5378eee..6313b94 100644 --- a/app/api/myInsert.json +++ b/app/api/myInsert.json @@ -1,33 +1,64 @@ { "meta": { + "options": { + "linkedFile": "/views/index0.ejs", + "linkedForm": "serverconnectform1" + }, "$_POST": [ { "type": "text", + "fieldName": "ertDriveDate", "name": "ertDriveDate" }, { "type": "text", + "fieldName": "db_fullName", "name": "db_fullName" }, { "type": "text", - "name": "db_employeeID" - }, - { - "type": "text", - "name": "db_TrainerSelected" - }, - { - "type": "text", + "fieldName": "getStationCode", "name": "getStationCode" }, { "type": "text", + "fieldName": "db_licenseNumber", "name": "db_licenseNumber" }, { "type": "text", + "fieldName": "db_state", "name": "db_state" + }, + { + "type": "text", + "fieldName": "dspShortCode", + "name": "dspShortCode" + }, + { + "type": "text", + "fieldName": "db_stateIssue", + "name": "db_stateIssue" + }, + { + "type": "text", + "fieldName": "db_trainerSelected", + "name": "db_trainerSelected" + }, + { + "type": "text", + "fieldName": "db_signatureData", + "name": "db_signatureData" + }, + { + "type": "text", + "fieldName": "getStartTime", + "name": "getStartTime" + }, + { + "type": "text", + "fieldName": "getEndTime", + "name": "getEndTime" } ] }, @@ -46,7 +77,6 @@ "column": "ertDriveDate", "type": "text", "value": "{{$_POST.ertDriveDate}}", - "condition": "{{TIMESTAMP.formatDate('MM-dd-yyyy', false)}}", "recid": 1 }, { @@ -56,45 +86,45 @@ "value": "{{$_POST.db_fullName}}", "recid": 2 }, - { - "table": "da", - "column": "db_employeeID", - "type": "text", - "value": "{{$_POST.db_employeeID}}", - "recid": 3 - }, - { - "table": "da", - "column": "db_TrainerSelected", - "type": "text", - "value": "{{$_POST.db_TrainerSelected}}", - "recid": 4 - }, - { - "table": "da", - "column": "getStationCode", - "type": "text", - "value": "{{$_POST.getStationCode}}", - "recid": 5 - }, { "table": "da", "column": "db_licenseNumber", "type": "text", "value": "{{$_POST.db_licenseNumber}}", - "recid": 6 + "recid": 3 }, { "table": "da", "column": "db_state", "type": "text", "value": "{{$_POST.db_state}}", + "recid": 4 + }, + { + "table": "da", + "column": "db_signatureData", + "type": "text", + "value": "{{$_POST.db_signatureData}}", + "recid": 5 + }, + { + "table": "da", + "column": "dspShortCode", + "type": "text", + "value": "{{$_POST.dspShortCode}}", + "recid": 6 + }, + { + "table": "da", + "column": "db_trainerSelected", + "type": "text", + "value": "{{$_POST.db_trainerSelected}}", "recid": 7 } ], "table": "da", "returning": "id", - "query": "insert into `da` (`db_TrainerSelected`, `db_employeeID`, `db_fullName`, `db_licenseNumber`, `db_state`, `ertDriveDate`, `getStationCode`) values (?, ?, ?, ?, ?, ?, ?)", + "query": "insert into `da` (`db_fullName`, `db_licenseNumber`, `db_signatureData`, `db_state`, `db_trainerSelected`, `dspShortCode`, `ertDriveDate`) values (?, ?, ?, ?, ?, ?, ?)", "params": [ { "name": ":P1", @@ -111,31 +141,31 @@ { "name": ":P3", "type": "expression", - "value": "{{$_POST.db_employeeID}}", + "value": "{{$_POST.db_licenseNumber}}", "test": "" }, { "name": ":P4", "type": "expression", - "value": "{{$_POST.db_TrainerSelected}}", + "value": "{{$_POST.db_state}}", "test": "" }, { "name": ":P5", "type": "expression", - "value": "{{$_POST.getStationCode}}", + "value": "{{$_POST.db_signatureData}}", "test": "" }, { "name": ":P6", "type": "expression", - "value": "{{$_POST.db_licenseNumber}}", + "value": "{{$_POST.dspShortCode}}", "test": "" }, { "name": ":P7", "type": "expression", - "value": "{{$_POST.db_state}}", + "value": "{{$_POST.db_trainerSelected}}", "test": "" } ] diff --git a/app/api/myQuery.json b/app/api/myQuery.json new file mode 100644 index 0000000..7b6d089 --- /dev/null +++ b/app/api/myQuery.json @@ -0,0 +1,71 @@ +{ + "meta": { + "$_GET": [ + { + "type": "text", + "name": "sort" + }, + { + "type": "text", + "name": "dir" + } + ] + }, + "exec": { + "steps": { + "name": "Myquery", + "module": "dbconnector", + "action": "select", + "options": { + "connection": "MyDB", + "sql": { + "type": "select", + "columns": [], + "params": [], + "table": { + "name": "da" + }, + "primary": "id", + "joins": [], + "query": "select * from `da`" + } + }, + "output": true, + "meta": [ + { + "type": "number", + "name": "id" + }, + { + "type": "text", + "name": "dspShortCode" + }, + { + "type": "text", + "name": "ertDriveDate" + }, + { + "type": "text", + "name": "db_fullName" + }, + { + "type": "text", + "name": "db_trainerSelected" + }, + { + "type": "text", + "name": "db_licenseNumber" + }, + { + "type": "text", + "name": "db_state" + }, + { + "type": "text", + "name": "db_signatureData" + } + ], + "outputType": "array" + } + } +} \ No newline at end of file diff --git a/app/api/pouchQueryLicNo.json b/app/api/myUpdate.json similarity index 100% rename from app/api/pouchQueryLicNo.json rename to app/api/myUpdate.json diff --git a/app/api/push_notify.json b/app/api/push_notify.json deleted file mode 100644 index 18cca0a..0000000 --- a/app/api/push_notify.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exec": {} -} \ No newline at end of file diff --git a/app/api/query.json b/app/api/query.json index 842fa5c..37febbb 100644 --- a/app/api/query.json +++ b/app/api/query.json @@ -17,7 +17,7 @@ "module": "dbconnector", "action": "select", "options": { - "connection": "DB", + "connection": "MyDB", "sql": { "type": "select", "columns": [], @@ -25,7 +25,7 @@ "table": { "name": "da" }, - "primary": "ID", + "primary": "id", "joins": [], "query": "select * from `da`", "orders": [] @@ -35,32 +35,35 @@ "meta": [ { "type": "number", - "name": "ID" + "name": "id" + }, + { + "type": "text", + "name": "dspShortCode" + }, + { + "type": "text", + "name": "ertDriveDate" }, { "type": "text", "name": "db_fullName" }, + { + "type": "text", + "name": "db_trainerSelected" + }, { "type": "text", "name": "db_licenseNumber" }, { "type": "text", - "name": "db_stateIssue" - }, - { - "type": "number", - "name": "db_employeeID" + "name": "db_state" }, { "type": "text", - "name": "owner" - }, - { - "type": "text", - "sub": [], - "name": "db_SignatureData" + "name": "db_signatureData" } ], "outputType": "array" diff --git a/app/config/routes.json b/app/config/routes.json index 81802f9..279ed62 100644 --- a/app/config/routes.json +++ b/app/config/routes.json @@ -1,5 +1,10 @@ { "routes": [ + { + "path": "/unsuccessful", + "page": "unsuccessful", + "layout": "main" + }, { "path": "/index0", "page": "index0", diff --git a/app/modules/connections/MyDB.json b/app/modules/connections/MyDB.json index e72b15b..b830bc0 100644 --- a/app/modules/connections/MyDB.json +++ b/app/modules/connections/MyDB.json @@ -11,7 +11,10 @@ "password": "3qx02yqcNDOuQZUC", "database": "db_training" }, - "tz": "utc" + "tz": "utc", + "meta": {} }, - "fileName": "MyDB.json" + "fileName": "MyDB.json", + "actionFilePath": "file:///C:/WapplerProjects/app/modules/connections/MyDB.json", + "serverType": "node" } \ No newline at end of file diff --git a/public/dmxAppConnect/config.js b/public/dmxAppConnect/config.js index fb60b8b..a806762 100644 --- a/public/dmxAppConnect/config.js +++ b/public/dmxAppConnect/config.js @@ -61,6 +61,43 @@ dmx.config({ } ], "outputType": "array" + }, + "data_view1": { + "meta": [ + { + "type": "number", + "name": "id" + }, + { + "type": "text", + "name": "dspShortCode" + }, + { + "type": "text", + "name": "ertDriveDate" + }, + { + "type": "text", + "name": "db_fullName" + }, + { + "type": "text", + "name": "db_trainerSelected" + }, + { + "type": "text", + "name": "db_licenseNumber" + }, + { + "type": "text", + "name": "db_state" + }, + { + "type": "text", + "name": "db_signatureData" + } + ], + "outputType": "array" } } }); diff --git a/views/index0.ejs b/views/index0.ejs index 6a11b3d..6a44ab6 100644 --- a/views/index0.ejs +++ b/views/index0.ejs @@ -418,7 +418,7 @@ --> -