Working beta

Data Store tracks points for sections
TODO: clean up UX
This commit is contained in:
jndaniels 2024-11-03 21:24:00 -06:00
parent bbe0bb0707
commit 9fa5286037
28 changed files with 787 additions and 128 deletions

View File

@ -0,0 +1,13 @@
exports.up = function (knex) {
return knex.schema
.renameTable('tblSection', 'tSection')
.renameTable('tSection', 'tSectionOld')
};
exports.down = function (knex) {
return knex.schema
.renameTable('tSectionOld', 'tSection')
.renameTable('tSection', 'tblSection')
};

View File

@ -7,6 +7,10 @@
"connection": {
"filename": "/public/ERTSQlite.db"
},
"tz": "utc"
}
"tz": "utc",
"meta": {}
},
"fileName": "DB.json",
"actionFilePath": "file:///Z:/temp/ERTFastFiller/app/modules/connections/DB.json",
"serverType": "node"
}

View File

@ -0,0 +1,13 @@
{
"name": "ERTDB",
"module": "dbconnector",
"action": "connect",
"options": {
"client": "sqlite3",
"connection": {
"filename": "/public/ERTSQlite.db"
},
"tz": "utc"
},
"fileName": "ERTDB.json"
}

View File

@ -61,6 +61,52 @@
}
}
}
},
"_tSections_old_20241031": {
"db": {}
},
"_tSection_old_20241031": {
"db": {}
},
"_tPoint_old_20241031": {
"db": {}
},
"tPoint": {
"db": {}
},
"tSection": {
"db": {}
},
"tblSection": {
"db": {},
"columns": {
"isSection": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
},
"numSection": {
"db": {
"type": "text",
"maxLength": 255,
"primary": false,
"unique": false,
"nullable": true
}
},
"txtSection": {
"db": {
"type": "text",
"maxLength": 255,
"primary": false,
"unique": false,
"nullable": true
}
}
}
}
},
"views": {}

View File

@ -0,0 +1,263 @@
{
"type": "sqlite3",
"connection": {
"filename": "/public/ERTSQlite.db"
},
"direct": true,
"schema": {
"tables": {
"_da_old_20241029": {
"db": {},
"columns": {
"ID": {
"db": {
"type": "integer",
"primary": true,
"unique": false,
"nullable": false
}
},
"db_fullName": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
},
"db_licenseNumber": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
},
"db_stateIssue": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
},
"db_employeeID": {
"db": {
"type": "integer",
"primary": false,
"unique": false,
"nullable": true
}
},
"owner": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
}
}
},
"da": {
"db": {},
"columns": {
"ID": {
"db": {
"type": "increments",
"primary": true,
"unique": false,
"nullable": false
}
},
"db_fullName": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
},
"db_licenseNumber": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
},
"db_stateIssue": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
},
"db_employeeID": {
"db": {
"type": "integer",
"primary": false,
"unique": false,
"nullable": true
}
},
"owner": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
}
}
},
"_tSections_old_20241031": {
"db": {},
"columns": {
"id": {
"db": {
"type": "increments",
"primary": true,
"unique": false,
"nullable": false
}
}
},
"status": {
"deleted": true
}
},
"_tSection_old_20241031": {
"db": {},
"columns": {
"id": {
"db": {
"type": "increments",
"primary": true,
"unique": false,
"nullable": false
}
},
"description": {
"db": {
"type": "string",
"maxLength": 255,
"primary": false,
"unique": false,
"nullable": true
}
}
},
"status": {
"deleted": true
}
},
"_tPoint_old_20241031": {
"db": {},
"columns": {
"id": {
"db": {
"type": "increments",
"primary": true,
"unique": false,
"nullable": false
}
},
"fText": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
}
},
"status": {
"deleted": true
}
},
"tPoint": {
"db": {},
"columns": {
"id": {
"db": {
"type": "increments",
"primary": true,
"unique": false,
"nullable": false
}
}
}
},
"tSection": {
"db": {},
"columns": {
"id": {
"db": {
"type": "increments",
"primary": true,
"unique": false,
"nullable": false
}
},
"fText": {
"db": {
"type": "string",
"maxLength": 255,
"primary": false,
"unique": false,
"nullable": true
}
}
},
"db_edits": {
"name": "tSectionOld"
},
"status": {
"modified": true
}
},
"tblSection": {
"db": {},
"columns": {
"isSection": {
"db": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true
}
},
"numSection": {
"db": {
"type": "text",
"maxLength": 255,
"primary": false,
"unique": false,
"nullable": true
}
},
"txtSection": {
"db": {
"type": "text",
"maxLength": 255,
"primary": false,
"unique": false,
"nullable": true
}
}
},
"db_edits": {
"name": "tSection"
},
"status": {
"modified": true,
"data_modified": true
},
"db_changes": []
}
},
"views": {}
}
}

Binary file not shown.

97
app/api/qSection.json Normal file
View File

@ -0,0 +1,97 @@
{
"meta": {
"options": {
"linkedFile": "/views/observationPage.ejs",
"linkedForm": "form1"
},
"$_GET": [
{
"type": "text",
"name": "sort"
},
{
"type": "text",
"name": "dir"
}
],
"$_POST": [
{
"type": "text",
"fieldName": "text1",
"name": "text1"
}
]
},
"exec": {
"steps": {
"name": "query",
"module": "dbconnector",
"action": "select",
"options": {
"connection": "DB",
"sql": {
"type": "SELECT",
"distinct": false,
"columns": [
{
"table": "tblSection",
"column": "*",
"field": "*"
}
],
"table": {
"name": "tblSection"
},
"joins": [],
"orders": [],
"params": [],
"query": "select * from `tblSection` where `tblSection`.`isSection` = ?",
"wheres": {
"condition": "AND",
"rules": [
{
"id": "tblSection.isSection",
"field": "tblSection.isSection",
"type": "string",
"operator": "equal",
"value": "1",
"data": {
"table": "tblSection",
"column": "isSection",
"type": "text",
"columnObj": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true,
"name": "isSection"
}
},
"operation": "="
}
],
"conditional": null,
"valid": true
}
}
},
"output": true,
"meta": [
{
"type": "text",
"name": "isSection"
},
{
"type": "text",
"name": "numSection"
},
{
"type": "text",
"name": "txtSection"
}
],
"type": "dbconnector_select",
"outputType": "array"
}
}
}

119
app/api/qSubSection.json Normal file
View File

@ -0,0 +1,119 @@
{
"meta": {
"$_GET": [
{
"type": "text",
"name": "sort"
},
{
"type": "text",
"name": "dir"
},
{
"type": "text",
"name": "subid"
}
]
},
"exec": {
"steps": {
"name": "query",
"module": "dbconnector",
"action": "select",
"options": {
"connection": "DB",
"sql": {
"type": "SELECT",
"distinct": false,
"columns": [
{
"table": "tblSection",
"column": "*",
"field": "*"
}
],
"table": {
"name": "tblSection"
},
"joins": [],
"orders": [],
"params": [
{
"operator": "begins_with",
"type": "expression",
"name": ":P1",
"value": "{{$_GET.subid}}",
"test": ""
}
],
"query": "select * from `tblSection` where `tblSection`.`numSection` like ? and `tblSection`.`isSection` = ?",
"wheres": {
"condition": "AND",
"rules": [
{
"id": "tblSection.numSection",
"field": "tblSection.numSection",
"type": "string",
"operator": "begins_with",
"value": "{{$_GET.subid}}",
"data": {
"table": "tblSection",
"column": "numSection",
"type": "text",
"columnObj": {
"type": "text",
"maxLength": 255,
"primary": false,
"unique": false,
"nullable": true,
"name": "numSection"
}
},
"operation": "LIKE"
},
{
"id": "tblSection.isSection",
"field": "tblSection.isSection",
"type": "string",
"operator": "equal",
"value": "0",
"data": {
"table": "tblSection",
"column": "isSection",
"type": "text",
"columnObj": {
"type": "text",
"primary": false,
"unique": false,
"nullable": true,
"name": "isSection"
}
},
"operation": "="
}
],
"conditional": null,
"valid": true
}
}
},
"output": true,
"meta": [
{
"type": "text",
"name": "isSection"
},
{
"type": "text",
"name": "numSection"
},
{
"type": "text",
"name": "txtSection"
}
],
"type": "dbconnector_select",
"outputType": "array"
}
}
}

View File

@ -0,0 +1,3 @@
{
"exec": {}
}

View File

@ -10,6 +10,11 @@
"path": "/DAPage1",
"page": "DAPage1",
"layout": "main"
},
{
"path": "/observationPage",
"page": "observationPage",
"layout": "main"
}
]
}

View File

@ -7,6 +7,10 @@
"connection": {
"filename": "/public/ERTSQlite.db"
},
"tz": "utc"
}
"tz": "utc",
"meta": {}
},
"fileName": "DB.json",
"actionFilePath": "file:///Z:/temp/ERTFastFiller/app/modules/connections/DB.json",
"serverType": "node"
}

View File

@ -0,0 +1,13 @@
{
"name": "ERTDB",
"module": "dbconnector",
"action": "connect",
"options": {
"client": "sqlite3",
"connection": {
"filename": "/public/ERTSQlite.db"
},
"tz": "utc"
},
"fileName": "ERTDB.json"
}

3
app/modules/global.json Normal file
View File

@ -0,0 +1,3 @@
{
"exec": {}
}

View File

@ -113,6 +113,22 @@ module.exports = {
});
});
req.on('timeout', () => {
req.destroy(new Error(`Request timed out after ${timeout}ms`));
if (throwErrors) {
reject(new Error(`Request timed out after ${timeout}ms`));
} else if (passErrors) {
this.res.status(504).send(`Request timed out after ${timeout}ms`);
resolve();
} else {
resolve({
status: 504,
data: `Request timed out after ${timeout}ms`
});
}
});
req.on('error', reject);
req.write(data);
req.end();

39
public/ERT.json Normal file
View File

@ -0,0 +1,39 @@
{
"section": [
{
"id": "1",
"text": "Locate & Adjust Vehicle Controls (as needed)",
"1.1": "Emergency/Parking Brake (applicable to all vehicles except Rivian)",
"1.2": "Parking controls/gear shift",
"1.3": "Vehicle Height",
"1.4": "Mirrors",
"1.5": "Lights: hazards, interior, headlights, turn signals, and auxiliary (fog)",
"1.6": "Horn",
"1.7": "Windshield wipers",
"1.8": "Window Defroster"
},
{
"id": "2",
"text": "Vehicle Handling and Braking",
"2.1": "*Secures seat belt correctly prior to starting vehicles drive system*",
"2.2": "*Eliminates use of cell phone when vehicle is in motion*",
"2.3": "Steers smoothly with minimal adjustments",
"2.4": "*Stays centered on lane of travel*",
"2.5": "Avoids curbs when turning",
"2.6": "Both hands remain on the steering wheel at 9 & 3",
"2.7": "Engages turn signals and checks blind spots prior to making turns",
"2.8": "Checks mirrors every 5-8 seconds",
"2.9": "*Obeys all traffic signs*"
},
{
"id": "3",
"text": "Braking, Slowing and Stopping",
"3.1": "Checks mirrors every 5-8 seconds",
"3.2": "Tests brakes before descending grades",
"3.3": "Stops behind crosswalks when stop lines or stop signs are present",
"3.4": "Maintains appropriate eye-lead time (looking ahead for hazards)",
"3.5": "*Safely controls vehicle by utilizing vehicles brake pedals*",
"3.6": "Safely utilizes regenerative braking as primary method of operation (EDV Only)"
}
]
}

BIN
public/ERTSQlite - Copy.db Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,115 +1,14 @@
dmx.config({
"index": {
"delConfirm": {
"meta": [
{
"sub": [
{
"sub": [
{
"name": "data",
"type": "object",
"sub": [
{
"name": "delete",
"type": "text",
"sub": [
{
"name": "affected",
"type": "number"
}
]
}
]
},
{
"name": "state",
"type": "object",
"sub": [
{
"name": "executing",
"type": "boolean"
},
{
"name": "uploading",
"type": "boolean"
},
{
"name": "processing",
"type": "boolean"
},
{
"name": "downloading",
"type": "boolean"
}
]
},
{
"name": "uploadProgress",
"type": "object",
"sub": [
{
"name": "position",
"type": "number"
},
{
"name": "total",
"type": "number"
},
{
"name": "percent",
"type": "number"
}
]
},
{
"name": "downloadProgress",
"type": "object",
"sub": [
{
"name": "position",
"type": "number"
},
{
"name": "total",
"type": "number"
},
{
"name": "percent",
"type": "number"
}
]
},
{
"name": "lastError",
"type": "object",
"sub": [
{
"name": "status",
"type": "number"
},
{
"name": "message",
"type": "text"
},
{
"name": "response",
"type": "text"
}
]
},
{
"name": "status",
"type": "number"
}
],
"name": "pageFlowSC1",
"type": "object"
}
]
}
],
"local": {}
}
"observationPage": {
"datastore1": [
{
"type": "number",
"name": "numSection"
},
{
"type": "number",
"name": "Points"
}
]
}
});

View File

@ -0,0 +1,21 @@
dmx.Attribute('bs-popover', 'mounted', function(node, attr) {
let popover = bootstrap.Popover.getInstance(node);
this.$watch(attr.value, function(value) {
node.setAttribute('data-bs-content', value || '');
});
if (!popover) {
popover = new bootstrap.Popover(node, {
placement: () => node.getAttribute('data-bs-placement') || 'auto',
title: () => node.getAttribute('popover-title') || node.getAttribute('data-bs-title') || '',
content: () => node.getAttribute('data-bs-content') || '',
});
}
return () => {
if (popover) {
popover.dispose();
}
};
});

View File

@ -0,0 +1,8 @@
/*!
App Connect Data Traversal
Version: 2.0.2
(c) 2024 Wappler.io
@build 2024-08-13 15:22:09
*/
dmx.versions.dmxDataTraversal="2.0.2",dmx.Component("data-view",{initialData:{data:[],page:1,pages:1,items:0,sort:{on:"",dir:"asc"},has:{first:!1,prev:!1,next:!1,last:!1}},attributes:{data:{type:[Array,Object],default:null},filter:{type:String,default:""},page:{type:Number,default:1},pagesize:{type:Number,default:0},sorton:{type:String,default:""},sortdir:{type:String,default:"asc",enum:["asc","desc"]}},methods:{select(t){this._updatePage(+t)},first(){this._updatePage(1)},prev(){this._updatePage(this.data.page-1)},next(){this._updatePage(this.data.page+1)},last(){this._updatePage(this.data.pages)},sort(t,e){this.props.sorton=t,this.props.sortdir=e&&"desc"==e.toLowerCase()?"desc":"asc"}},init(){this._data=[],this._items=[],this.props.data&&this._updateData(),this.props.filter?this._updateFilter():this._updateItems()},destroy(){this._filterEffect&&(this._filterEffect(),delete this._filterEffect)},performUpdate(t){t.has("filter")?this._updateFilter():t.has("data")?(this._updateData(),this._updateFilter()):t.has("sorton")||t.has("sortdir")?this._updateFilter():t.has("page")?this._updatePage(this.props.page):t.has("pagesize")&&this._updatePage(this.data.page)},_updateFilter(){this.destroy(),this.props.filter?this._filterEffect=dmx.effect((()=>{dmx.parse(this.props.filter,this),this._updateItems()})):this._updateItems()},_updateData(){this._data=dmx.repeatItems(this.props.data).map((t=>(delete(t=dmx.clone(t)).$value,delete t.$index,delete t.$key,t)))},_updateItems(){if(this._items=this._data.slice(0),this.props.filter&&(this._items=this._items.filter((t=>dmx.parse(this.props.filter,dmx.DataScope(t,this))))),this.props.sorton){const t=this.props.sorton,e=this.props.sortdir,a="desc"===e;this._items.sort(((e,s)=>a?"string"==typeof e[t]&&"string"==typeof s[t]?s[t].localeCompare(e[t]):e[t]>s[t]?-1:e[t]<s[t]?1:0:"string"==typeof e[t]&&"string"==typeof s[t]?e[t].localeCompare(s[t]):e[t]<s[t]?-1:e[t]>s[t]?1:0)),this.set("sort",{on:t,dir:e})}this.props.pagesize;const t=this._items.length;this.set({items:t}),this._updatePage(this.data.page)},_updatePage(t){const e=this.props.pagesize,a=e?Math.max(1,Math.ceil(this._items.length/e)):1,s=((t=t<1?1:t>a?a:t)-1)*e;this.set({page:t,pages:a,data:e?this._items.slice(s,s+e):this._items,has:{first:t>1,prev:t>1,next:t<a,last:t<a}})}}),dmx.Component("data-detail",{initialData:{data:[]},attributes:{data:{type:Array,default:null},key:{type:String,default:null},value:{type:[String,Number],default:null}},methods:{select(t){this.props.value=t,this._updateSelection()}},init(){this._updateData()},performUpdate(t){t.has("data")?this._updateData():t.has("value")&&this._updateSelection(!0)},_updateData(){this._data=[],this.props.data&&"object"==typeof this.props.data&&(Array.isArray(this.props.data)?this._data=this.props.data.map((t=>"object"==typeof t?t:{$value:t})):this._data=Object.entries(this.props.data).map((([t,e])=>({$key:t,$value:e})))),this._updateSelection()},_updateSelection(t){this.set("data",this._data.find((t=>t[this.props.key]===this.props.value))||null),t&&requestAnimationFrame((()=>{this.$node.querySelectorAll("form").forEach((t=>t.reset()))}))}}),dmx.Component("data-iterator",{initialData:{index:-1,value:null,has:{first:!1,prev:!1,next:!1,last:!1}},attributes:{data:{type:Array,default:null},index:{type:Number,default:0},loop:{type:Boolean,default:!1}},methods:{first(){this._data.length&&this._select(0)},prev(){this._data.length&&this._select(this.data.index-1)},next(){this._data.length&&this._select(this.data.index+1)},last(){this._data.length&&this._select(this._data.length-1)},random(){this._data.length&&this._select(Math.floor(this._data.length*Math.random()))},select(t){this._data.length&&this._select(t)}},init(){this._updateData()},performUpdate(t){t.has("data")?this._updateData():t.has("index")&&this._select(this.props.index)},_updateData(){this._data=[],this.props.data&&(Array.isArray(this.props.data)?this._data=this.props.data:console.warn(`Iterator ${this.name} expects an array as data but got ${typeof this.props.data}`),this._select(this.props.index))},_select(t){if(t=parseInt(t,10),this._data.length){const e=this._data.length-1;t<0&&(t=this.props.loop?e:0),t>e&&(t=this.props.loop?0:e),this.set({index:t,value:this._data[t],has:{first:t>0,prev:t>0,next:t<e,last:t<e}})}else this.set({index:-1,value:null,has:{first:!1,prev:!1,next:!1,last:!1}})}});
//# sourceMappingURL=dmxDataTraversal.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
/*!
App Connect Masonry
Version: 2.0.2
(c) 2024 Wappler.io
@build 2024-06-19 16:06:31
*/
dmx.Component("masonry",{extends:"repeat",attributes:{breakpoints:{type:Object,default:{}},columns:{type:Number,default:4},columnsSm:{type:Number,default:null},columnsMd:{type:Number,default:null},columnsLg:{type:Number,default:null},columnsXl:{type:Number,default:null},columnsXxl:{type:Number,default:null},gutter:{type:Number,default:15},gutterSm:{type:Number,default:null},gutterMd:{type:Number,default:null},gutterLg:{type:Number,default:null},gutterXl:{type:Number,default:null},gutterXxl:{type:Number,default:null},preserveOrder:{type:Boolean,default:!1},animated:{type:Boolean,default:!1},animationDuration:{type:Number,default:400}},methods:{reflow(){this._reflow()}},init(e){this._breakpoints={sm:480,md:768,lg:992,xl:1200,xxl:1400},this._reflow=dmx.debounce(this._reflow.bind(this)),this._resizeObserver=new ResizeObserver(this._reflow),this._resizeObserver.observe(e),window.addEventListener("resize",this._reflow),dmx.Component("repeat").prototype.init.call(this,e)},render(e){e.style.setProperty("position","relative"),this._reflow()},performUpdate(e){(e.has("repeat")||e.has("key"))&&dmx.Component("repeat").prototype.performUpdate.call(this,e),this._reflow()},destroy(){this._resizeObserver.disconnect(),window.removeEventListener("resize",this._reflow)},_reflow(e){if(e&&e.dmxMasonry)return;if(!this.children.length)return;this.$node.querySelectorAll("img").forEach((e=>{e.dmxMasonry||(e.addEventListener("load",this._reflow,{once:!0}),e.src&&(e.src=e.src),e.dmxMasonry=!0)}));let{breakpoints:t,columns:r,gutter:s}=this.props;t=Object.assign({},this._breakpoints,t),["sm","md","lg","xl","xxl"].forEach((e=>{if(window.innerWidth>=t[e]){const t=e[0].toUpperCase()+e.slice(1);r=this.props["columns"+t]||r,s=this.props["gutter"+t]||s}}));const o=Array.from(this.$node.children),n=window.getComputedStyle(this.$node),i=parseInt(n.paddingLeft)||0,l=parseInt(n.paddingRight)||0,a=Math.floor((this.$node.clientWidth-i-l-(r-1)*s)/r);for(const e of o)e.style.setProperty("box-sizing","border-box"),e.style.setProperty("width",a+"px");const p=new Event("resize");p.dmxMasonry=!0,window.dispatchEvent(p);const d=Array(r).fill(0),u=o.map((e=>e.clientHeight));o.forEach(((e,t)=>{const o=this.props.preserveOrder?t%r:d.indexOf(Math.min.apply(Math,d)),n=o*a+o*s,i=d[o];e.style.setProperty("transform",`translate3d(${n}px, ${i}px, 0px)`),u[t]&&(e.dmxMasonryInit||(e.style.setProperty("position","absolute"),this.props.animated&&e.style.setProperty("transition",`transform ${this.props.animationDuration}ms`),requestAnimationFrame((()=>e.style.setProperty("visibility","visible"))),e.dmxMasonryInit=!0,this._resizeObserver.observe(e)),d[o]+=u[t]+s)})),this.$node.style.setProperty("height",Math.max.apply(Math,d)-s+"px")}});
//# sourceMappingURL=dmxMasonry.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
dmx.databases = dmx.databases || {};
dmx.databases['PDb'] = {type: "pouchdb"}

View File

@ -2,5 +2,9 @@
"DAPage1.ejs": {
"layoutPage": "main",
"description": "Initalization page for Delivery Associate"
},
"observationPage.ejs": {
"layoutPage": "main",
"description": "Observation Page for DT"
}
}

View File

@ -26,18 +26,6 @@
<dmx-serverconnect id="DBInsert" url="/api/insert" noload="true"></dmx-serverconnect>
<div is="dmx-bs5-toasts" id="toasts1"></div>
<dmx-serverconnect id="DBSC1" url="/api/query"></dmx-serverconnect>
<script is="dmx-flow" id="DSflow1" type="text/dmx-flow">{
confirm: {
name: "DSConfirm",
outputType: "boolean",
message: "{{datastore1.data[0].da_fullName}}",
then: {
steps: {
toast.showSimple: {message: "This will remove record"}
}
}
}
}</script>
<dmx-value id="dataID"></dmx-value>
<dmx-json-datasource id="stateJSON" is="dmx-serverconnect" url="/states.json"></dmx-json-datasource>
<dmx-json-datasource id="trainerJSON" is="dmx-serverconnect" url="/trainer.json"></dmx-json-datasource>

View File

@ -23,6 +23,9 @@
<script src="/dmxAppConnect/dmxBootstrap5Toasts/dmxBootstrap5Toasts.js" defer></script>
<script src="/dmxAppConnect/dmxBootbox5/bootstrap-modbox.min.js" defer></script>
<script src="/dmxAppConnect/dmxBootbox5/dmxBootbox5.js" defer></script>
<script src="/dmxAppConnect/dmxMasonry/dmxMasonry.js" defer></script>
<script src="/dmxAppConnect/dmxBootstrap5Popovers/dmxBootstrap5Popovers.js" defer></script>
<script src="/dmxAppConnect/dmxDataTraversal/dmxDataTraversal.js" defer></script>
</head>
<body is="dmx-app" id="main">
@ -39,6 +42,7 @@
<a class="nav-item nav-link" href="#">File</a>
<a class="nav-item nav-link" href="#">Edit</a>
<a class="nav-item nav-link" href="#">About</a>
<a class="nav-item nav-link" href="/observationPage">Observation</a>
</div>
</nav>
</div>

85
views/observationPage.ejs Normal file
View File

@ -0,0 +1,85 @@
<!-- Wappler include head-page="layouts/main" fontawesome_5="cdn" bootstrap5="local" is="dmx-app" id="observationPage" appConnect="local" components="{dmxBootstrap5TableGenerator:{},dmxMasonry:{},dmxFormatter:{},dmxBootstrap5Popovers:{},dmxBootstrap5Toasts:{},dmxDataTraversal:{},dmxStateManagement:{},dmxDatastore:{}}" -->
<dmx-toggle id="toggle1" checked="true"></dmx-toggle>
<dmx-datastore id="datastore1" dmx-on:updated="toasts1.clear();toasts1.show({message: data[0].numSection+'Updated ', title: 'New Insert Added'})" dmx-on:inserted="toasts1.showSimple({message: data[0].numSection+'Inserted '})"></dmx-datastore>
<div is="dmx-bs5-toasts" id="toasts1"></div>
<dmx-serverconnect id="scQuerySubSections" url="/api/qSubSection" noload="true" dmx-param:subid="1"></dmx-serverconnect>
<dmx-serverconnect id="serverconnect1" url="/api/qSection"></dmx-serverconnect>
<meta name="ac:route" content="/observationPage">
<dmx-serverconnect id="scQuerySection" url="/api/qSection"></dmx-serverconnect>
<div class="container border border-5 rounded border-warning-subtle" id="btnMenu">
<div class="row" is="dmx-masonry" id="repeat1" dmx-bind:repeat="scQuerySection.data.query">
<div class="col">
<form id="form1" action="/api/qSection" method="post">
<input id="text1" name="text1" type="hidden" class="form-control" dmx-bind:value="numSection">
<button id="btn1" class="btn btn-primary" dmx-text="txtSection.substring(0,25)" data-bs-toggle="button" dmx-bind:value="numSection" dmx-on:click="toasts1.show({message: value, title: 'Button Value', subtitle: tableRepeat1[0].txtSection});scQuerySubSections.load({subid: value});varSelectedSection.setValue(value)">Button</button>
</form>
</div>
</div>
</div>
<div class="container" dmx-show="toggle1.checked">
<table class="table table-striped table-sm">
<thead>
<tr>
<th>Num section</th>
<th>Txt section</th>
</tr>
</thead>
<tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="scQuerySection.data.query" id="tableRepeat1">
<tr>
<td dmx-text="numSection"></td>
<td dmx-text="txtSection"></td>
</tr>
</tbody>
</table>
</div>
<button id="btn2" class="btn btn-info" dmx-on:click="toggle1.toggle()">Hide/Show</button>
<div class="container">
<table class="table">
<thead>
<tr>
<th scope="row">Points</th>
<th>Is section</th>
<th>Num section</th>
<th>Txt section</th>
</tr>
</thead>
<tbody is="dmx-repeat" dmx-generator="bs5table" id="tableRepeat2" dmx-bind:repeat="scQuerySubSections.data.query">
<tr>
<td>
<input id="pointValue" name="section" type="hidden" class="form-control" dmx-bind:value="numSection">
<select id="selPoints" class="form-select" name="sPoints" dmx-on:changed="datastore1.upsert({numSection: pointValue.value, $id: numSection},{numSection: pointValue.value, Points: value})">
<option value="0">0 points</option>
<option value="1">1 point</option>
<option value="2">2 points</option>
<option value="10">Did Not Demonstrate</option>
</select>
</td>
<td dmx-text="isSection"></td>
<td dmx-text="numSection"></td>
<td dmx-text="txtSection"></td>
</tr>
</tbody>
</table>
</div>
<div class="container" id="DS">
<table class="table">
<thead>
<tr>
<th>$id</th>
<th>Num section</th>
<th>Points</th>
</tr>
</thead>
<tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="datastore1.data" id="tableRepeat3">
<tr>
<td dmx-text="$id"></td>
<td dmx-text="numSection"></td>
<td dmx-text="Points"></td>
</tr>
</tbody>
</table>
</div>