mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-09-28 05:17:13 +02:00
noogle: deal with multiple dvms
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -180,3 +180,4 @@ tests/gui/svelte/node_modules
|
|||||||
tests/gui/vuejs/noogle/node_modules
|
tests/gui/vuejs/noogle/node_modules
|
||||||
tests/gui/vuejs/noogle/.idea/
|
tests/gui/vuejs/noogle/.idea/
|
||||||
tests/gui/vuejs/noogle/package-lock.json
|
tests/gui/vuejs/noogle/package-lock.json
|
||||||
|
search.py
|
||||||
|
@@ -128,7 +128,7 @@ async function listen() {
|
|||||||
if (event.kind === 7000) {
|
if (event.kind === 7000) {
|
||||||
try {
|
try {
|
||||||
console.log("7000:", event.content);
|
console.log("7000:", event.content);
|
||||||
miniToastr.showMessage("DVM replied", event.content, VueNotifications.types.info)
|
miniToastr.showMessage(event.content, event.author.toBech32(), VueNotifications.types.info)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error: ", error);
|
console.log("Error: ", error);
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,8 @@ async function listen() {
|
|||||||
else if(event.kind === 6302) {
|
else if(event.kind === 6302) {
|
||||||
let entries = []
|
let entries = []
|
||||||
console.log("6302:", event.content);
|
console.log("6302:", event.content);
|
||||||
miniToastr.showMessage("DVM replied", "Received Results", VueNotifications.types.success)
|
|
||||||
|
miniToastr.showMessage("Received Results", event.author.toBech32(), VueNotifications.types.success)
|
||||||
let event_etags = JSON.parse(event.content)
|
let event_etags = JSON.parse(event.content)
|
||||||
for (let etag of event_etags){
|
for (let etag of event_etags){
|
||||||
const eventid = EventId.fromHex(etag[1])
|
const eventid = EventId.fromHex(etag[1])
|
||||||
@@ -162,13 +163,14 @@ async function listen() {
|
|||||||
let nostrudelurl = "https://nostrudel.ninja/#/n/" + bech32id
|
let nostrudelurl = "https://nostrudel.ninja/#/n/" + bech32id
|
||||||
let uri = "nostr:" + bech32id // nip19.toNostrUri()
|
let uri = "nostr:" + bech32id // nip19.toNostrUri()
|
||||||
|
|
||||||
if (!items.find(e => e.id === evt.id)) {
|
if (items.find(e => e.id === evt.id) === undefined) {
|
||||||
items.push({id:evt.id, content: evt.content, author: name, authorurl: "https://njump.me/" + evt.author.toBech32(), links: {"uri": uri, "highlighter": highlighterurl, "njump": njumpurl, "nostrudel": nostrudelurl} , avatar: picture, indicator: {"time": evt.createdAt.toHumanDatetime()}})
|
items.push({id:evt.id, content: evt.content, author: name, authorurl: "https://njump.me/" + evt.author.toBech32(), links: {"uri": uri, "highlighter": highlighterurl, "njump": njumpurl, "nostrudel": nostrudelurl} , avatar: picture, indicator: {"time": evt.createdAt.toHumanDatetime()}})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
console.log("Events from" + event.author.toHex())
|
||||||
|
console.log(items)
|
||||||
store.commit('set_search_results', items)
|
store.commit('set_search_results', items)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<EasyDataTable class="customize-table" header-text-direction="left" expand v-if="store.state.results.length != 0" table-class-name="customize-table"
|
<EasyDataTable class="customize-table" header-text-direction="left" v-if="store.state.results.length != 0" table-class-name="customize-table"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:items="store.state.results">
|
:items="store.state.results" :sort-by="sortBy"
|
||||||
|
:sort-type="sortType">
|
||||||
<template #item-content="{ content, author, authorurl, avatar, indicator, links}">
|
<template #item-content="{ content, author, authorurl, avatar, indicator, links}">
|
||||||
<div class="playeauthor-wrapper">
|
<div class="playeauthor-wrapper">
|
||||||
<img class="avatar" :src="avatar" alt="" />
|
<img class="avatar" :src="avatar" alt="" />
|
||||||
@@ -37,15 +38,18 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
|
||||||
|
|
||||||
|
import type {Header, Item, SortType} from "vue3-easy-data-table";
|
||||||
import type { Header, Item } from "vue3-easy-data-table";
|
|
||||||
import store from '../store';
|
import store from '../store';
|
||||||
|
|
||||||
|
const sortBy = "indicator.time";
|
||||||
|
const sortType: SortType = "desc";
|
||||||
|
|
||||||
const headers: Header[] = [
|
const headers: Header[] = [
|
||||||
{ text: "Results:", value: "content", fixed:true},
|
{ text: "Results:", value: "content", fixed:true},
|
||||||
// { text: "Time", value: "indicator.time", sortable: true, },
|
// { text: "Time", value: "indicator.time", sortable: true, },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@@ -31,8 +31,12 @@ const store = createStore({
|
|||||||
state.nip89dvms = nip89dvms
|
state.nip89dvms = nip89dvms
|
||||||
},
|
},
|
||||||
set_search_results(state, results){
|
set_search_results(state, results){
|
||||||
state.results = results
|
state.results.length = 0
|
||||||
console.log(state.results)
|
state.results.push.apply(state.results, results)
|
||||||
|
//state.results = []
|
||||||
|
|
||||||
|
//[].push.apply(state.results, results)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user