Skip to content

Commit

Permalink
disable filteringy
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Jan 27, 2023
1 parent abd7452 commit 49ff6db
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 84 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@popperjs/core": "2.11.6",
"@vue-leaflet/vue-leaflet": "0.6.1",
"@vueuse/core": "9.10.0",
"@vueuse/head": "1.0.22",
"@vueuse/head": "1.0.23",
"array-timsort": "1.0.3",
"country-code-emoji": "2.3.0",
"cross-fetch": "3.1.5",
Expand Down
17 changes: 13 additions & 4 deletions src/components/layout/HeaderComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,23 @@ nav.menu a:hover {
import { Disclosure, DisclosureButton, DisclosurePanel, Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
import { Bars3Icon, XMarkIcon } from '@heroicons/vue/24/outline'
import { defineComponent } from 'vue'
import { defineComponent, defineAsyncComponent } from 'vue'
import { setupStore } from '@/store'
import UserLib from '@/shared/user-lib.js'
// import PreferencesComponent from '@/components/PreferencesComponent.vue'
import AuthComponent from '@/components/user/AuthComponent.vue'
import DarkMode from '@/components/partials/DarkMode.vue'
import About from '@/components/partials/AboutNostrWatch.vue'
const About = defineAsyncComponent(() =>
import("@/components/partials/AboutNostrWatch.vue" /* webpackChunkName: "About" */)
);
const DarkMode = defineAsyncComponent(() =>
import("@/components/partials/DarkMode.vue" /* webpackChunkName: "DarkMode" */)
);
const AuthComponent = defineAsyncComponent(() =>
import("@/components/user/AuthComponent.vue" /* webpackChunkName: "AuthComponent" */)
);
import {version} from '../../../package.json'
Expand Down
17 changes: 10 additions & 7 deletions src/components/relays/blocks/RelaysResultTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<th scope="col" class="location text-center" v-tooltip:top.tooltip="'Detected location of Relay'">
<code class="text-xs block">Location</code>
</th>
<th scope="col" class="uptime text-center" v-tooltip:top.tooltip="'Detected location of Relay'">
<th v-if="subsection != 'favorite'" scope="col" class="uptime text-center" v-tooltip:top.tooltip="'Detected location of Relay'">
<code class="text-xs block">Uptime(12h)</code>
</th>
<th scope="col" class="latency text-center" v-tooltip:top.tooltip="'Relay Latency on Read'">
Expand Down Expand Up @@ -125,7 +125,7 @@
{{ getFlag(relay) }}
</td>

<td class="w-24 latency text-center">
<td v-if="subsection != 'favorite'" class="w-24 latency text-center">
<div class="sm:px-6 text-sm font-bold h-full">
<span :class="getUptimeColor(relay)" v-if="this.results[relay]?.uptime">
{{ this.results[relay]?.uptime }}%
Expand Down Expand Up @@ -256,21 +256,25 @@
</template>

<script>
import { defineComponent, toRefs } from 'vue'
import { defineComponent, defineAsyncComponent, toRefs } from 'vue'
import { countryCodeEmoji } from 'country-code-emoji';
import emoji from 'node-emoji';
import crypto from 'crypto'
import { Switch } from '@headlessui/vue'
// import { Switch } from '@headlessui/vue'
// import SingleClearnet from '@/components/relays/SingleClearnet.vue'
import RelaysLib from '@/shared/relays-lib.js'
import UserLib from '@/shared/user-lib.js'
// import { screenIs } from '@/shared/layout.js'
import {validateEvent, getEventHash, verifySignature} from 'nostr-tools'
import { validateEvent, getEventHash, verifySignature } from 'nostr-tools'
import { setupStore } from '@/store'
const Switch = defineAsyncComponent(() =>
import("@headlessui/vue" /* webpackChunkName: "Switch" */)
);
const localMethods = {
setRandomRelay(){
Expand Down Expand Up @@ -307,9 +311,8 @@
}
export default defineComponent({
name: 'ListClearnet',
name: 'RelaysResultTable',
components: {
// SingleClearnet,
Switch,
},
setup(props){
Expand Down
16 changes: 7 additions & 9 deletions src/components/relays/pages/RelaysFind.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,13 @@ import { setupStore } from '@/store'
import RelaysLib from '@/shared/relays-lib.js'
import SharedComputed from '@/shared/computed.js'
import { parseHash } from '@/shared/hash-router.js'
import NostrSync from '@/components/relays/partials/NostrSync.vue'
//components
// import RelaysFindNav from '@/components/relays/nav/RelaysFindNav.vue'
// import RelaysResultTable from '@/components/relays/blocks/RelaysResultTable.vue'
// import MapSummary from '@/components/relays/blocks/MapSummary.vue'
//data
import { relays } from '../../../../relays.yaml'
import { geo } from '../../../../cache/geo.yaml'
const localMethods = {}
//async components
const NostrSync = defineAsyncComponent(() =>
import("@/components/relays/partials/NostrSync.vue" /* webpackChunkName: "NostrSync" */)
);
const MapSummary = defineAsyncComponent(() =>
import("@/components/relays/blocks/MapSummary.vue" /* webpackChunkName: "MapSummary" */)
Expand All @@ -92,6 +88,8 @@ const RelaysResultTable = defineAsyncComponent(() =>
import("@/components/relays/blocks/RelaysResultTable.vue" /* webpackChunkName: "RelaysResultTable" */)
);
const localMethods = {}
export default defineComponent({
name: 'HomePage',
Expand Down
8 changes: 4 additions & 4 deletions src/components/relays/pages/RelaysStatistics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ export default defineComponent({
this.byContinent = this.collateContinents
this.byCountry = this.collateCountries
this.bySoftware = this.collateSoftware
this.store.stats.set('nips', this.bySupportedNips)
this.store.stats.set('continents', this.byContinent)
this.store.stats.set('countries', this.byCountry)
this.store.stats.set('software', this.bySoftware)
// this.store.stats.set('nips', this.bySupportedNips)
// this.store.stats.set('continents', this.byContinent)
// this.store.stats.set('countries', this.byCountry)
// this.store.stats.set('software', this.bySoftware)
},
async mounted(){
Expand Down
2 changes: 1 addition & 1 deletion src/components/relays/partials/NostrSync.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import { RelayPool } from 'nostr'
import objHash from 'object-hash'
export default defineComponent({
name: "NostrSyncPopoverNag",
name: "NostrSync",
setup(props){
const {editorProp: editor} = toRefs(props)
return {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/relays-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
})
},
getRelays(relays){
relays = this.filterRelays(relays)
// relays = this.filterRelays(relays)
relays = this.sortRelays(relays)
return relays
},
Expand Down
67 changes: 38 additions & 29 deletions src/store/layout.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
import { defineStore } from 'pinia'

export const useLayoutStore = defineStore('layout', {
state: () => ({
mapExpanded: false,
editorExpanded: false,
active: {},
nav: {},
activeTab: null,
}),
getters: {
getActiveTab: (state) => state.activeTab,
getActive: (state) => (section) => state.active[section],
getActiveItem: (state) => (section) => state.nav[section]?.filter( item => item.slug == state.active[section])[0],
getNav: (state) => state.nav,
getNavGroup: (state) => (group) => state.nav[group],
mapIsExpanded: (state) => state.mapExpanded,
editorIsExpanded: state => state.editorExpanded,
},
actions: {
deactivateTab(tabId){
if(this.activeTab === tabId)
this.activeTab = null
export const useLayoutStore = defineStore(
'layout',
{
state: () => ({
mapExpanded: false,
editorExpanded: false,
active: {},
nav: {},
activeTab: null,
}),
getters: {
getActiveTab: (state) => state.activeTab,
getActive: (state) => (section) => state.active[section],
getActiveItem: (state) => (section) => state.nav[section]?.filter( item => item.slug == state.active[section])[0],
getNav: (state) => state.nav,
getNavGroup: (state) => (group) => state.nav[group],
mapIsExpanded: (state) => state.mapExpanded,
editorIsExpanded: state => state.editorExpanded,
},
setActiveTab(tabId){ this.activeTab = tabId },
setNavItems(section, items){ this.nav[section] = items },
setActive(section, slug){ this.active[section] = slug },
toggleMap(){ this.mapExpanded = !this.mapExpanded },
toggleEditor(){ this.editorExpanded = !this.editorExpanded },
editorOff(){ this.editorExpanded = false }
},
})
actions: {
deactivateTab(tabId){
if(this.activeTab === tabId)
this.activeTab = null
},
setActiveTab(tabId){ this.activeTab = tabId },
setNavItems(section, items){ this.nav[section] = items },
setActive(section, slug){ this.active[section] = slug },
toggleMap(){ this.mapExpanded = !this.mapExpanded },
toggleEditor(){ this.editorExpanded = !this.editorExpanded },
editorOff(){ this.editorExpanded = false }
},
share: {
// An array of fields that the plugin will ignore.
omit: ['mapExpanded', 'editorExpanded', 'activeTab', 'active'],
// Override global config for this store.
enable: true,
},
}
)
4 changes: 3 additions & 1 deletion src/store/tasks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { defineStore } from 'pinia'

export const useTaskStore = defineStore('tasks', {
export const useTaskStore = defineStore(
'tasks',
{
state: () => ({
lastUpdate: new Object(),

Expand Down
54 changes: 27 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1587,34 +1587,34 @@
dependencies:
"@types/yargs-parser" "*"

"@unhead/dom@^1.0.9":
version "1.0.15"
resolved "https://registry.yarnpkg.com/@unhead/dom/-/dom-1.0.15.tgz#03d65840fa4dea279ad70241e36939aa33ee61c1"
integrity sha512-W3P9eGazfQPMZTG4ryb5oOA02Z4o16Jxo8DAihF/7Xmg/FVYY5Up9p9et7Nbb6AKNgt1PEz3Sp0xBaw+F6Uyjw==
"@unhead/dom@^1.0.18":
version "1.0.18"
resolved "https://registry.yarnpkg.com/@unhead/dom/-/dom-1.0.18.tgz#bba1e160ab8058597d3f1d0d63a431e1ead9697f"
integrity sha512-zX7w/Z3a1/spyQ3SuxB/0s1Tjx8zu5RzYBBXTtYvGutF8g/ScXreC0c5Vm5F3x4HOPdWG+71Qr/M+k6AxPLHDA==
dependencies:
"@unhead/schema" "1.0.15"
"@unhead/schema" "1.0.18"

"@unhead/[email protected].15", "@unhead/schema@^1.0.9":
version "1.0.15"
resolved "https://registry.yarnpkg.com/@unhead/schema/-/schema-1.0.15.tgz#1e0ac9ff3261ce15adfcd69eb323768ce973811a"
integrity sha512-aWgHDHcemcx20zZun2hCFvZC6Ob4h14D4puhknuQoMkMOZcxh2ffYoJHb6mS3TeQRwAXCOsSFIHAgwIbayjk0w==
"@unhead/[email protected].18", "@unhead/schema@^1.0.18":
version "1.0.18"
resolved "https://registry.yarnpkg.com/@unhead/schema/-/schema-1.0.18.tgz#c8c5bc9b43a21a85c681c337e6b038b6b5b29e85"
integrity sha512-LjNxwwQMZTD0b3LlB4/mmCZpO6HP7ZjK5sKuMpy7/+2O9HJO6TefxsDVrJVAitdUfm5Jej9cNEjnL2gJkc2uWg==
dependencies:
"@zhead/schema" "^1.0.9"
hookable "^5.4.2"

"@unhead/ssr@^1.0.9":
version "1.0.15"
resolved "https://registry.yarnpkg.com/@unhead/ssr/-/ssr-1.0.15.tgz#96a9d3cd1c2e583d86553214d4e04622e8063304"
integrity sha512-WNFljr+HaWdrBVYyKcgLXIk5EldPSKEVJlFbo2ixmSVGnFlqMHMCui/ZrfMLG1QvvFw0ZkXonapkEc/S6loSCQ==
"@unhead/ssr@^1.0.18":
version "1.0.18"
resolved "https://registry.yarnpkg.com/@unhead/ssr/-/ssr-1.0.18.tgz#9bc15ef09fc195177ec9461972fd2caec27bb2fc"
integrity sha512-In0bJSLAyN8DdCuNJaoOIrjsK40g904ELR/0Eue9VzyO0fe147dPGfYlwwUrZOqj0JzGtndiQCF/D6bjn76ovw==
dependencies:
"@unhead/schema" "1.0.15"
"@unhead/schema" "1.0.18"

"@unhead/vue@^1.0.9":
version "1.0.15"
resolved "https://registry.yarnpkg.com/@unhead/vue/-/vue-1.0.15.tgz#b5cc91045e101e82276f9966976a608abe61f957"
integrity sha512-D2NQH8fBKdYgTdIDrarx24qDEblgLIwzPDeAY36PyP6ib8oG6oaI+5lrpMG+NtQ7k9LBqL5d6mQgYn/02kdjZg==
"@unhead/vue@^1.0.18":
version "1.0.18"
resolved "https://registry.yarnpkg.com/@unhead/vue/-/vue-1.0.18.tgz#9b00e95a62966324a8a6d4749be6883c141a85c1"
integrity sha512-VZ61a2pRtGXI9sj1aba5Qmm35veVvRDIE0Xsog3I0TfwavlwklZcg9bF2eT+GcDnsq1NxNO7uDyrb/+xNAzSxA==
dependencies:
"@unhead/schema" "1.0.15"
"@unhead/schema" "1.0.18"
hookable "^5.4.2"

"@vue-leaflet/[email protected]":
Expand Down Expand Up @@ -2014,15 +2014,15 @@
"@vueuse/shared" "9.10.0"
vue-demi "*"

"@vueuse/[email protected].22":
version "1.0.22"
resolved "https://registry.yarnpkg.com/@vueuse/head/-/head-1.0.22.tgz#66b591d6e4dc636c6578d1c04a96bd6c2e00f3b6"
integrity sha512-YmUdbzNdCnhmrAFxGnJS+Rixj+swE+TQC9OEaYDHIro6gE7W11jugcdwVP00HrA4WRQhg+TOQ4YcY2oL/PP1hw==
"@vueuse/[email protected].23":
version "1.0.23"
resolved "https://registry.yarnpkg.com/@vueuse/head/-/head-1.0.23.tgz#1834f4c08fe01f970074c0af1051275473f6e696"
integrity sha512-CiC9VWYbvwAqjWDBJH4WfQfBk7NWMZpvmpvIUYsm3X+aa8QHMiDGzR+RFKZSUtykiCGnSZk97yIvo5eJBmSh8A==
dependencies:
"@unhead/dom" "^1.0.9"
"@unhead/schema" "^1.0.9"
"@unhead/ssr" "^1.0.9"
"@unhead/vue" "^1.0.9"
"@unhead/dom" "^1.0.18"
"@unhead/schema" "^1.0.18"
"@unhead/ssr" "^1.0.18"
"@unhead/vue" "^1.0.18"

"@vueuse/[email protected]":
version "9.10.0"
Expand Down

0 comments on commit 49ff6db

Please sign in to comment.