Add web client (#108)

This commit is contained in:
Manuel 2023-03-08 09:41:55 +01:00 committed by GitHub
parent aed5be7763
commit aac7a2c628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 81 additions and 3 deletions

View File

52
client/index.html Normal file
View File

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html class="h-full bg-gray-100 dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="assets/css/index.css" rel="stylesheet" />
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
clifford: '#da373d',
},
},
},
};
</script>
<title>🎉 Jellyfin Discord Bot</title>
</head>
<body class="h-full">
<div class="min-h-full bg-zinc-900">
<nav class="bg-zinc-800">
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div class="flex h-16 items-center justify-between">
<div class="flex items-center">
<div class="flex-shrink-0">
<img
class="h-8 w-8"
src="https://raw.githubusercontent.com/manuel-rw/jellyfin-discord-music-bot/master/images/icons/jellyfin-icon-squared.png"
alt="Jellyfin logo"
/>
</div>
<span class="ml-5 text-gray-300 text-lg">Discord Bot</span>
</div>
</div>
</div>
</nav>
<div class="mx-auto max-w-7xl py-6 px-4 sm:px-6 lg:px-8">
<h1 class="text-3xl font-bold tracking-tight text-gray-100 text-center">
Jellyfin Discord Bot
</h1>
<h3 class="text-2xl text-gray-300 text-center">
Congratulations, your bot is up and running!
</h3>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}

View File

@ -32,6 +32,7 @@
"@nestjs/event-emitter": "^1.3.1", "@nestjs/event-emitter": "^1.3.1",
"@nestjs/platform-express": "^9.0.0", "@nestjs/platform-express": "^9.0.0",
"@nestjs/schedule": "^2.1.0", "@nestjs/schedule": "^2.1.0",
"@nestjs/serve-static": "^3.0.1",
"@nestjs/terminus": "^9.1.4", "@nestjs/terminus": "^9.1.4",
"date-fns": "^2.29.3", "date-fns": "^2.29.3",
"discord.js": "^14.7.1", "discord.js": "^14.7.1",

View File

@ -7,13 +7,15 @@ import { ScheduleModule } from '@nestjs/schedule';
import * as Joi from 'joi'; import * as Joi from 'joi';
import { ServeStaticModule } from '@nestjs/serve-static';
import { join } from 'path';
import { DiscordConfigService } from './clients/discord/discord.config.service';
import { DiscordClientModule } from './clients/discord/discord.module';
import { JellyfinClientModule } from './clients/jellyfin/jellyfin.module';
import { CommandModule } from './commands/command.module'; import { CommandModule } from './commands/command.module';
import { HealthModule } from './health/health.module'; import { HealthModule } from './health/health.module';
import { PlaybackModule } from './playback/playback.module'; import { PlaybackModule } from './playback/playback.module';
import { UpdatesModule } from './updates/updates.module'; import { UpdatesModule } from './updates/updates.module';
import { DiscordConfigService } from './clients/discord/discord.config.service';
import { DiscordClientModule } from './clients/discord/discord.module';
import { JellyfinClientModule } from './clients/jellyfin/jellyfin.module';
@Module({ @Module({
imports: [ imports: [
@ -30,6 +32,9 @@ import { JellyfinClientModule } from './clients/jellyfin/jellyfin.module';
PORT: Joi.number().min(1), PORT: Joi.number().min(1),
}), }),
}), }),
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', 'client'),
}),
ScheduleModule.forRoot(), ScheduleModule.forRoot(),
DiscordModule.forRootAsync({ DiscordModule.forRootAsync({
useClass: DiscordConfigService, useClass: DiscordConfigService,

View File

@ -875,6 +875,13 @@
jsonc-parser "3.2.0" jsonc-parser "3.2.0"
pluralize "8.0.0" pluralize "8.0.0"
"@nestjs/serve-static@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@nestjs/serve-static/-/serve-static-3.0.1.tgz#d7d736b47171923d9e87262e19cc58ade8f4ba56"
integrity sha512-i766UJPYOqvQ2BbRKh0/+Mmq5NkJnmKcShjWV1i5qpXyeM0KDZTn0n7g7ykWq/3LbQgjpMzrhYtGv35GX7GVQw==
dependencies:
path-to-regexp "0.2.5"
"@nestjs/terminus@^9.1.4": "@nestjs/terminus@^9.1.4":
version "9.2.1" version "9.2.1"
resolved "https://registry.yarnpkg.com/@nestjs/terminus/-/terminus-9.2.1.tgz#f173ba807bbab6ed2ee892e859455553274a725e" resolved "https://registry.yarnpkg.com/@nestjs/terminus/-/terminus-9.2.1.tgz#f173ba807bbab6ed2ee892e859455553274a725e"
@ -4281,6 +4288,11 @@ path-to-regexp@0.1.7:
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==
path-to-regexp@0.2.5:
version "0.2.5"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.2.5.tgz#0b426991e387fc4c675de23557f358715eb66fb0"
integrity sha512-l6qtdDPIkmAmzEO6egquYDfqQGPMRNGjYtrU13HAXb3YSRrt7HSb1sJY0pKp6o2bAa86tSB6iwaW2JbthPKr7Q==
path-to-regexp@3.2.0: path-to-regexp@3.2.0:
version "3.2.0" version "3.2.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-3.2.0.tgz#fa7877ecbc495c601907562222453c43cc204a5f" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-3.2.0.tgz#fa7877ecbc495c601907562222453c43cc204a5f"