first commit
This commit is contained in:
26
fog/apps/broadcaster-config/project.json
Executable file
26
fog/apps/broadcaster-config/project.json
Executable file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "broadcaster-config",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/broadcaster-config/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/angular:application",
|
||||
"options": {
|
||||
"outputPath": "dist/apps/broadcaster-config",
|
||||
"index": "apps/broadcaster-config/src/index.html",
|
||||
"browser": "apps/broadcaster-config/src/main.ts",
|
||||
"tsConfig": "apps/broadcaster-config/tsconfig.app.json",
|
||||
"assets": [],
|
||||
"styles": []
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/angular:dev-server",
|
||||
"options": {
|
||||
"buildTarget": "broadcaster-config:build"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": ["scope:panel"]
|
||||
}
|
||||
11
fog/apps/broadcaster-config/src/index.html
Executable file
11
fog/apps/broadcaster-config/src/index.html
Executable file
@@ -0,0 +1,11 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Fog Broadcaster Config</title>
|
||||
</head>
|
||||
<body>
|
||||
<fog-broadcaster-config></fog-broadcaster-config>
|
||||
</body>
|
||||
</html>
|
||||
45
fog/apps/broadcaster-config/src/main.ts
Executable file
45
fog/apps/broadcaster-config/src/main.ts
Executable file
@@ -0,0 +1,45 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HttpClient, provideHttpClient } from '@angular/common/http';
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
|
||||
import { MissionDifficulty } from '@fog-explorer/api-interfaces';
|
||||
|
||||
@Component({
|
||||
selector: 'fog-broadcaster-config',
|
||||
standalone: true,
|
||||
imports: [CommonModule, FormsModule],
|
||||
template: `
|
||||
<h2>Fog Broadcaster Config</h2>
|
||||
<label>Difficulty</label>
|
||||
<select [(ngModel)]="difficulty">
|
||||
<option *ngFor="let d of difficulties" [value]="d">{{ d }}</option>
|
||||
</select>
|
||||
<label>Max party size</label>
|
||||
<input type="number" [(ngModel)]="maxPartySize" min="1" max="4" />
|
||||
<button (click)="save()">Save</button>
|
||||
`
|
||||
})
|
||||
class BroadcasterConfigComponent {
|
||||
private readonly http = inject(HttpClient);
|
||||
|
||||
readonly difficulties = Object.values(MissionDifficulty);
|
||||
difficulty: MissionDifficulty = MissionDifficulty.Normal;
|
||||
maxPartySize = 4;
|
||||
|
||||
save(): void {
|
||||
void this.http
|
||||
.post('/channel/config', {
|
||||
channelId: 'from-jwt',
|
||||
difficultyPreset: this.difficulty,
|
||||
maxPartySize: this.maxPartySize,
|
||||
featureFlags: {}
|
||||
})
|
||||
.subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
bootstrapApplication(BroadcasterConfigComponent, {
|
||||
providers: [provideHttpClient()]
|
||||
}).catch((error) => console.error(error));
|
||||
8
fog/apps/broadcaster-config/tsconfig.app.json
Executable file
8
fog/apps/broadcaster-config/tsconfig.app.json
Executable file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"types": []
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user