File tree Expand file tree Collapse file tree 3 files changed +94
-1
lines changed
Expand file tree Collapse file tree 3 files changed +94
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import Filter from "./components/Filter.vue"
1010import Modal from " ./components/Modal.vue"
1111import AuthPrompt from " ./components/AuthPrompt.vue"
1212import DemoBar from " ./components/DemoBar.vue"
13+ import UpdateBar from " ./components/UpdateBar.vue"
1314import Confirm from " ./components/ConfirmModal.vue"
1415import FeedbackModal from " ./components/FeedbackModal.vue"
1516import Import from " ./components/Import.vue"
@@ -595,9 +596,10 @@ const updateSampleLine = () => {
595596 <SettingsDrawer v-if =" store.settingsDrawer" @close =" store.settingsDrawer = false" :layout =" (store.layout as Layout)"
596597 @edit =" columnEdited" @remove =" columnRemoved" @move =" reorderColumns" @settings-update =" settingsUpdate"
597598 @update-sample-line =" updateSampleLine" :sampleLine =" sampleLine" />
599+ <UpdateBar v-if =" store.notificationBar" />
598600 <DemoBar v-if =" store.demoMode" @start =" store.demoStatus = 'started'" @stop =" store.demoStatus = 'stopped'"
599601 @mode =" changeDemoMode" @add =" addDemoData(100)" />
600- <div :class =" { 'demo': store.demoMode }" >
602+ <div :class =" { 'demo': store.demoMode, 'update': store.notificationBar }" >
601603 <div class =" top-bar" >
602604 <div class =" left" >
603605 <div class =" logo" >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import { useMainStore } from ' ../store' ;
3+
4+ const hide = () => {
5+
6+ }
7+
8+ const remind = () => {
9+
10+ }
11+
12+ </script >
13+
14+ <template >
15+ <div class =" update-bar" v-if =" useMainStore().initSettings && useMainStore().initSettings?.updateVersion" >
16+ <span >🎉 New Logdy v{{ useMainStore().initSettings?.updateVersion.current_version }} available! {{
17+ useMainStore().initSettings?.updateVersion.excerpt }} <a
18+ :href =" useMainStore().initSettings?.updateVersion.blog_link"
19+ v-if =" useMainStore().initSettings?.updateVersion.blog_link" target =" _blank" >Read
20+ more</a ></span >
21+ <button @click =" hide" >Hide</button >
22+ <button @click =" remind" >Remind later</button >
23+ </div >
24+ </template >
25+
26+ <style lang="scss">
27+ .update {
28+ .top-bar {
29+ padding-top : 50px !important ;
30+ }
31+
32+ .layout {
33+ height : calc (100vh - 109px ) !important ;
34+ }
35+ }
36+
37+ .update-bar {
38+ position : fixed ;
39+ display : flex ;
40+ align-items : center ;
41+ justify-content : center ;
42+ top : 0 ;
43+
44+ width : 100% ;
45+
46+ height : 30px ;
47+ font-size : 13px ;
48+ background : #402c6b ;
49+ border-bottom : 1px solid #583c93 ;
50+
51+ span {
52+ margin-right : 20px ;
53+ }
54+
55+ button {
56+ padding : 3px 8px ;
57+ font-size : 10px ;
58+ border-radius : 7px ;
59+ margin-right : 4px ;
60+ }
61+ }
62+ </style >
Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ export interface InitSettings {
2525
2626 // this will hold a Layout JSON to load from the backend
2727 configStr : string ;
28+
29+ updateVersion : {
30+ checked : boolean ;
31+ local_version : string ;
32+ current_version : string ;
33+ current_version_published : string ;
34+ download_link : string ;
35+ blog_link : string ;
36+ excerpt : string ;
37+ }
2838}
2939
3040type ReceiveStatus = "paused" | "following" | "following_cursor"
@@ -413,6 +423,22 @@ export const useMainStore = defineStore("main", () => {
413423 }
414424 } )
415425
426+ const getUpdate = ( ) => {
427+ return initSettings . value ?. updateVersion
428+ }
429+
430+ const notificationBar = computed ( ( ) => {
431+
432+ return false // for until its finished
433+
434+ // if (!initSettings.value) {
435+ // return false
436+ // }
437+
438+ // return initSettings.value?.updateVersion.checked &&
439+ // initSettings.value.updateVersion.current_version != initSettings.value.updateVersion.local_version
440+ } )
441+
416442 watch ( searchbar , ( newVal ) => {
417443 if ( ! isRecordJson . value ) {
418444 return
@@ -445,6 +471,9 @@ export const useMainStore = defineStore("main", () => {
445471 status,
446472 statusStr,
447473
474+ notificationBar,
475+ getUpdate,
476+
448477 receiveStatus,
449478 receiveCounters,
450479 changeReceiveStatus,
You can’t perform that action at this time.
0 commit comments