Project restructuring, fixing minor bugs related to vue CLI upgrade

* Removed PWA kit from project, this removes a ton of dependencies
This commit is contained in:
Max 2022-10-23 19:14:31 +00:00
parent 178a7dfc2c
commit e5c117bbdb
19 changed files with 195 additions and 54 deletions

6
.gitignore vendored
View File

@ -7,3 +7,9 @@ pids
*.seed
*.pid.lock
.env
# exclude everything
staticFiles/*
# exception to the rule
!staticFiles/assets/

View File

@ -1,5 +1,5 @@
{
"name": "client",
"name": "solidscribe",
"version": "0.1.0",
"private": true,
"scripts": {
@ -8,19 +8,21 @@
},
"dependencies": {
"axios": "^0.20.0",
"core-js": "^3.8.3",
"core-js": "^3.6.5",
"es6-promise": "^4.2.8",
"fomantic-ui-css": "^2.8.7",
"vue": "^2.6.14",
"vue-router": "^3.5.1",
"vuex": "^3.6.2"
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"vue-template-compiler": "^2.6.14"
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"node-sass": "^4.12.0",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
},
"browserslist": [
"> 1%",

View File

@ -1,17 +1,69 @@
<!DOCTYPE html>
<html lang="">
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="/api/static/assets/favicon.ico" type="image/ico"/>
<link rel="shortcut icon" href="/api/static/assets/favicon.ico" type="image/x-icon"/>
<meta name="theme-color" content="#000" />
<link rel="manifest" href="/api/static/assets/manifest.json">
<title>Solid Scribe - An easy, encrypted Note App</title>
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but Solid Scribe doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<div id="app">
<!-- placeholder data for scrapers with no JS -->
<style>
body {
background-color: #212221;
color: #aeaeae;
height: 100vh;
width: 100%;
}
.centered {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
font-family: Arial, Helvetica, sans-serif;
}
.logo {
width: 200px;
height: auto;
}
.scrape-info {
opacity: 0;
}
</style>
<div class="centered">
<img class="logo" src="/api/static/assets/logo.svg" alt="Solid Scribe Logo - if you can read this your connection is really slow">
<h1>Solid Scribe</h1>
<h3>An easy, encrypted Note App</h3>
<h4>Loading...</h4>
</div>
<div class="scrape-info">
<h1>Solid Scribe</h1>
<h2>A note application that respects your privacy.</h2>
<p>Take notes with a clean editor that works on desktop or mobile.</p>
<p>Search notes, links and files to find what you need.</p>
<p>Accessable everywhere.</p>
<p>Categorize notes with tags.</p>
<p>Share data with fellow users.</p>
<p>Encrypt notes for additional security.</p>
<b>This site requires Javascipt to run.</b>
</div>
</div>
<!-- built files will be auto injected -->
</body>
</html>
</html>

View File

@ -164,7 +164,7 @@ div.ui.basic.green.label {
border-color: var(--dark_border_color) !important;
}
/*Overwrites for modifiable theme color */
i.green.icon.icon.icon.icon {
i.green.icon.icon.icon.icon, i.green.icon.icon.icon.icon.icon {
color: var(--main-accent);
}
.button {

View File

@ -329,8 +329,8 @@
</div>
<div class="menu-section" v-if="loggedIn">
<router-link class="menu-item menu-button" exact-active-class="active" to="/cycletrack">
<i class="calendar check outlin icon"></i>Cycle Track
<router-link class="menu-item menu-button" exact-active-class="active" to="/metrictrack">
<i class="calendar check outlin icon"></i>Metric Track
</router-link>
</div>

View File

@ -121,9 +121,6 @@
<div class="ui centered dividing header">
<br>
Metric Tracking Beta
<span v-on:click="deleteData()">
<i class="clickable trash icon"></i>
</span>
</div>
<!-- data input -->
@ -136,16 +133,16 @@
</div>
<div class="ui four wide right aligned middle aligned column">
<span v-if="saving == 0">
<i class="heart icon"></i>
<i class=" icon"></i>
</span>
<span v-if="saving == 1">
<i class="asterisk icon"></i>
Modified <i class="asterisk icon"></i>
</span>
<span v-if="saving == 2">
<i class="sync loading icon"></i>
Saving <i class="sync loading icon"></i>
</span>
<span v-if="saving == 3">
<i class="green circle check icon"></i>
Saved <i class="green circle check icon"></i>
</span>
</div>
</div>
@ -309,10 +306,10 @@
</div>
<div class="ui basic segment">
<div class="ui clickable" v-on:click="toggleFolded('key')">
<a class="ui clickable" v-on:click="toggleFolded('key')">
<i class="tiny circular blue clickable plus icon"></i>
Calendar Explanation
</div>
</a>
<div class="ui segment key-holder" v-if="folded.includes('key')">
<div class="day">
<span class="number">1</span>
@ -410,6 +407,12 @@
<div class="ui segment">
If you do get pregnant, your body needs the lining thats why your period stops during pregnancy. Your period comes back when youre not pregnant anymore.
</div>
<div class="ui segment">
Delete all data. Can not be undone.
<span class="ui tiny compact icon button" v-on:click="deleteData()">
<i class="clickable trash icon"></i>
</span>
</div>
</div>
</div>
@ -703,7 +706,7 @@
},
fetchCycleData(){
axios.post('/api/cycle-tracking/get')
axios.post('/api/metric-tracking/get')
.then(({ data }) => {
if(data.hasOwnProperty("text")){
@ -744,7 +747,7 @@
// 0 blank, 1 modified, 2 saving, 3 saved
this.saving = 2 // Working
this.totalEntries = Object.keys(this.cycleData).length
axios.post('/api/cycle-tracking/save', { cycleData:appData })
axios.post('/api/metric-tracking/save', { cycleData:appData })
.then(response => {
// { this.$bus.$emit('notification', 'Data Saved') }
this.saving = 3 //Saved
@ -755,7 +758,7 @@
.catch(error => { this.$bus.$emit('notification', error) })
},
deleteData(){
axios.post('/api/cycle-tracking/save', { cycleData:'' })
axios.post('/api/metric-tracking/save', { cycleData:'' })
.then(response => {
{ this.$bus.$emit('notification', 'Data Deleted') }
this.fetchCycleData()

View File

@ -117,9 +117,9 @@ export default new Router({
},
// Cycle Tracking
{
path: '/cycletrack',
name: 'Cycle Tracking',
meta: {title:'Cycle Tracking'},
path: '/metrictrack',
name: 'Metric Tracking',
meta: {title:'Metric Tracking'},
component: () => import(/* webpackChunkName: "CycletrackingPage" */ '@/pages/CycletrackingPage')
},
]

View File

@ -1,4 +0,0 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
})

View File

@ -319,8 +319,8 @@ var quickNote = require('@routes/quicknoteController')
app.use('/api/quick-note', quickNote)
//cycle tracking endpoint
var cycleTracking = require('@routes/cycletrackingController')
app.use('/api/cycle-tracking', cycleTracking)
var metricTracking = require('@routes/metrictrackingController')
app.use('/api/metric-tracking', metricTracking)
//Output running status
app.listen(ports.express, () => {

View File

@ -2,10 +2,10 @@ let db = require('@config/database')
let Note = require('@models/Note')
let CycleTracking = module.exports = {}
let MetricTracking = module.exports = {}
CycleTracking.get = (userId, masterKey) => {
MetricTracking.get = (userId, masterKey) => {
return new Promise((resolve, reject) => {
db.promise()
@ -25,7 +25,7 @@ CycleTracking.get = (userId, masterKey) => {
} else {
//Or create a new note
let finalId = null
return Note.create(userId, 'Cycle Tracking', '', masterKey)
return Note.create(userId, 'Metric Tracking', '', masterKey)
.then(insertedId => {
finalId = insertedId
db.promise().query('UPDATE note SET quick_note = 2 WHERE id = ? AND user_id = ?',[insertedId, userId])
@ -47,12 +47,12 @@ CycleTracking.get = (userId, masterKey) => {
})
}
CycleTracking.save = (userId, cycleData, masterKey) => {
MetricTracking.save = (userId, cycleData, masterKey) => {
return new Promise((resolve, reject) => {
let finalId = null
CycleTracking.get(userId, masterKey)
MetricTracking.get(userId, masterKey)
.then(noteObject => {
return Note.update(userId, noteObject.id, cycleData, noteObject.title, noteObject.color, noteObject.pinned, noteObject.archived, null, masterKey)

View File

@ -1,11 +1,11 @@
//
// /api/cycle-tracking
// /api/metric-tracking
//
var express = require('express')
var router = express.Router()
let CycleTracking = require('@models/CycleTracking');
let MetricTracking = require('@models/MetricTracking');
let userId = null
let masterKey = null
@ -27,13 +27,13 @@ router.use(function setUserId (req, res, next) {
//Get quick note text
router.post('/get', function (req, res) {
CycleTracking.get(userId, masterKey)
MetricTracking.get(userId, masterKey)
.then( data => res.send(data) )
})
//Push text to quick note
router.post('/save', function (req, res) {
CycleTracking.save(userId, req.body.cycleData, masterKey)
MetricTracking.save(userId, req.body.cycleData, masterKey)
.then( data => res.send(data) )
})

View File

@ -1,4 +0,0 @@
*
*/
!.gitignore
!assets

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" id="svg8" version="1.1" viewBox="0 0 132.29166 132.29167" height="500" width="500">
<defs id="defs2"/>
<metadata id="metadata5">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g style="display:inline" transform="translate(0,-164.70832)" id="layer1">
<path id="path3813-4" d="m 56.22733,165.36641 -55.56249926,15.875 8e-7,63.5 47.62499846,11.90625 v 27.78125 l -47.76066333,-13.9757 0.13566407,10.00695 55.56249926,15.875 v -47.625 l -47.6249985,-11.90625 -8e-7,-47.625 47.7606633,-13.94121 c 0.135664,-2.30629 -0.135664,-9.87129 -0.135664,-9.87129 z" style="fill:#0f7425;fill-opacity:1;stroke:none;stroke-width:0.5291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
<path id="path4563" d="m 20.508581,220.92891 c 15.265814,-14.23899 27.809717,-7.68002 39.687499,3.96875 v -7.9375 C 51.75093,200.8366 37.512584,206.01499 20.508581,205.05391 Z" style="fill:#04cb03;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
<path id="path4563-6" d="m 111.78985,220.92891 c -15.265834,-14.23899 -27.809737,-7.68002 -39.68752,3.96875 v -7.9375 c 8.445151,-16.12356 22.683497,-10.94517 39.68752,-11.90625 z" style="display:inline;fill:#04cb03;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
<path id="path3813-4-2" d="m 76.07108,165.36641 55.5625,15.875 v 63.5 l -47.625,11.90625 v 27.78125 l 47.76067,-13.9757 -0.13567,10.00695 -55.5625,15.875 v -47.625 l 47.625,-11.90626 V 189.17891 L 75.93542,175.2377 c -0.13567,-2.30629 0.13566,-9.87129 0.13566,-9.87129 z" style="display:inline;fill:#04cb03;fill-opacity:1;stroke:none;stroke-width:0.52916676;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,24 @@
{
"theme_color":"#000",
"background_color": "#000",
"description": "Take Notes",
"display": "standalone",
"icons": [
{
"src": "/api/static/assets/logo.png",
"sizes": "496x496",
"type": "image/png",
"purpose": "any"
},
{
"src": "/api/static/assets/maskable_icon.png",
"sizes": "826x826",
"type": "image/png",
"purpose": "maskable"
}
],
"name": "Solid Scribe",
"short_name": "Solid Scribe",
"start_url": "/#/notes",
"author":"Max"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" id="svg8" version="1.1" viewBox="0 0 132.29166 132.29167" height="500" width="500">
<defs id="defs2"/>
<metadata id="metadata5">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g style="display:inline" transform="translate(0,-164.70832)" id="layer1">
<path id="path3813-4" d="m 56.22733,165.36641 -55.56249926,15.875 8e-7,63.5 47.62499846,11.90625 v 27.78125 l -47.76066333,-13.9757 0.13566407,10.00695 55.56249926,15.875 v -47.625 l -47.6249985,-11.90625 -8e-7,-47.625 47.7606633,-13.94121 c 0.135664,-2.30629 -0.135664,-9.87129 -0.135664,-9.87129 z" style="fill:#0f7425;fill-opacity:1;stroke:none;stroke-width:0.5291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
<path id="path4563" d="m 20.508581,220.92891 c 15.265814,-14.23899 27.809717,-7.68002 39.687499,3.96875 v -7.9375 C 51.75093,200.8366 37.512584,206.01499 20.508581,205.05391 Z" style="fill:#04cb03;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
<path id="path4563-6" d="m 111.78985,220.92891 c -15.265834,-14.23899 -27.809737,-7.68002 -39.68752,3.96875 v -7.9375 c 8.445151,-16.12356 22.683497,-10.94517 39.68752,-11.90625 z" style="display:inline;fill:#04cb03;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
<path id="path3813-4-2" d="m 76.07108,165.36641 55.5625,15.875 v 63.5 l -47.625,11.90625 v 27.78125 l 47.76067,-13.9757 -0.13567,10.00695 -55.5625,15.875 v -47.625 l 47.625,-11.90626 V 189.17891 L 75.93542,175.2377 c -0.13567,-2.30629 0.13566,-9.87129 0.13566,-9.87129 z" style="display:inline;fill:#04cb03;fill-opacity:1;stroke:none;stroke-width:0.52916676;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,24 @@
{
"theme_color":"#000",
"background_color": "#000",
"description": "Take Notes",
"display": "standalone",
"icons": [
{
"src": "/api/static/assets/logo.png",
"sizes": "496x496",
"type": "image/png",
"purpose": "any"
},
{
"src": "/api/static/assets/maskable_icon.png",
"sizes": "826x826",
"type": "image/png",
"purpose": "maskable"
}
],
"name": "Solid Scribe",
"short_name": "Solid Scribe",
"start_url": "/#/notes",
"author":"Max"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB