Tested some PouchDB.js functions.

This commit is contained in:
Wappler 2024-12-14 22:27:05 -06:00
parent b46109dc90
commit d108fe0b85
5 changed files with 36 additions and 71 deletions

View File

@ -1,5 +1,5 @@
{
"projectName": "ERTFastFiller",
"projectName": "ErtFastFill",
"styleFile": "/css/style.css",
"assetsFolder": "/assets",
"designFramework": "bootstrap5",

View File

@ -3,7 +3,7 @@
"connection": {
"host": "host.docker.internal",
"port": 9913,
"user": "trainer",
"user": "training",
"password": "sGynUdlM9cuLtUdc",
"database": "db_training"
},
@ -13,16 +13,12 @@
"schema": {
"partitioned": false,
"tables": {
"da": {
"db_training": {
"meta": [
{
"name": "_id",
"type": "objectId"
},
{
"name": "db_fullName",
"type": "text"
},
{
"name": "db_licenseNumber",
"type": "text"
@ -31,10 +27,6 @@
"name": "db_employeeID",
"type": "text"
},
{
"name": "db_signatureData",
"type": "text"
},
{
"name": "db_trainerSelected",
"type": "text"
@ -43,60 +35,10 @@
"name": "db_stateName",
"type": "text"
},
{
"name": "dummy1",
"type": "text",
"ui": {
"label": "dummy"
}
}
]
},
"ert": {
"meta": [
{
"name": "_id",
"type": "objectId"
},
{
"name": "docPDF",
"type": "text"
}
],
"db_edits": {
"name": "daData"
}
},
"driver": {
"meta": [
{
"name": "_id",
"type": "objectId"
},
{
"name": "db_fullName",
"type": "text"
},
{
"name": "db_licenseNumber",
"type": "text"
},
{
"name": "db_employeeID",
"type": "text"
},
{
"name": "db_signatureData",
"type": "text"
},
{
"name": "db_trainerSelected",
"type": "text"
},
{
"name": "db_stateName",
"type": "text"
},
{
"name": "dummy1",
"type": "text"

View File

@ -9,6 +9,25 @@ function myFunction() {
return myVar;
}
/**
// Just simple PouchDB calls to db.info and db.get to test fetch of a document
function infoCouchDB() {
const db = new PouchDB('http://localhost:9913/db_training')
db.info().then(function (info) {
console.log(info)
})
db.get('da/1734165676725').then(function (doc) {
console.log(doc)
})
}
*/
function runMyFunction() {
// alert("function run")
let result = generateRandomIdentifier(9);

View File

@ -1,10 +1,10 @@
dmx.Attribute('lazyload', 'mounted', function(node, attr) {
this.$addBinding(attr.value, function(value) {
node.classList.add('lazyload');
})
});
dmx.Attribute('lazyload-dynamic', 'mounted', function(node, attr) {
this.$addBinding(attr.value, function(value) {
node.classList.add('lazyload');
})
dmx.Attribute('lazyload', 'mounted', function(node, attr) {
this.$addBinding(attr.value, function(value) {
node.classList.add('lazyload');
})
});
dmx.Attribute('lazyload-dynamic', 'mounted', function(node, attr) {
this.$addBinding(attr.value, function(value) {
node.classList.add('lazyload');
})
});

View File

@ -1,5 +1,6 @@
<!-- Wappler include head-page="layouts/main" fontawesome_5="cdn" bootstrap5="local" is="dmx-app" id="success" appConnect="local" components="{dmxStateManagement:{}}" -->
<meta name="ac:route" content="/success">
<div class="container wappler-block p-5">
<div class="row text-center p-5">
<div class="col">
@ -11,5 +12,8 @@
<a class="btn btn-primary" href="/">Return home</a>
</div>
</div>
<button id="btn1" class="btn" onclick="infoCouchDB()">Button</button>
</div>
<script src="/js/bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pouchdb@9.0.0/dist/pouchdb.min.js"></script>
<script src="/PDF/dummyFunctions.js"></script>