mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2024-11-16 17:07:36 +00:00
chore: Fix formatting (prettier)
This commit is contained in:
parent
38320bc316
commit
8df90ef5e2
12 changed files with 114 additions and 149 deletions
11
README.md
11
README.md
|
@ -6,13 +6,13 @@ Source code of [https://xmr.ditatompel.com](https://xmr.ditatompel.com), a websi
|
|||
|
||||
### Server & Prober requirements
|
||||
|
||||
- Go >= 1.22
|
||||
- Linux Machine (AMD64 or ARM64)
|
||||
- Go >= 1.22
|
||||
- Linux Machine (AMD64 or ARM64)
|
||||
|
||||
### Server requirements
|
||||
|
||||
- MySQL/MariaDB
|
||||
- [GeoIP Database](https://dev.maxmind.com/geoip/geoip2/geolite2/) (optional). Place it to `./assets/geoip`, see [./internal/geo/ip.go](./internal/geo/ip.go).
|
||||
- MySQL/MariaDB
|
||||
- [GeoIP Database](https://dev.maxmind.com/geoip/geoip2/geolite2/) (optional). Place it to `./assets/geoip`, see [./internal/geo/ip.go](./internal/geo/ip.go).
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -23,8 +23,6 @@ Source code of [https://xmr.ditatompel.com](https://xmr.ditatompel.com), a websi
|
|||
3. Build the binary with `make build`.
|
||||
4. Run the service with `./bin/xmr-nodes-server-linux-<YOUR_CPU_ARCH> serve`.
|
||||
|
||||
To create admin user (for creating proberAPI key from Web-UI, execute `./bin/xmr-nodes-server-linux-<YOUR_CPU_ARCH> admin create`).
|
||||
|
||||
Systemd example: [./tools/resources/init/xmr-nodes-server.service](./tools/resources/init/xmr-nodes-server.service).
|
||||
|
||||
### For initial prober setup:
|
||||
|
@ -35,4 +33,3 @@ Systemd example: [./tools/resources/init/xmr-nodes-server.service](./tools/resou
|
|||
4. Run the service with `./bin/xmr-nodes-client-linux-<YOUR_CPU_ARCH> probe`.
|
||||
|
||||
Systemd example: [xmr-nodes-prober.service](./tools/resources/init/xmr-nodes-prober.service) and [xmr-nodes-prober.timer](./tools/resources/init/xmr-nodes-prober.timer).
|
||||
|
||||
|
|
|
@ -1,35 +1,3 @@
|
|||
# UI
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
|
||||
|
||||
## Developing
|
||||
|
||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
|
||||
# or start the server and open the app in a new browser tab
|
||||
npm run dev -- --open
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
To create a production version of your app:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
||||
|
||||
## Deploying
|
||||
|
||||
after running `npm run build` from development device, copy `./build`, `package.json` and `package-lock.json` to server. On the server, run `npm ci --omit dev` then restart the systemd service.
|
||||
|
||||
Playbook example (run from root project):
|
||||
```shell
|
||||
ansible-playbook -i ./utils/ansible/inventory.ini -l production ./utils/ansible/deploy.yml -K
|
||||
```
|
||||
The UI is generated and embedded when the Go project is built. See [./frontend/embed.go](https://github.com/ditatompel/xmr-remote-nodes/blob/main/frontend/embed.go#L10-L13).
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -8,19 +8,18 @@ body {
|
|||
@apply h-full;
|
||||
}
|
||||
p {
|
||||
@apply mb-2;
|
||||
@apply mb-2;
|
||||
}
|
||||
.link {
|
||||
@apply text-primary-800 dark:text-primary-500 hover:brightness-110;
|
||||
@apply text-primary-800 dark:text-primary-500 hover:brightness-110;
|
||||
}
|
||||
a.external {
|
||||
@apply link after:content-['_↗']
|
||||
@apply link after:content-['_↗'];
|
||||
}
|
||||
.section-container {
|
||||
@apply mx-auto w-full max-w-7xl p-4;
|
||||
@apply mx-auto w-full max-w-7xl p-4;
|
||||
}
|
||||
.hero-gradient {
|
||||
background-image:
|
||||
radial-gradient(at 0% 0%, rgba(242, 104, 34, .4) 0px, transparent 50%),
|
||||
radial-gradient(at 98% 1%, rgba(var(--color-warning-900) / 0.33) 0px, transparent 50%);
|
||||
background-image: radial-gradient(at 0% 0%, rgba(242, 104, 34, 0.4) 0px, transparent 50%),
|
||||
radial-gradient(at 98% 1%, rgba(var(--color-warning-900) / 0.33) 0px, transparent 50%);
|
||||
}
|
||||
|
|
50
frontend/src/app.d.ts
vendored
50
frontend/src/app.d.ts
vendored
|
@ -1,33 +1,33 @@
|
|||
// See https://kit.svelte.dev/docs/types#app
|
||||
// for information about these interfaces
|
||||
declare global {
|
||||
namespace App {
|
||||
// interface Error {}
|
||||
// interface Locals {}
|
||||
// interface PageData {}
|
||||
// interface PageState {}
|
||||
// interface Platform {}
|
||||
}
|
||||
interface ImportMetaEnv {
|
||||
VITE_API_URL: string;
|
||||
}
|
||||
namespace App {
|
||||
// interface Error {}
|
||||
// interface Locals {}
|
||||
// interface PageData {}
|
||||
// interface PageState {}
|
||||
// interface Platform {}
|
||||
}
|
||||
interface ImportMetaEnv {
|
||||
VITE_API_URL: string;
|
||||
}
|
||||
|
||||
interface MoneroNode {
|
||||
id: number;
|
||||
hostname: string;
|
||||
ip: string;
|
||||
port: number;
|
||||
protocol: string;
|
||||
is_tor: boolean;
|
||||
is_available: boolean;
|
||||
nettype: string;
|
||||
}
|
||||
interface MoneroNode {
|
||||
id: number;
|
||||
hostname: string;
|
||||
ip: string;
|
||||
port: number;
|
||||
protocol: string;
|
||||
is_tor: boolean;
|
||||
is_available: boolean;
|
||||
nettype: string;
|
||||
}
|
||||
|
||||
interface ApiResponse {
|
||||
status: string;
|
||||
message: string;
|
||||
data: null | object | object[];
|
||||
}
|
||||
interface ApiResponse {
|
||||
status: string;
|
||||
message: string;
|
||||
data: null | object | object[];
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="false" data-theme="skeleton">
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<input
|
||||
class="input-variant-secondary input w-36 sm:w-64"
|
||||
type="search"
|
||||
name="tableGlobalSearch"
|
||||
name="tableGlobalSearch"
|
||||
placeholder="Search..."
|
||||
bind:value
|
||||
on:input={search}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
export const prerender = true
|
||||
export const prerender = true;
|
||||
export const trailingSlash = 'always';
|
||||
|
|
|
@ -9,9 +9,9 @@ export const loadData = async (state) => {
|
|||
};
|
||||
|
||||
export const loadCountries = async () => {
|
||||
const response = await fetch(apiUri('/api/v1/countries'));
|
||||
const json = await response.json();
|
||||
return json.data ?? [];
|
||||
const response = await fetch(apiUri('/api/v1/countries'));
|
||||
const json = await response.json();
|
||||
return json.data ?? [];
|
||||
};
|
||||
|
||||
const getParams = ({ pageNumber, rowsPerPage, sort, filters }) => {
|
||||
|
|
|
@ -1,63 +1,66 @@
|
|||
{
|
||||
"name": "xmr.ditatompel.com",
|
||||
"short_name": "xmr-remote-nodes",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#272b31",
|
||||
"theme_color": "#272b31",
|
||||
"description": "Monero Remote Nodes",
|
||||
"icons": [{
|
||||
"src": "/img/icon/android-icon-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "0.75"
|
||||
}, {
|
||||
"src": "/img/icon/android-icon-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "4.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "4.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/maskable-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}]
|
||||
"name": "xmr.ditatompel.com",
|
||||
"short_name": "xmr-remote-nodes",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#272b31",
|
||||
"theme_color": "#272b31",
|
||||
"description": "Monero Remote Nodes",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/img/icon/android-icon-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "4.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/android-icon-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any",
|
||||
"density": "4.0"
|
||||
},
|
||||
{
|
||||
"src": "/img/icon/maskable-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import forms from '@tailwindcss/forms';
|
|||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
darkMode: 'class',
|
||||
darkMode: 'class',
|
||||
content: [
|
||||
'./src/**/*.{html,js,svelte,ts}',
|
||||
join(require.resolve('@skeletonlabs/skeleton'), '../**/*.{html,js,svelte,ts}')
|
||||
|
@ -13,7 +13,7 @@ export default {
|
|||
extend: {}
|
||||
},
|
||||
plugins: [
|
||||
forms,
|
||||
forms,
|
||||
skeleton({
|
||||
themes: {
|
||||
preset: ['skeleton']
|
||||
|
|
|
@ -3,7 +3,5 @@ import { sveltekit } from '@sveltejs/kit/vite';
|
|||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
sveltekit(),
|
||||
]
|
||||
plugins: [sveltekit()]
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue