autofocus
This commit is contained in:
1 parent
94dfe7c082
commit
4041d9827d
4 files changed
+19
-6
No files matched your search
@@ -1,5 +1,6 @@
|
|||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
|
// include for node docker image
|
||||||
binaryTargets = ["native", "debian-openssl-1.1.x"]
|
binaryTargets = ["native", "debian-openssl-1.1.x"]
|
||||||
previewFeatures = ["interactiveTransactions"]
|
previewFeatures = ["interactiveTransactions"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { h } from 'preact';
|
import { h } from 'preact';
|
||||||
import { useState } from 'preact/hooks';
|
import { useState, useRef, useEffect } from 'preact/hooks';
|
||||||
import axios from 'axios';
|
|
||||||
import { ExternalLink, Check } from 'react-feather';
|
import { ExternalLink, Check } from 'react-feather';
|
||||||
|
|
||||||
import actions from '../actions';
|
import actions from '../actions';
|
||||||
@@ -62,6 +61,12 @@ const User = () => {
|
|||||||
console.log('synced', wants.length, 'wants');
|
console.log('synced', wants.length, 'wants');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const searchRef = useRef<HTMLInputElement>()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
searchRef.current.focus()
|
||||||
|
}, [])
|
||||||
|
|
||||||
function handleSubmit(e) {
|
function handleSubmit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
fetchResults();
|
fetchResults();
|
||||||
@@ -85,21 +90,21 @@ const User = () => {
|
|||||||
<div>
|
<div>
|
||||||
<form action="" method="get">
|
<form action="" method="get">
|
||||||
<label for="artist">Artist</label>
|
<label for="artist">Artist</label>
|
||||||
<input type="text" name="artist" placeholder="Ben Klock" id="artist" value={artist} onChange={e => setArtist((e.target as HTMLInputElement).value) } required />
|
<input type="text" name="artist" ref={searchRef} placeholder="Ben Klock" id="artist" value={artist} onChange={e => setArtist((e.target as HTMLInputElement).value) } required />
|
||||||
<label for="title">Title</label>
|
<label for="title">Title</label>
|
||||||
<input type="text" name="title" placeholder="Subzero" id="title" value={title} onChange={e => setTitle((e.target as HTMLInputElement).value)} required />
|
<input type="text" name="title" placeholder="Subzero" id="title" value={title} onChange={e => setTitle((e.target as HTMLInputElement).value)} required />
|
||||||
<input type="submit" value="Search" onClick={handleSubmit} />
|
<input type="submit" value="Search" onClick={handleSubmit} />
|
||||||
</form>
|
</form>
|
||||||
<p>Data provided by Discogs.</p>
|
|
||||||
<hr />
|
<hr />
|
||||||
<div>
|
<div>
|
||||||
<p>Sync Discogs Wantlist</p>
|
|
||||||
<form action="" method="get">
|
<form action="" method="get">
|
||||||
<label for="Discogs">Discogs Username</label>
|
<label for="Discogs">Discogs Username</label>
|
||||||
<input type="text" name="username" placeholder="Discogs Username" id="username" value={username} onChange={e => setUsername((e.target as HTMLInputElement).value) } required />
|
<input type="text" name="username" placeholder="Discogs Username" id="username" value={username} onChange={e => setUsername((e.target as HTMLInputElement).value) } required />
|
||||||
<input type="submit" value="Sync" onClick={handleDiscogsSubmit} />
|
<input type="submit" value="Sync" onClick={handleDiscogsSubmit} />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<hr />
|
||||||
|
<p>Data provided by Discogs.</p>
|
||||||
</div>
|
</div>
|
||||||
<div />
|
<div />
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -7,6 +7,11 @@ services:
|
|||||||
POSTGRES_USER: 'mcrates'
|
POSTGRES_USER: 'mcrates'
|
||||||
POSTGRES_DB: 'mcrates'
|
POSTGRES_DB: 'mcrates'
|
||||||
POSTGRES_PASSWORD: 'digdeep'
|
POSTGRES_PASSWORD: 'digdeep'
|
||||||
|
|
||||||
|
# allow prisma client to push changes from outside docker etc
|
||||||
|
# ufw blocks this from being publicly accessible
|
||||||
|
ports:
|
||||||
|
- '45432:5432'
|
||||||
volumes:
|
volumes:
|
||||||
- "./db:/var/lib/postgresql/data"
|
- "./db:/var/lib/postgresql/data"
|
||||||
|
|
||||||
@@ -30,7 +35,7 @@ services:
|
|||||||
image: nginx:latest
|
image: nginx:latest
|
||||||
volumes:
|
volumes:
|
||||||
- './nginx/matescrates.au.nginx.conf:/etc/nginx/conf.d/default.conf'
|
- './nginx/matescrates.au.nginx.conf:/etc/nginx/conf.d/default.conf'
|
||||||
- '/etc/letsencrypt'
|
- '/etc/letsencrypt:/etc/letsencrypt'
|
||||||
ports:
|
ports:
|
||||||
- '80:80'
|
- '80:80'
|
||||||
- '443:443'
|
- '443:443'
|
||||||
@@ -23,6 +23,8 @@ services:
|
|||||||
api:
|
api:
|
||||||
image: node:16
|
image: node:16
|
||||||
working_dir: /opt/mcrates/api
|
working_dir: /opt/mcrates/api
|
||||||
|
depends_on:
|
||||||
|
- 'pg'
|
||||||
entrypoint: npm start
|
entrypoint: npm start
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: 'postgresql://mcrates:digdeep@pg:5432/mcrates?schema=public'
|
DATABASE_URL: 'postgresql://mcrates:digdeep@pg:5432/mcrates?schema=public'
|
||||||
|
|||||||
Reference in new issue
Block a user