From a88d85d3bc6736a47f594bce817db4b555fc089b Mon Sep 17 00:00:00 2001 From: Jason Tudisco Date: Sat, 29 Jan 2022 01:26:33 -0600 Subject: [PATCH] Moving some UI files and create no UI elements. Also updates to sqlite plugin. --- .gitignore | 80 ++-- .parcelrc | 10 +- index.html | 40 +- src/css/main.css | 60 +-- src/data/interfaces.js | 68 +-- src/data/sqlite-electron-ipc.js | 150 +++---- src/data/sqlite.js | 528 ++++++++++++------------ src/ui/app.riot | 5 + src/ui/timechain-input.riot | 0 src/ui/timer-ctrl.riot | 0 timestamp.riot => src/ui/timestamp.riot | 66 +-- start.js | 12 +- 12 files changed, 512 insertions(+), 507 deletions(-) create mode 100644 src/ui/app.riot create mode 100644 src/ui/timechain-input.riot create mode 100644 src/ui/timer-ctrl.riot rename timestamp.riot => src/ui/timestamp.riot (94%) diff --git a/.gitignore b/.gitignore index 40dcb6e..f407c9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,40 +1,40 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* -.npm - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -# Dependency directories -node_modules/ -jspm_packages/ - - -# dotenv environment variable files -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# IDEs - -.vscode -.idea - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# build directory -dist/ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* +.npm + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# Dependency directories +node_modules/ +jspm_packages/ + + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# IDEs + +.vscode +.idea + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# build directory +dist/ diff --git a/.parcelrc b/.parcelrc index e556282..321a200 100644 --- a/.parcelrc +++ b/.parcelrc @@ -1,6 +1,6 @@ -{ - "extends": "@parcel/config-default", - "transformers": { - "*.riot": ["@riotjs/parcel-transformer-riot"] - } +{ + "extends": "@parcel/config-default", + "transformers": { + "*.riot": ["@riotjs/parcel-transformer-riot"] + } } \ No newline at end of file diff --git a/index.html b/index.html index 4e65663..e249da8 100644 --- a/index.html +++ b/index.html @@ -1,21 +1,21 @@ - - - - - - - Time Chain - - - - -
-

Time Chain!

-

Time traveling your data! Comming soon...

-

- -
- - - + + + + + + + Time Chain + + + + +
+

Time Chain!

+

Time traveling your data! Comming soon...

+

+ +
+ + + \ No newline at end of file diff --git a/src/css/main.css b/src/css/main.css index d4c808a..4682936 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1,31 +1,31 @@ -body { - background-color: #333; - color: whitesmoke; -} - -.loading { - text-align: center; - padding: 5em; -} - -.loading img { - width: 30%; -} - -.loading p { - font-weight: 700; - font-size: 1.2em; -} - -.rotate { - animation: rotation 2s infinite linear; -} - -@keyframes rotation { - from { - transform: rotate(0deg); - } - to { - transform: rotate(359deg); - } +body { + background-color: #333; + color: whitesmoke; +} + +.loading { + text-align: center; + padding: 5em; +} + +.loading img { + width: 30%; +} + +.loading p { + font-weight: 700; + font-size: 1.2em; +} + +.rotate { + animation: rotation 2s infinite linear; +} + +@keyframes rotation { + from { + transform: rotate(0deg); + } + to { + transform: rotate(359deg); + } } \ No newline at end of file diff --git a/src/data/interfaces.js b/src/data/interfaces.js index e0ed745..a709b95 100644 --- a/src/data/interfaces.js +++ b/src/data/interfaces.js @@ -1,35 +1,35 @@ -const InterfaceRecord = { - find(search,limit,offset){}, - get(uuid){}, - add(uuid,timestamp,content,mime,hash){}, - update(uuid,timestamp,content,mime,hash){}, - delete(uuid){}, -} - -const InterfaceFile = { - add(uuid_record,uuid,timestamp,content,mime,hash){}, - getByRecord(uuid_record){}, - get(uuid){}, - delete(uuid){}, - deleteRecord(uuid_record){}, - update(uuid,timestamp,content,mime,hash){} -} - -const InterfaceTag = { - add(uuid,word){}, - delete(uuid){} -} - -const InterfaceTagLink = { - add(uuid_record,uuid_tag){}, - delete(uuid_record,uuid_tag){}, - deleteTag(uuid){}, - deleteRecord(uuid){} -} - -module.exports = { - InterfaceTagLink, - InterfaceTag, - InterfaceFile, - InterfaceRecord +const InterfaceRecord = { + find(search,limit,offset){}, + get(uuid){}, + add(uuid,timestamp,content,mime,hash){}, + update(uuid,timestamp,content,mime,hash){}, + delete(uuid){}, +} + +const InterfaceFile = { + add(uuid_record,uuid,timestamp,content,mime,hash){}, + getByRecord(uuid_record){}, + get(uuid){}, + delete(uuid){}, + deleteRecord(uuid_record){}, + update(uuid,timestamp,content,mime,hash){} +} + +const InterfaceTag = { + add(uuid,word){}, + delete(uuid){} +} + +const InterfaceTagLink = { + add(uuid_record,uuid_tag){}, + delete(uuid_record,uuid_tag){}, + deleteTag(uuid){}, + deleteRecord(uuid){} +} + +module.exports = { + InterfaceTagLink, + InterfaceTag, + InterfaceFile, + InterfaceRecord } \ No newline at end of file diff --git a/src/data/sqlite-electron-ipc.js b/src/data/sqlite-electron-ipc.js index 28bd4f7..55a915e 100644 --- a/src/data/sqlite-electron-ipc.js +++ b/src/data/sqlite-electron-ipc.js @@ -1,76 +1,76 @@ -const { ipcMain } = require('electron'); - -const {app} = require('electron'); -const config = app.getPath('userData'); - -const Conf = require('conf'); -const config = new Conf(); - - -// ** Extra Data -ipcMain.on('timechain-config-dir', (event,arg) => { - const configDir = app.getPath('userData'); - event.reply('timechain-config-dir-reply', configDir); -}); - -// ** RECORD ** - -ipcMain.on('timechain-record-add', (event, arg) => { - event.reply('timechain-record-add-reply', 'pong') -}); - -ipcMain.on('timechain-record-delete', (event, arg) => { - event.reply('timechain-record-delete-reply', 'pong') -}); - -ipcMain.on('timechain-record-update', (event, arg) => { - event.reply('timechain-record-update-reply', 'pong') -}); - -ipcMain.on('timechain-record-find', (event, arg) => { - event.reply('timechain-record-find-reply', 'pong') -}); - -// ** FILE ** - -ipcMain.on('timechain-file-find', (event, arg) => { - event.reply('timechain-file-find-reply', 'pong') -}); - -ipcMain.on('timechain-file-add', (event, arg) => { - event.reply('timechain-file-add-reply', 'pong') -}); - -ipcMain.on('timechain-file-update', (event, arg) => { - event.reply('timechain-file-update-reply', 'pong') -}); - -ipcMain.on('timechain-file-delete', (event, arg) => { - event.reply('timechain-file-delete-reply', 'pong') -}); - -// ** TAG ** -ipcMain.on('timechain-tag-add', (event, arg) => { - event.reply('timechain-tag-add-reply', 'pong') -}); - -ipcMain.on('timechain-tag-delete', (event, arg) => { - event.reply('timechain-tag-delete-reply', 'pong') -}); - -// ** TAG LINK ** -ipcMain.on('timechain-taglink-add', (event, arg) => { - event.reply('timechain-taglink-add-reply', 'pong') -}); - -ipcMain.on('timechain-taglink-delete', (event, arg) => { - event.reply('timechain-taglink-delete-reply', 'pong') -}); - -ipcMain.on('timechain-taglink-deleteTag', (event, arg) => { - event.reply('timechain-taglink-deleteTag-reply', 'pong') -}); - -ipcMain.on('timechain-taglink-deleteRecord', (event, arg) => { - event.reply('timechain-taglink-deleteRecord-reply', 'pong') +const { ipcMain } = require('electron'); + +const {app} = require('electron'); +const config = app.getPath('userData'); + +const Conf = require('conf'); +const config = new Conf(); + + +// ** Extra Data +ipcMain.on('timechain-config-dir', (event,arg) => { + const configDir = app.getPath('userData'); + event.reply('timechain-config-dir-reply', configDir); +}); + +// ** RECORD ** + +ipcMain.on('timechain-record-add', (event, arg) => { + event.reply('timechain-record-add-reply', 'pong') +}); + +ipcMain.on('timechain-record-delete', (event, arg) => { + event.reply('timechain-record-delete-reply', 'pong') +}); + +ipcMain.on('timechain-record-update', (event, arg) => { + event.reply('timechain-record-update-reply', 'pong') +}); + +ipcMain.on('timechain-record-find', (event, arg) => { + event.reply('timechain-record-find-reply', 'pong') +}); + +// ** FILE ** + +ipcMain.on('timechain-file-find', (event, arg) => { + event.reply('timechain-file-find-reply', 'pong') +}); + +ipcMain.on('timechain-file-add', (event, arg) => { + event.reply('timechain-file-add-reply', 'pong') +}); + +ipcMain.on('timechain-file-update', (event, arg) => { + event.reply('timechain-file-update-reply', 'pong') +}); + +ipcMain.on('timechain-file-delete', (event, arg) => { + event.reply('timechain-file-delete-reply', 'pong') +}); + +// ** TAG ** +ipcMain.on('timechain-tag-add', (event, arg) => { + event.reply('timechain-tag-add-reply', 'pong') +}); + +ipcMain.on('timechain-tag-delete', (event, arg) => { + event.reply('timechain-tag-delete-reply', 'pong') +}); + +// ** TAG LINK ** +ipcMain.on('timechain-taglink-add', (event, arg) => { + event.reply('timechain-taglink-add-reply', 'pong') +}); + +ipcMain.on('timechain-taglink-delete', (event, arg) => { + event.reply('timechain-taglink-delete-reply', 'pong') +}); + +ipcMain.on('timechain-taglink-deleteTag', (event, arg) => { + event.reply('timechain-taglink-deleteTag-reply', 'pong') +}); + +ipcMain.on('timechain-taglink-deleteRecord', (event, arg) => { + event.reply('timechain-taglink-deleteRecord-reply', 'pong') }); \ No newline at end of file diff --git a/src/data/sqlite.js b/src/data/sqlite.js index d3682c3..9850558 100644 --- a/src/data/sqlite.js +++ b/src/data/sqlite.js @@ -1,264 +1,264 @@ -const Interface = require("es6-interface"); -const {InterfaceRecord,InterfaceFile,InterfaceTag,InterfaceTagLink} = require("./interfaces"); - -let db = null; - -const connectToDatabase = (path)=>{ - db = require('better-sqlite3')(path, {}); -} - -class TimeChainDataSqliteTag extends Interface(InterfaceTag) { - - constructor(){ - - } - - add(uuid,word){ - - } - - delete(uuid){ - - } - -} - -class TimeChainDataSqliteTagLink extends Interface(InterfaceTagLink) { - - constructor(){ - - } - -} - -class TimeChainDataSqliteFile extends Interface(InterfaceFile) { - - constructor(){ - const table = `CREATE TABLE IF NOT EXISTS "files" ( - "uuid" TEXT UNIQUE, - "uuid_record" TEXT NOT NULL, - "timestamp" INTEGER NOT NULL, - "content" BLOB NOT NULL, - "mime" TEXT NOT NULL, - "hash" TEXT, - "created_at" INTEGER NOT NULL, - "updated_at" INTEGER NOT NULL, - PRIMARY KEY("uuid") - );`; - const table_idx = ` - CREATE INDEX IF NOT EXISTS "files_idx_record" ON "files" ( - "uuid_record" - ); - CREATE INDEX IF NOT EXISTS "files_idx_time" ON "files" ( - "timestamp" DESC - );`; - - if(!db){ - throw new Error("Database is not connected"); - } - - db.exec(table + "\n" + table_idx); - this.db = db; - } - - get table_insert() { - if(!this._table_insert){ - this._table_insert = db.prepare(`INSERT INTO files (uuid,uuid_record,timestamp,content,mime,hash,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?)`); - } - return this._table_insert; - } - - get table_update() { - if(!this._table_update){ - this._table_update = db.prepare(`UPDATE files SET timestamp = ?, content = ?, mime = ? hash = ?, updated_at = ? WHERE uuid = ?`); - } - return this._table_update; - } - - get table_delete() { - if(!this._table_delete){ - this._table_delete = db.prepare(`DELETE FROM files WHERE uuid = ?`); - } - return this._table_delete; - } - - get table_delete_record() { - - if(!this._table_delete_record){ - this._table_delete_record = db.prepare(`DELETE FROM files WHERE uuid_record = ?`); - } - - return this._table_delete_record; - } - - get table_find_one() { - if(!this._table_find_one){ - this._table_find_one = db.prepare(`SELECT * FROM files WHERE uuid = ?`); - } - return this._table_find_one; - } - - get table_find_record(){ - if(!this._table_find_record){ - this._table_find_record = db.prepare(`SELECT * FROM files WHERE uuid_record = ?`); - } - return this._table_find_record; - } - - add(uuid_record,uuid,timestamp,content,mime,hash){ - return new Promise(resolve=>{ - const dt = Math.floor(Date.now()); - const res = this.table_insert.exec(uuid,uuid_record,timestamp,content,mime,hash,dt,dt); - return resolve(res?.changes); - }); - } - - getByRecord(uuid_record){ - return new Promise(resolve => { - const res = this.table_find_record.get(uuid_record); - return resolve(res); - }); - } - - get(uuid){ - return new Promise(resolve => { - const res = this.table_fine_one.get(uuid); - return resolve(res); - }); - } - - delete(uuid){ - return new Promise(resolve=>{ - const res = this.table_delete.exec(uuid); - return resolve(res?.changes); - }) - } - - deleteRecord(){ - return new Promise(resolve=>{ - const res = this.table_delete_record.exec(uuid_record); - return resolve(res?.changes); - }) - } - - update(uuid,timestamp,content,mime,hash){ - return new Promise(resolve=>{ - const res = this.table_update.exec(timestamp,content,mime,hash,uuid); - return resolve(res?.changes); - }) - } -} - -class TimeChainDataSqliteRecord extends Interface(InterfaceRecord) { - - constructor(){ - //TODO: Create Tables Here if not exist - const table = `CREATE TABLE IF NOT EXISTS "records" ( - "uuid" TEXT NOT NULL UNIQUE, - "timestamp" INTEGER NOT NULL, - "content" TEXT NOT NULL, - "mime" TEXT NOT NULL, - "hash" TEXT, - "created_at" INTEGER NOT NULL, - "updated_at" INTEGER NOT NULL, - PRIMARY KEY("uuid") - );`; - const table_idx = `CREATE INDEX IF NOT EXISTS "records_idx_timestamp" ON "records" ( - "timestamp" DESC - );` - - if(!db){ - throw new Error("Database is not connected"); - } - - db.exec(table + "\n" + table_idx); - this.db = db; - } - - get table_insert() { - if(!this._table_insert){ - this._table_insert = db.prepare(`INSERT INTO records (uuid,timestamp,content,mime,hash,created_at,updated_at) VALUES (?,?,?,?,?,?,?)`); - } - return this._table_insert; - } - - get table_update(){ - if(!this._table_update){ - this._table_update = db.prepare(`UPDATE records SET timestamp = ?, content = ?, mime = ?, hash = ? updated_at = ? WHERE uuid = ?`); - } - return this._table_update; - } - - get table_delete(){ - if(!this._table_delete){ - this._table_delete = db.prepare(`DELETE FROM records WHERE uuid = ?`); - } - return this._table_delete; - } - - get table_fine_one(){ - if(!this._table_fine_one){ - this._table_fine_one = db.prepare(`SELECT * FROM records WHERE uuid = ?`); - } - return this._table_fine_one; - } - - add(uuid,timestamp,content,mime,hash){ - return new Promise(resolve=>{ - const dt = Math.floor(Date.now()); - const res = this.table_insert.run(uuid,timestamp,content,mime,hash,dt,dt); - return resolve(res?.changes); - }); - } - - get(uuid){ - return new Promise(resolve=>{ - const rec = this.table_fine_one.get(uuid); - return resolve(rec); - }); - } - - find(search,sort=null,limit=undefined,offset=0){ - //TODO: add logic for seach and sort (Currently does nothing) - return new Promise(resolve=>{ - const rescount = this.db.prepare("SELECT count(*) as cnt FROM records").get(); - - if(limit){ - const res = this.db.prepare("SELECT * FROM records ORDER BY timestamp DESC LIMIT ? OFFSET ?").all(limit,offset); - }else{ - const res = this.db.prepare("SELECT * FROM records ORDER BY timestamp DESC").all(); - } - - return resolve({ - data: res, - count: rescount?.cnt, - limit: limit, - offset: offset - }); - - }) - } - - delete(uuid){ - return new Promise(resolve=>{ - const res = this.table_delete.exec(uuid); - return resolve(res?.changes); - }); - } - - update(uuid,content,mime,hash){ - return new Promise(resolve=>{ - const dt = Math.floor(Date.now()); - const res = this.table_update.exec(content,mime,hash,dt,uuid); - return resolve(res?.changes); - }) - } - -} - -class TimeChainDataSqlite { - -} - - - +const Interface = require("es6-interface"); +const {InterfaceRecord,InterfaceFile,InterfaceTag,InterfaceTagLink} = require("./interfaces"); + +let db = null; + +const connectToDatabase = (path)=>{ + db = require('better-sqlite3')(path, {}); +} + +class TimeChainDataSqliteTag extends Interface(InterfaceTag) { + + constructor(){ + + } + + add(uuid,word){ + + } + + delete(uuid){ + + } + +} + +class TimeChainDataSqliteTagLink extends Interface(InterfaceTagLink) { + + constructor(){ + + } + +} + +class TimeChainDataSqliteFile extends Interface(InterfaceFile) { + + constructor(){ + const table = `CREATE TABLE IF NOT EXISTS "files" ( + "uuid" TEXT UNIQUE, + "uuid_record" TEXT NOT NULL, + "timestamp" INTEGER NOT NULL, + "content" BLOB NOT NULL, + "mime" TEXT NOT NULL, + "hash" TEXT, + "created_at" INTEGER NOT NULL, + "updated_at" INTEGER NOT NULL, + PRIMARY KEY("uuid") + );`; + const table_idx = ` + CREATE INDEX IF NOT EXISTS "files_idx_record" ON "files" ( + "uuid_record" + ); + CREATE INDEX IF NOT EXISTS "files_idx_time" ON "files" ( + "timestamp" DESC + );`; + + if(!db){ + throw new Error("Database is not connected"); + } + + db.exec(table + "\n" + table_idx); + this.db = db; + } + + get table_insert() { + if(!this._table_insert){ + this._table_insert = db.prepare(`INSERT INTO files (uuid,uuid_record,timestamp,content,mime,hash,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?)`); + } + return this._table_insert; + } + + get table_update() { + if(!this._table_update){ + this._table_update = db.prepare(`UPDATE files SET timestamp = ?, content = ?, mime = ? hash = ?, updated_at = ? WHERE uuid = ?`); + } + return this._table_update; + } + + get table_delete() { + if(!this._table_delete){ + this._table_delete = db.prepare(`DELETE FROM files WHERE uuid = ?`); + } + return this._table_delete; + } + + get table_delete_record() { + + if(!this._table_delete_record){ + this._table_delete_record = db.prepare(`DELETE FROM files WHERE uuid_record = ?`); + } + + return this._table_delete_record; + } + + get table_find_one() { + if(!this._table_find_one){ + this._table_find_one = db.prepare(`SELECT * FROM files WHERE uuid = ?`); + } + return this._table_find_one; + } + + get table_find_record(){ + if(!this._table_find_record){ + this._table_find_record = db.prepare(`SELECT * FROM files WHERE uuid_record = ?`); + } + return this._table_find_record; + } + + add(uuid_record,uuid,timestamp,content,mime,hash){ + return new Promise(resolve=>{ + const dt = Math.floor(Date.now()); + const res = this.table_insert.exec(uuid,uuid_record,timestamp,content,mime,hash,dt,dt); + return resolve(res?.changes); + }); + } + + getByRecord(uuid_record){ + return new Promise(resolve => { + const res = this.table_find_record.get(uuid_record); + return resolve(res); + }); + } + + get(uuid){ + return new Promise(resolve => { + const res = this.table_fine_one.get(uuid); + return resolve(res); + }); + } + + delete(uuid){ + return new Promise(resolve=>{ + const res = this.table_delete.exec(uuid); + return resolve(res?.changes); + }) + } + + deleteRecord(){ + return new Promise(resolve=>{ + const res = this.table_delete_record.exec(uuid_record); + return resolve(res?.changes); + }) + } + + update(uuid,timestamp,content,mime,hash){ + return new Promise(resolve=>{ + const res = this.table_update.exec(timestamp,content,mime,hash,uuid); + return resolve(res?.changes); + }) + } +} + +class TimeChainDataSqliteRecord extends Interface(InterfaceRecord) { + + constructor(){ + //TODO: Create Tables Here if not exist + const table = `CREATE TABLE IF NOT EXISTS "records" ( + "uuid" TEXT NOT NULL UNIQUE, + "timestamp" INTEGER NOT NULL, + "content" TEXT NOT NULL, + "mime" TEXT NOT NULL, + "hash" TEXT, + "created_at" INTEGER NOT NULL, + "updated_at" INTEGER NOT NULL, + PRIMARY KEY("uuid") + );`; + const table_idx = `CREATE INDEX IF NOT EXISTS "records_idx_timestamp" ON "records" ( + "timestamp" DESC + );` + + if(!db){ + throw new Error("Database is not connected"); + } + + db.exec(table + "\n" + table_idx); + this.db = db; + } + + get table_insert() { + if(!this._table_insert){ + this._table_insert = db.prepare(`INSERT INTO records (uuid,timestamp,content,mime,hash,created_at,updated_at) VALUES (?,?,?,?,?,?,?)`); + } + return this._table_insert; + } + + get table_update(){ + if(!this._table_update){ + this._table_update = db.prepare(`UPDATE records SET timestamp = ?, content = ?, mime = ?, hash = ? updated_at = ? WHERE uuid = ?`); + } + return this._table_update; + } + + get table_delete(){ + if(!this._table_delete){ + this._table_delete = db.prepare(`DELETE FROM records WHERE uuid = ?`); + } + return this._table_delete; + } + + get table_fine_one(){ + if(!this._table_fine_one){ + this._table_fine_one = db.prepare(`SELECT * FROM records WHERE uuid = ?`); + } + return this._table_fine_one; + } + + add(uuid,timestamp,content,mime,hash){ + return new Promise(resolve=>{ + const dt = Math.floor(Date.now()); + const res = this.table_insert.run(uuid,timestamp,content,mime,hash,dt,dt); + return resolve(res?.changes); + }); + } + + get(uuid){ + return new Promise(resolve=>{ + const rec = this.table_fine_one.get(uuid); + return resolve(rec); + }); + } + + find(search,sort=null,limit=undefined,offset=0){ + //TODO: add logic for seach and sort (Currently does nothing) + return new Promise(resolve=>{ + const rescount = this.db.prepare("SELECT count(*) as cnt FROM records").get(); + + if(limit){ + const res = this.db.prepare("SELECT * FROM records ORDER BY timestamp DESC LIMIT ? OFFSET ?").all(limit,offset); + }else{ + const res = this.db.prepare("SELECT * FROM records ORDER BY timestamp DESC").all(); + } + + return resolve({ + data: res, + count: rescount?.cnt, + limit: limit, + offset: offset + }); + + }) + } + + delete(uuid){ + return new Promise(resolve=>{ + const res = this.table_delete.exec(uuid); + return resolve(res?.changes); + }); + } + + update(uuid,content,mime,hash){ + return new Promise(resolve=>{ + const dt = Math.floor(Date.now()); + const res = this.table_update.exec(content,mime,hash,dt,uuid); + return resolve(res?.changes); + }) + } + +} + +class TimeChainDataSqlite { + +} + + + diff --git a/src/ui/app.riot b/src/ui/app.riot new file mode 100644 index 0000000..3bdcf32 --- /dev/null +++ b/src/ui/app.riot @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/ui/timechain-input.riot b/src/ui/timechain-input.riot new file mode 100644 index 0000000..e69de29 diff --git a/src/ui/timer-ctrl.riot b/src/ui/timer-ctrl.riot new file mode 100644 index 0000000..e69de29 diff --git a/timestamp.riot b/src/ui/timestamp.riot similarity index 94% rename from timestamp.riot rename to src/ui/timestamp.riot index 52aa4ed..4100dd7 100644 --- a/timestamp.riot +++ b/src/ui/timestamp.riot @@ -1,34 +1,34 @@ - - -
-
-
{ state.time_text }
-
- - + + +
+
+
{ state.time_text }
+
+ + \ No newline at end of file diff --git a/start.js b/start.js index 42280d5..32c216e 100644 --- a/start.js +++ b/start.js @@ -1,7 +1,7 @@ -import Timestamp from './timestamp.riot' -import { component } from 'riot' - - -component(Timestamp)(document.getElementById('timestamp')) - +import Timestamp from './src/ui/timestamp.riot' +import { component } from 'riot' + + +component(Timestamp)(document.getElementById('timestamp')) + console.log("yes!"); \ No newline at end of file