mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-11-19 00:46:41 +01:00
noogle fixes
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rust-nostr/nostr-sdk": "^0.7.0",
|
"@rust-nostr/nostr-sdk": "^0.8.0",
|
||||||
"mini-toastr": "^0.8.1",
|
"mini-toastr": "^0.8.1",
|
||||||
"vue": "^3.3.11",
|
"vue": "^3.3.11",
|
||||||
"vue-notifications": "^1.0.2",
|
"vue-notifications": "^1.0.2",
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import ResultsTable from "@/components/ResultTable.vue";
|
|||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
<img alt="Nostr logo" class="logo" src="./assets/nostr-purple.svg" width="125" height="125" />
|
|
||||||
<Search/>
|
<Search/>
|
||||||
<br>
|
<br>
|
||||||
<ResultsTable></ResultsTable>
|
<ResultsTable></ResultsTable>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="playeauthor-wrapper" v-if="current_user">
|
<div class="playeauthor-wrapper" v-if="current_user">
|
||||||
<img class="avatar" :src="this.avatar" alt="" />
|
<img class="avatar" :src="this.avatar" alt="" />
|
||||||
<p>Current User is: {{ this.current_user }}</p>
|
<p>{{ this.current_user }}</p>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="current_user">
|
<template v-if="current_user">
|
||||||
<button class="b-Button" @click="sign_out()">Sign out</button>
|
<button class="b-Button" @click="sign_out()">Sign out</button>
|
||||||
@@ -59,6 +59,7 @@ export default {
|
|||||||
let nip07_signer = new Nip07Signer();
|
let nip07_signer = new Nip07Signer();
|
||||||
try{
|
try{
|
||||||
this.signer = ClientSigner.nip07(nip07_signer);
|
this.signer = ClientSigner.nip07(nip07_signer);
|
||||||
|
console.log("SIGNER: " + this.signer)
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -75,23 +76,23 @@ export default {
|
|||||||
await client.addRelay("wss://nos.lol");
|
await client.addRelay("wss://nos.lol");
|
||||||
await client.addRelay("wss://relay.f7z.io")
|
await client.addRelay("wss://relay.f7z.io")
|
||||||
await client.addRelay("wss://pablof7z.nostr1.com")
|
await client.addRelay("wss://pablof7z.nostr1.com")
|
||||||
//await client.addRelay("wss://relay.nostr.net")
|
await client.addRelay("wss://relay.nostr.net")
|
||||||
//await client.addRelay("wss://relay.nostr.band");
|
await client.addRelay("wss://relay.nostr.band");
|
||||||
//await client.addRelay("wss://nostr-pub.wellorder.net")
|
await client.addRelay("wss://nostr-pub.wellorder.net")
|
||||||
|
|
||||||
const pubkey = await nip07_signer.getPublicKey();
|
const pubkey = await nip07_signer.getPublicKey();
|
||||||
await client.connect();
|
await client.connect();
|
||||||
|
|
||||||
|
/*
|
||||||
const filter = new Filter().kind(6302).limit(20)
|
const filter = new Filter().kind(6302).limit(20)
|
||||||
//TODO this next line breaks the code
|
await client.reconcile(filter);
|
||||||
//await client.reconcile(filter);
|
const filterl = new Filter().author(pubkey)
|
||||||
/*const filterl = new Filter().author(pubkey)
|
let test = await client.database.query([filterl])
|
||||||
let test = dbclient.database().query([filterl])
|
|
||||||
for (let ev of test){
|
for (let ev of test){
|
||||||
console.log(ev.as_json())
|
console.log(ev.asJson())
|
||||||
}
|
}*/
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
store.commit('set_client', client)
|
store.commit('set_client', client)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ async function send_search_request(message) {
|
|||||||
tags.push(Tag.parse(["param", "max_results", "100"]))
|
tags.push(Tag.parse(["param", "max_results", "100"]))
|
||||||
let evt = new EventBuilder(5302, "Search for me", tags)
|
let evt = new EventBuilder(5302, "Search for me", tags)
|
||||||
let res = await client.sendEventBuilder(evt)
|
let res = await client.sendEventBuilder(evt)
|
||||||
miniToastr.showMessage("Sent Request to DVMs", "Awaiting results", VueNotifications.types.info)
|
miniToastr.showMessage("Sent Request to DVMs", "Awaiting results", VueNotifications.types.warn)
|
||||||
if (!listener){
|
if (!listener){
|
||||||
listen()
|
listen()
|
||||||
}
|
}
|
||||||
@@ -97,18 +97,14 @@ async function listen() {
|
|||||||
|
|
||||||
|
|
||||||
for (const evt of events){
|
for (const evt of events){
|
||||||
console.log(evt.id.toHex())
|
|
||||||
let p = profiles.find( record => record.author === evt.author.toHex())
|
let p = profiles.find( record => record.author === evt.author.toHex())
|
||||||
console.log(p)
|
|
||||||
let bech32id = evt.id.toBech32()
|
let bech32id = evt.id.toBech32()
|
||||||
let picture = p["profile"]["picture"]
|
let picture = p === undefined ? "../assets/nostr-purple.svg" : p["profile"]["picture"]
|
||||||
|
let name = p === undefined ? bech32id : p["profile"]["name"]
|
||||||
let highlighterurl = "https://highlighter.com/a/" + bech32id
|
let highlighterurl = "https://highlighter.com/a/" + bech32id
|
||||||
let njumpurl = "https://njump.me/" + bech32id
|
let njumpurl = "https://njump.me/" + bech32id
|
||||||
let nostrudelurl = "https://nostrudel.ninja/#/n/" + evt.id.toBech32()
|
let nostrudelurl = "https://nostrudel.ninja/#/n/" + evt.id.toBech32()
|
||||||
|
items.push({ content: evt.content, author: name, authorurl: "https://njump.me/" + evt.author.toBech32(), links: {"highlighter": highlighterurl, "njump": njumpurl, "nostrudel": nostrudelurl} , avatar: picture, indicator: {"time": evt.createdAt.toHumanDatetime()}})
|
||||||
|
|
||||||
|
|
||||||
items.push({ content: evt.content, author: p["profile"]["name"], authorurl: "https://njump.me/" + evt.author.toBech32(), links: {"highlighter": highlighterurl, "njump": njumpurl, "nostrudel": nostrudelurl} , avatar: picture, indicator: {"time": evt.createdAt.toHumanDatetime()}})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -141,8 +137,14 @@ defineProps({
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="greetings">
|
<div class="greetings">
|
||||||
<h1 class="purple">Noogle</h1>
|
<img alt="Nostr logo" class="logo" src="../assets/nostr-purple.svg" width="125" height="125" />
|
||||||
|
|
||||||
|
<h1 class="purple">Noogle</h1>
|
||||||
|
<h2>Nostr Search based on Data Vending Machines</h2>
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
<div>
|
<div>
|
||||||
<button class="c-Button" @click="send_search_request(message)">Search the Nostr
|
<button class="c-Button" @click="send_search_request(message)">Search the Nostr
|
||||||
</button> <input class="c-Input" v-model="message" >
|
</button> <input class="c-Input" v-model="message" >
|
||||||
@@ -180,6 +182,9 @@ h1 {
|
|||||||
position: relative;
|
position: relative;
|
||||||
top: -10px;
|
top: -10px;
|
||||||
}
|
}
|
||||||
|
h2 {
|
||||||
|
font-size: 1.0rem;
|
||||||
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user