mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-06-03 04:59:23 +02:00
noogle: select search time
This commit is contained in:
parent
7a21454572
commit
9351e32c0f
@ -12,6 +12,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@rust-nostr/nostr-sdk": "^0.10.0",
|
||||
"@vuepic/vue-datepicker": "^7.4.1",
|
||||
"@vueuse/core": "^10.7.2",
|
||||
"bech32": "^2.0.0",
|
||||
"bootstrap": "^5.3.2",
|
||||
@ -25,9 +26,10 @@
|
||||
"webln": "^0.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node20": "^20.1.2",
|
||||
"@types/node": "^20.11.10",
|
||||
"@vitejs/plugin-vue": "^4.5.2",
|
||||
"@vue/tsconfig": "^0.5.1",
|
||||
"@types/node": "^20.11.10",
|
||||
"autoprefixer": "^10.4.17",
|
||||
"postcss": "^8.4.33",
|
||||
"sass": "^1.70.0",
|
||||
@ -35,8 +37,7 @@
|
||||
"typescript": "~5.3.0",
|
||||
"vite": "^5.0.10",
|
||||
"vue-router": "^4.2.5",
|
||||
"vue-tsc": "^1.8.27",
|
||||
"@tsconfig/node20": "^20.1.2"
|
||||
"vue-tsc": "^1.8.27"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-linux-x64-gnu": "4.6.1"
|
||||
|
@ -17,7 +17,7 @@ import store from '../store';
|
||||
import miniToastr from "mini-toastr";
|
||||
import VueNotifications from "vue-notifications";
|
||||
import searchdvms from './data/searchdvms.json'
|
||||
import {computed, defineEmits, watch} from "vue";
|
||||
import {computed, watch} from "vue";
|
||||
import countries from "@/components/data/countries.json";
|
||||
import deadnip89s from "@/components/data/deadnip89s.json";
|
||||
import {data} from "autoprefixer";
|
||||
@ -42,18 +42,22 @@ const sleep = (ms) => {
|
||||
|
||||
async function post_note(note){
|
||||
let client = store.state.client
|
||||
let tags = []
|
||||
|
||||
if (localStorage.getItem('nostr-key-method') === 'android-signer') {
|
||||
const draft = {
|
||||
content: note,
|
||||
kind: 1,
|
||||
pubkey: store.state.pubkey.toHex(),
|
||||
tags: [],
|
||||
tags: tags,
|
||||
createdAt: Date.now()
|
||||
};
|
||||
const eventJson = await amberSignerService.signEvent(draft);
|
||||
await client.sendEvent(Event.fromJson(JSON.stringify(eventJson)));
|
||||
} else {
|
||||
await client.publishTextNote(note, []);
|
||||
}
|
||||
else
|
||||
{
|
||||
await client.publishTextNote(note, tags);
|
||||
}
|
||||
}
|
||||
async function generate_image(message) {
|
||||
@ -71,22 +75,24 @@ async function generate_image(message) {
|
||||
dvms = []
|
||||
store.commit('set_imagedvm_results', dvms)
|
||||
let client = store.state.client
|
||||
let tags = []
|
||||
console.log(message)
|
||||
tags.push(Tag.parse(["i", message, "text"]))
|
||||
|
||||
let evt = new EventBuilder(5100, "NIP 90 Image Generation request", tags)
|
||||
let content = "NIP 90 Image Generation request"
|
||||
let kind = 5100
|
||||
let tags = [
|
||||
["i", message, "text"]
|
||||
]
|
||||
|
||||
|
||||
|
||||
let res;
|
||||
let requestid;
|
||||
|
||||
if (localStorage.getItem('nostr-key-method') === 'android-signer') {
|
||||
let draft = {
|
||||
content: "NIP 90 Image Generation request",
|
||||
kind: 5100,
|
||||
content: content,
|
||||
kind: kind,
|
||||
pubkey: store.state.pubkey.toHex(),
|
||||
tags: [
|
||||
["i", message, "text"]
|
||||
],
|
||||
tags: tags,
|
||||
createdAt: Date.now()
|
||||
};
|
||||
|
||||
@ -94,7 +100,15 @@ async function generate_image(message) {
|
||||
await client.sendEvent(Event.fromJson(JSON.stringify(res)))
|
||||
requestid = res.id;
|
||||
res = res.id;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
|
||||
let tags_t = []
|
||||
for (let tag of tags){
|
||||
tags_t.push(Tag.parse(tag))
|
||||
}
|
||||
let evt = new EventBuilder(kind, content, tags_t)
|
||||
|
||||
res = await client.sendEventBuilder(evt);
|
||||
requestid = res.toHex();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { defineProps, defineEmits, ref } from "vue";
|
||||
import { ref } from "vue";
|
||||
import {onClickOutside} from '@vueuse/core'
|
||||
|
||||
const props = defineProps({
|
||||
|
@ -20,6 +20,8 @@ import countries from "@/components/data/countries.json";
|
||||
import deadnip89s from "@/components/data/deadnip89s.json";
|
||||
import Nip07 from "@/components/Nip07.vue";
|
||||
import amberSignerService from "./android-signer/AndroidSigner";
|
||||
import VueDatePicker from '@vuepic/vue-datepicker';
|
||||
import '@vuepic/vue-datepicker/dist/main.css'
|
||||
|
||||
let items = []
|
||||
let dvms =[]
|
||||
@ -28,6 +30,12 @@ let searching = false
|
||||
|
||||
const message = ref("");
|
||||
|
||||
|
||||
|
||||
|
||||
const datefrom = ref(new Date().setFullYear(new Date().getFullYear() - 1));
|
||||
const dateto = ref(Date.now());
|
||||
|
||||
onMounted(async () => {
|
||||
let urlParams = new URLSearchParams(window.location.search);
|
||||
if (urlParams.has('q')) {
|
||||
@ -63,7 +71,7 @@ async function send_search_request(msg) {
|
||||
store.commit('set_search_results', items)
|
||||
let client = store.state.client
|
||||
|
||||
let tags = []
|
||||
|
||||
let users = [];
|
||||
|
||||
const taggedUsersFrom = msg.split(' ')
|
||||
@ -72,9 +80,6 @@ async function send_search_request(msg) {
|
||||
|
||||
// search
|
||||
let search = msg;
|
||||
|
||||
// tags
|
||||
|
||||
for (let word of taggedUsersFrom) {
|
||||
search = search.replace(word, "");
|
||||
if(word === "me"){
|
||||
@ -88,23 +93,27 @@ async function send_search_request(msg) {
|
||||
msg = search.replace(/from:|to:|@/g, '').trim();
|
||||
console.log(search);
|
||||
|
||||
tags.push(Tag.parse(["i", msg, "text"]))
|
||||
tags.push(Tag.parse(["param", "max_results", "150"]))
|
||||
tags.push(Tag.parse(['param', 'users', JSON.stringify(users)]))
|
||||
let content = "NIP 90 Search request"
|
||||
let kind = 5302
|
||||
console.log((datefrom.value/1000).toFixed(0))
|
||||
console.log((dateto.value/1000).toFixed(0))
|
||||
let tags = [
|
||||
["i", msg, "text"],
|
||||
["param", "max_results", "150"],
|
||||
["param", "since", ((datefrom.value/1000).toFixed(0))],
|
||||
["param", "until", ((dateto.value/1000).toFixed(0))],
|
||||
['param', 'users', JSON.stringify(users)]
|
||||
]
|
||||
|
||||
|
||||
let evt = new EventBuilder(5302, "NIP 90 Search request", tags)
|
||||
let res;
|
||||
let requestid;
|
||||
if (localStorage.getItem('nostr-key-method') === 'android-signer') {
|
||||
let draft = {
|
||||
content: "NIP 90 Search request",
|
||||
kind: 5302,
|
||||
content: content,
|
||||
kind: kind,
|
||||
pubkey: store.state.pubkey.toHex(),
|
||||
tags: [
|
||||
["i", msg, "text"],
|
||||
["param", "max_results", "150"],
|
||||
['param', 'users', JSON.stringify(users)]
|
||||
],
|
||||
tags: tags,
|
||||
createdAt: Date.now()
|
||||
};
|
||||
|
||||
@ -112,7 +121,15 @@ async function send_search_request(msg) {
|
||||
await client.sendEvent(Event.fromJson(JSON.stringify(res)))
|
||||
requestid = res.id;
|
||||
res = res.id;
|
||||
} else {
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
let tags_t = []
|
||||
for (let tag of tags){
|
||||
tags_t.push(Tag.parse(tag))
|
||||
}
|
||||
let evt = new EventBuilder(kind, content, tags_t)
|
||||
res = await client.sendEventBuilder(evt)
|
||||
requestid = res.toHex()
|
||||
}
|
||||
@ -379,12 +396,24 @@ defineProps({
|
||||
<button class="v-Button" @click="send_search_request(message)">Search the Nostr</button>
|
||||
</h3>
|
||||
|
||||
<!-- <details class="collapse bg-base">
|
||||
<summary class="collapse-title font-thin bg ">Advanced Settings</summary>
|
||||
<div class="collapse-content">
|
||||
<p>content</p>
|
||||
<details class="collapse bg-base " className="advanced" >
|
||||
<summary class="collapse-title font-thin bg">Advanced Options</summary>
|
||||
<div class="collapse-content font-size-0" className="z-10" id="collapse-settings">
|
||||
<div>
|
||||
<h4 className="inline-flex flex-none font-thin">from:</h4>
|
||||
<div className="inline-flex flex-none" style="width: 10px;"></div>
|
||||
<VueDatePicker :teleport="true" :dark="true" position="left" className="bg-base-200 inline-flex flex-none" style="width: 220px;" v-model="datefrom"></VueDatePicker>
|
||||
</div>
|
||||
|
||||
<div className="inline-flex flex-none" style="width: 20px;"></div>
|
||||
<div>
|
||||
<h4 className="inline-flex font-thin ">until: </h4>
|
||||
<div className="inline-flex flex-none" style="width: 10px;"></div>
|
||||
<VueDatePicker :teleport="true" :dark="true" position="left" className="bg-base-200 inline-flex flex-none" style="width: 220px;" v-model="dateto"></VueDatePicker>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</details> -->
|
||||
</details>
|
||||
|
||||
</div>
|
||||
<div class="max-w-5xl relative space-y-3">
|
||||
@ -441,6 +470,10 @@ h3 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1.0rem;
|
||||
}
|
||||
|
||||
.greetings h1,
|
||||
.greetings h3 {
|
||||
text-align: center;
|
||||
|
@ -9,6 +9,12 @@ import 'vue3-easy-data-table/dist/style.css';
|
||||
import router from './router'
|
||||
import Vue3EasyDataTable from 'vue3-easy-data-table';
|
||||
|
||||
import VueDatePicker from '@vuepic/vue-datepicker';
|
||||
import '@vuepic/vue-datepicker/dist/main.css'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -32,13 +38,11 @@ const options = {
|
||||
}
|
||||
//This is all for notifications end
|
||||
|
||||
|
||||
|
||||
|
||||
createApp(App)
|
||||
.use(VueNotifications, options)
|
||||
.use(store)
|
||||
.use(router)
|
||||
|
||||
.component('EasyDataTable', Vue3EasyDataTable)
|
||||
.component('VueDatePicker', VueDatePicker)
|
||||
.mount('#app')
|
||||
|
Loading…
x
Reference in New Issue
Block a user