release: 1.4.0

close #15
fix #16
close #18
close #19
fix #20
This commit is contained in:
acgnhik
2022-02-12 11:29:55 +08:00
parent 451e744ceb
commit 34b10a8a2d
60 changed files with 1188 additions and 292 deletions

View File

@@ -8,7 +8,7 @@ import {
} from '@angular/common/http';
import { Observable } from 'rxjs';
import { AuthService } from '../services/auth.service';
import { catchError } from 'rxjs/operators';
import { catchError, retry } from 'rxjs/operators';
@Injectable()
export class AuthInterceptor implements HttpInterceptor {
@@ -26,11 +26,15 @@ export class AuthInterceptor implements HttpInterceptor {
catchError((error: HttpErrorResponse) => {
if (error.status === 401) {
// Unauthorized
if (this.auth.hasApiKey()) {
this.auth.removeApiKey();
}
const apiKey = window.prompt('API Key:') ?? '';
this.auth.setApiKey(apiKey);
}
throw error;
})
}),
retry(3)
);
}
}

View File

@@ -4,8 +4,17 @@ export type Event =
| LiveBeganEvent
| LiveEndedEvent
| RoomChangeEvent
| RecordingStartedEvent
| RecordingFinishedEvent
| RecordingCancelledEvent
| VideoFileCreatedEvent
| VideoFileCompletedEvent
| DanmakuFileCreatedEvent
| DanmakuFileCompletedEvent
| RawDanmakuFileCreatedEvent
| RawDanmakuFileCompletedEvent
| SpaceNoEnoughEvent
| FilesAvailableEvent;
| VideoPostprocessingCompletedEvent;
export interface LiveBeganEvent {
readonly type: 'LiveBeganEvent';
@@ -29,6 +38,75 @@ export interface RoomChangeEvent {
readonly room_info: RoomInfo;
};
}
export interface RecordingStartedEvent {
readonly type: 'RecordingStartedEvent';
readonly data: {
readonly room_info: RoomInfo;
};
}
export interface RecordingFinishedEvent {
readonly type: 'RecordingFinishedEvent';
readonly data: {
readonly room_info: RoomInfo;
};
}
export interface RecordingCancelledEvent {
readonly type: 'RecordingCancelledEvent';
readonly data: {
readonly room_info: RoomInfo;
};
}
export interface VideoFileCreatedEvent {
readonly type: 'VideoFileCreatedEvent';
readonly data: {
room_id: number;
path: string;
};
}
export interface VideoFileCompletedEvent {
readonly type: 'VideoFileCompletedEvent';
readonly data: {
room_id: number;
path: string;
};
}
export interface DanmakuFileCreatedEvent {
readonly type: 'DanmakuFileCreatedEvent';
readonly data: {
room_id: number;
path: string;
};
}
export interface DanmakuFileCompletedEvent {
readonly type: 'DanmakuFileCompletedEvent';
readonly data: {
room_id: number;
path: string;
};
}
export interface RawDanmakuFileCreatedEvent {
readonly type: 'RawDanmakuFileCreatedEvent';
readonly data: {
room_id: number;
path: string;
};
}
export interface RawDanmakuFileCompletedEvent {
readonly type: 'RawDanmakuFileCompletedEvent';
readonly data: {
room_id: number;
path: string;
};
}
export interface VideoPostprocessingCompletedEvent {
readonly type: 'VideoPostprocessingCompletedEvent';
readonly data: {
room_id: number;
path: string;
};
}
export interface SpaceNoEnoughEvent {
readonly type: 'SpaceNoEnoughEvent';
@@ -39,13 +117,6 @@ export interface SpaceNoEnoughEvent {
};
}
export interface FilesAvailableEvent {
readonly type: 'FilesAvailableEvent';
readonly data: {
files: string[];
};
}
export interface DiskUsage {
total: number;
used: number;

View File

@@ -9,6 +9,10 @@ const API_KEY_STORAGE_KEY = 'app-api-key';
export class AuthService {
constructor(private storage: StorageService) {}
hasApiKey(): boolean {
return this.storage.hasData(API_KEY_STORAGE_KEY);
}
getApiKey(): string {
return this.storage.getData(API_KEY_STORAGE_KEY) ?? '';
}
@@ -16,4 +20,8 @@ export class AuthService {
setApiKey(value: string): void {
this.storage.setData(API_KEY_STORAGE_KEY, value);
}
removeApiKey() {
this.storage.removeData(API_KEY_STORAGE_KEY);
}
}

View File

@@ -3,8 +3,8 @@
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="记录礼信息到弹幕文件里"
>记录</nz-form-label
nzTooltipTitle="记录礼信息到弹幕文件里"
>记录礼</nz-form-label
>
<nz-form-control
class="setting-control switch"
@@ -16,6 +16,23 @@
<nz-switch formControlName="recordGiftSend"></nz-switch>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item" appSwitchActionable>
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="记录免费礼物信息到弹幕文件里"
>记录免费礼物</nz-form-label
>
<nz-form-control
class="setting-control switch"
[nzWarningTip]="syncFailedWarningTip"
[nzValidateStatus]="
syncStatus.recordFreeGifts ? recordFreeGiftsControl : 'warning'
"
>
<nz-switch formControlName="recordFreeGifts"></nz-switch>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item" appSwitchActionable>
<nz-form-label
class="setting-label"

View File

@@ -40,6 +40,7 @@ export class DanmakuSettingsComponent implements OnInit, OnChanges {
this.settingsForm = formBuilder.group({
danmuUname: [''],
recordGiftSend: [''],
recordFreeGifts: [''],
recordGuardBuy: [''],
recordSuperChat: [''],
saveRawDanmaku: [''],
@@ -54,6 +55,10 @@ export class DanmakuSettingsComponent implements OnInit, OnChanges {
return this.settingsForm.get('recordGiftSend') as FormControl;
}
get recordFreeGiftsControl() {
return this.settingsForm.get('recordFreeGifts') as FormControl;
}
get recordGuardBuyControl() {
return this.settingsForm.get('recordGuardBuy') as FormControl;
}

View File

@@ -33,6 +33,8 @@ export class DiskSpaceSettingsComponent implements OnInit, OnChanges {
readonly syncFailedWarningTip = SYNC_FAILED_WARNING_TIP;
readonly intervalOptions = [
{ label: '10 秒', value: 10 },
{ label: '30 秒', value: 30 },
{ label: '1 分钟', value: 60 },
{ label: '3 分钟', value: 180 },
{ label: '5 分钟', value: 300 },
@@ -44,6 +46,7 @@ export class DiskSpaceSettingsComponent implements OnInit, OnChanges {
{ label: '3 GB', value: 1024 ** 3 * 3 },
{ label: '5 GB', value: 1024 ** 3 * 5 },
{ label: '10 GB', value: 1024 ** 3 * 10 },
{ label: '20 GB', value: 1024 ** 3 * 20 },
];
constructor(

View File

@@ -10,6 +10,7 @@ export type HeaderOptions = Nullable<HeaderSettings>;
export interface DanmakuSettings {
danmuUname: boolean;
recordGiftSend: boolean;
recordFreeGifts: boolean;
recordGuardBuy: boolean;
recordSuperChat: boolean;
saveRawDanmaku: boolean;
@@ -164,8 +165,17 @@ export interface WebhookEventSettings {
liveBegan: boolean;
liveEnded: boolean;
roomChange: boolean;
recordingStarted: boolean;
recordingFinished: boolean;
recordingCancelled: boolean;
videoFileCreated: boolean;
videoFileCompleted: boolean;
danmakuFileCreated: boolean;
danmakuFileCompleted: boolean;
rawDanmakuFileCreated: boolean;
rawDanmakuFileCompleted: boolean;
videoPostprocessingCompleted: boolean;
spaceNoEnough: boolean;
fileCompleted: boolean;
errorOccurred: boolean;
}

View File

@@ -62,8 +62,71 @@
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="fileCompleted"
>播文件完成</label
<label nz-checkbox formControlName="recordingStarted"
>制开始</label
>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="recordingFinished"
>录制完成</label
>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="recordingCancelled"
>录制取消</label
>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="videoFileCreated"
>视频文件创建</label
>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="videoFileCompleted"
>视频文件完成</label
>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="danmakuFileCreated"
>弹幕文件创建</label
>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="danmakuFileCompleted"
>弹幕文件完成</label
>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="rawDanmakuFileCreated"
>原始弹幕文件创建</label
>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="rawDanmakuFileCompleted"
>原始弹幕文件完成</label
>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-control class="setting-control checkbox">
<label nz-checkbox formControlName="videoPostprocessingCompleted"
>视频后处理完成</label
>
</nz-form-control>
</nz-form-item>

View File

@@ -21,8 +21,17 @@ const DEFAULT_SETTINGS = {
liveBegan: true,
liveEnded: true,
roomChange: true,
recordingStarted: true,
recordingFinished: true,
recordingCancelled: true,
videoFileCreated: true,
videoFileCompleted: true,
danmakuFileCreated: true,
danmakuFileCompleted: true,
rawDanmakuFileCreated: true,
rawDanmakuFileCompleted: true,
videoPostprocessingCompleted: true,
spaceNoEnough: true,
fileCompleted: true,
errorOccurred: true,
} as const;
@@ -57,7 +66,16 @@ export class WebhookEditDialogComponent implements OnChanges {
liveBegan: [''],
liveEnded: [''],
roomChange: [''],
fileCompleted: [''],
recordingStarted: [''],
recordingFinished: [''],
recordingCancelled: [''],
videoFileCreated: [''],
videoFileCompleted: [''],
danmakuFileCreated: [''],
danmakuFileCompleted: [''],
rawDanmakuFileCreated: [''],
rawDanmakuFileCompleted: [''],
videoPostprocessingCompleted: [''],
spaceNoEnough: [''],
errorOccurred: [''],
});

View File

@@ -1,5 +1,5 @@
export const breakpoints = [
'(max-width: 534.98px)',
'(min-width: 535px) and (max-width: 1059.98px)',
'(min-width: 1060px)',
'(min-width: 535px) and (max-width: 1199.98px)',
'(min-width: 1200px)',
] as const;

View File

@@ -259,8 +259,8 @@
class="setting-label"
nzFor="recordGiftSend"
nzNoColon
nzTooltipTitle="记录礼信息到弹幕文件里"
>记录</nz-form-label
nzTooltipTitle="记录礼信息到弹幕文件里"
>记录礼</nz-form-label
>
<nz-form-control class="setting-control switch">
<nz-switch
@@ -281,6 +281,33 @@
>覆盖全局设置</label
>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"
nzFor="recordFreeGifts"
nzNoColon
nzTooltipTitle="记录免费礼物信息到弹幕文件里"
>记录免费礼物</nz-form-label
>
<nz-form-control class="setting-control switch">
<nz-switch
id="recordFreeGifts"
name="recordFreeGifts"
[(ngModel)]="model.danmaku.recordFreeGifts"
[disabled]="options.danmaku.recordFreeGifts === null"
></nz-switch>
</nz-form-control>
<label
nz-checkbox
[nzChecked]="options.danmaku.recordFreeGifts !== null"
(nzCheckedChange)="
options.danmaku.recordFreeGifts = $event
? globalSettings.danmaku.recordFreeGifts
: null
"
>覆盖全局设置</label
>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"

View File

@@ -30,6 +30,10 @@
flex: auto;
}
}
.selector {
min-width: 6em;
}
}
.reverse-button {

View File

@@ -53,8 +53,10 @@ export class ToolbarComponent implements OnInit, OnDestroy {
readonly selections = [
{ label: '全部', value: DataSelection.ALL },
{ label: '录制中', value: DataSelection.RECORDING },
{ label: '录制开', value: DataSelection.RECORDER_ENABLED },
{ label: '录制关', value: DataSelection.RECORDER_DISABLED },
{ label: '停止', value: DataSelection.STOPPED },
{ label: '运行', value: DataSelection.MONITOR_ENABLED },
{ label: '停止', value: DataSelection.MONITOR_DISABLED },
{ label: '直播', value: DataSelection.LIVING },
{ label: '轮播', value: DataSelection.ROUNDING },
{ label: '闲置', value: DataSelection.PREPARING },