Skip to content

Commit

Permalink
TAB-481 savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
evandor committed Jan 12, 2024
1 parent 552da41 commit 612be98
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@editorjs/header": "^2.7.0",
"@extractus/feed-extractor": "^7.0.1",
"@isomorphic-git/lightning-fs": "^4.6.0",
"@logtail/browser": "^0.4.19",
"@mozilla/readability": "^0.5.0",
"@quasar/extras": "^1.16.6",
"@stripe/stripe-js": "^2.2.2",
Expand Down
3 changes: 2 additions & 1 deletion quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ module.exports = configure(function (ctx) {
//'i18n',
'constants',
'firebase',
'auth0'
'auth0',
'logtail'
],

// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
Expand Down
5 changes: 4 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {useAuthStore} from "stores/auth";
import {useSettingsStore} from "stores/settingsStore";
import {Logz} from "src/services/logz/Logz";
import {EventEmitter} from "events";
import {logtail} from "boot/logtail";
const tabsStore = useTabsStore()
const settingsStore = useSettingsStore()
Expand Down Expand Up @@ -100,7 +101,9 @@ watchEffect(() => {
const selectedTSId = localStorage.getItem("selectedTabset")
// })
Logz.info({"message": "user logged in", "username": auth0.user.value?.name})
//Logz.info({"message": "user logged in", "username": auth0.user.value?.name})
logtail.info("user logged in", {"username": auth0.user.value?.name})
}
}
Expand Down
9 changes: 8 additions & 1 deletion src/boot/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {boot} from 'quasar/wrappers'
import {Logtail} from "@logtail/browser";

const INDEX_DB_VERSION = 18

Expand Down Expand Up @@ -38,6 +39,11 @@ const SYNC_COUCHDB_USERNAME = "sync.couchdb.username"
const SYNC_COUCHDB_PASSWORD = "sync.couchdb.password"
const SYNC_COUCHDB_URL = "sync.couchdb.url"


const logtail = (process.env.MODE === "bex") ?
new Logtail("Ht8PY3XGQgqhMyNTcyGyJhXJ") :
new Logtail("pNfaHtRmWXGd3TFbsCXMHHbB")

export default boot(({}) => {
})

Expand All @@ -60,6 +66,7 @@ export {
SYNC_COUCHDB_USERNAME,
SYNC_COUCHDB_PASSWORD,
SYNC_COUCHDB_URL,
TITLE_IDENT
TITLE_IDENT,
logtail
}

14 changes: 14 additions & 0 deletions src/boot/logtail.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {boot} from 'quasar/wrappers'
import {Logtail} from "@logtail/browser";

const logtail = (process.env.MODE === "bex") ?
new Logtail("Ht8PY3XGQgqhMyNTcyGyJhXJ") :
new Logtail("pNfaHtRmWXGd3TFbsCXMHHbB")

export default boot(({}) => {
})

export {
logtail
}

6 changes: 5 additions & 1 deletion src/pages/SidePanelPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@
{{ toolbarTitle(tabsets as Tabset[]) }}
<q-icon v-if="LocalStorage.getItem(SYNC_TYPE) as SyncType === SyncType.GITHUB"
class="q-ml-none" name="sync" size="12px">
<q-tooltip class="tooltip-small">Tabsets is synced via git</q-tooltip>
<q-tooltip class="tooltip-small">Tabsets are being synced</q-tooltip>
</q-icon>
<q-icon v-if="LocalStorage.getItem(SYNC_TYPE) as SyncType === SyncType.MANAGED_GIT"
class="q-ml-none" name="sync" size="12px">
<q-tooltip class="tooltip-small">Tabsets are being synced automatically</q-tooltip>
</q-icon>
</div>
</template>
Expand Down
5 changes: 3 additions & 2 deletions src/services/persistence/GitPersistentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {useTabsStore} from "stores/tabsStore";
import {useSpacesStore} from "stores/spacesStore";
import {LocalStorage, uid} from "quasar";
import {SyncType} from "stores/appStore";
import {SYNC_GITHUB_TOKEN} from "boot/constants";
import {SUBSCRIPTION_ID_IDENT, SYNC_GITHUB_TOKEN, SYNC_GITHUB_URL} from "boot/constants";

if (typeof self !== 'undefined') {
self.Buffer = Buffer;
Expand Down Expand Up @@ -76,8 +76,9 @@ class GitPersistenceService implements PersistenceService {
useUiStore().dbReady = true
return Promise.resolve("done")
} else if (syncType === SyncType.MANAGED_GIT) {
const subscription = LocalStorage.getItem(SUBSCRIPTION_ID_IDENT) as string
console.log("=== initializing managed git ===", url)
this.db = await this.initDatabase(url, this.tabsetsCorsProxy)
this.db = await this.initDatabase("https://tabsets.git/" + subscription, this.tabsetsCorsProxy)
console.log("=== initializing managed git done ===")
useUiStore().dbReady = true
return Promise.resolve("done")
Expand Down
70 changes: 70 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,38 @@
dependencies:
call-bind "^1.0.2"

"@logtail/browser@^0.4.19":
version "0.4.19"
resolved "https://registry.yarnpkg.com/@logtail/browser/-/browser-0.4.19.tgz#05601693df03751252f648319aa9217f1366d64d"
integrity sha512-85exfHL4KbsfmzbYlVKwq7au4BuOceFNQJuPTNkt51dai5rBvhxf7k1VbYM8jCS8cHIj3VdyNLl+2VpsqokBRQ==
dependencies:
"@logtail/core" "^0.4.19"
"@logtail/tools" "^0.4.19"
cross-fetch "^3.0.4"

"@logtail/core@^0.4.19":
version "0.4.19"
resolved "https://registry.yarnpkg.com/@logtail/core/-/core-0.4.19.tgz#bc657d77af0200267ab25682a5f9a30c55c274c7"
integrity sha512-IjvMwSyv2LucVoS+2PXzAVG5cTd/50W3dENpC+ePMlAfbKAR5h4eTIOT9GC7zcEBtog6RBJChHApyj4rOvgbYA==
dependencies:
"@logtail/tools" "^0.4.19"
"@logtail/types" "^0.4.19"
serialize-error "^8.1.0"

"@logtail/tools@^0.4.19":
version "0.4.19"
resolved "https://registry.yarnpkg.com/@logtail/tools/-/tools-0.4.19.tgz#824df744bfedc13dbfe8ea1715bd2ed84523b72d"
integrity sha512-6wtf5iJgKMpF2sn8mHOEA2GzluXlBjt6aK0YXzv6IuRhKL4dzk52jjkFWXwgVfA4xf53nhHRGA/SrGOPm6K9bQ==
dependencies:
"@logtail/types" "^0.4.19"

"@logtail/types@^0.4.19":
version "0.4.19"
resolved "https://registry.yarnpkg.com/@logtail/types/-/types-0.4.19.tgz#e2d49a9a718d4dcb15367fcd4b68cef32f1fe68e"
integrity sha512-VlrysIpc2H8faZkR0u07pUnuqAArLRgfCVbSD0dtvXgLbkCAGgCCqveAZk99uv6XVxXH/GhH3OUoUoFaGUSTwg==
dependencies:
js "^0.1.0"

"@malept/cross-spawn-promise@^1.1.0":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@malept/cross-spawn-promise/-/cross-spawn-promise-1.1.1.tgz#504af200af6b98e198bce768bc1730c6936ae01d"
Expand Down Expand Up @@ -4103,6 +4135,13 @@ commander@^9.3.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30"
integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==

commander@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-1.1.1.tgz#50d1651868ae60eccff0a2d9f34595376bc6b041"
integrity sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==
dependencies:
keypress "0.1.x"

commist@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/commist/-/commist-3.2.0.tgz#da9c8e5f245ac21510badc4b10c46b5bcc9b56cd"
Expand Down Expand Up @@ -4275,6 +4314,13 @@ [email protected], cross-fetch@^4.0.0:
dependencies:
node-fetch "^2.6.12"

cross-fetch@^3.0.4:
version "3.1.8"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82"
integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==
dependencies:
node-fetch "^2.6.12"

cross-spawn-windows-exe@^1.1.0, cross-spawn-windows-exe@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/cross-spawn-windows-exe/-/cross-spawn-windows-exe-1.2.0.tgz#46253b0f497676e766faf4a7061004618b5ac5ec"
Expand Down Expand Up @@ -6870,6 +6916,13 @@ js-tokens@^4.0.0:
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

js@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/js/-/js-0.1.0.tgz#e1d0afd55ea39c2b28da304e8143eaf2c133f366"
integrity sha512-ZBbGYOpact8QAH9RprFWL4RAESYwbDodxiuDjOnzwzzk9pBzKycoifGuUrHHcDixE/eLMKPHRaXenTgu1qXBqA==
dependencies:
commander "~1.1.1"

jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
Expand Down Expand Up @@ -7026,6 +7079,11 @@ jwt-decode@^3.1.2:
resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59"
integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==

[email protected]:
version "0.1.0"
resolved "https://registry.yarnpkg.com/keypress/-/keypress-0.1.0.tgz#4a3188d4291b66b4f65edb99f806aa9ae293592a"
integrity sha512-x0yf9PL/nx9Nw9oLL8ZVErFAk85/lslwEP7Vz7s5SI1ODXZIgit3C5qyWjw4DxOuO/3Hb4866SQh28a1V1d+WA==

keytar@^7.9.0:
version "7.9.0"
resolved "https://registry.yarnpkg.com/keytar/-/keytar-7.9.0.tgz#4c6225708f51b50cbf77c5aae81721964c2918cb"
Expand Down Expand Up @@ -9161,6 +9219,13 @@ serialize-error@^7.0.1:
dependencies:
type-fest "^0.13.1"

serialize-error@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-8.1.0.tgz#3a069970c712f78634942ddd50fbbc0eaebe2f67"
integrity sha512-3NnuWfM6vBYoy5gZFvHiYsVbafvI9vZv/+jlIigFn4oP4zjNPK3LhcY0xSCgeb1a5L8jO71Mit9LlNoi2UfDDQ==
dependencies:
type-fest "^0.20.2"

serialize-javascript@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa"
Expand Down Expand Up @@ -9971,6 +10036,11 @@ type-fest@^0.16.0:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.16.0.tgz#3240b891a78b0deae910dbeb86553e552a148860"
integrity sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==

type-fest@^0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==

type-fest@^0.21.3:
version "0.21.3"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"
Expand Down

0 comments on commit 612be98

Please sign in to comment.