mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
New: Multi target net framework 4.6.2 and net core 3.0
This commit is contained in:
parent
d881b26261
commit
8fe924fdcd
99 changed files with 898 additions and 852 deletions
|
@ -1,4 +1,4 @@
|
|||
import * as signalR from '@aspnet/signalr/dist/browser/signalr.js';
|
||||
import * as signalR from '@microsoft/signalr/dist/browser/signalr.js';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
@ -54,6 +54,37 @@ const mapDispatchToProps = {
|
|||
dispatchFetchTagDetails: fetchTagDetails
|
||||
};
|
||||
|
||||
function Logger(minimumLogLevel) {
|
||||
this.minimumLogLevel = minimumLogLevel;
|
||||
}
|
||||
|
||||
Logger.prototype.cleanse = function(message) {
|
||||
const apikey = new RegExp(`access_token=${window.Lidarr.apiKey}`, 'g');
|
||||
return message.replace(apikey, 'access_token=(removed)');
|
||||
};
|
||||
|
||||
Logger.prototype.log = function(logLevel, message) {
|
||||
// see https://github.com/aspnet/AspNetCore/blob/21c9e2cc954c10719878839cd3f766aca5f57b34/src/SignalR/clients/ts/signalr/src/Utils.ts#L147
|
||||
if (logLevel >= this.minimumLogLevel) {
|
||||
switch (logLevel) {
|
||||
case signalR.LogLevel.Critical:
|
||||
case signalR.LogLevel.Error:
|
||||
console.error(`[signalR] ${signalR.LogLevel[logLevel]}: ${this.cleanse(message)}`);
|
||||
break;
|
||||
case signalR.LogLevel.Warning:
|
||||
console.warn(`[signalR] ${signalR.LogLevel[logLevel]}: ${this.cleanse(message)}`);
|
||||
break;
|
||||
case signalR.LogLevel.Information:
|
||||
console.info(`[signalR] ${signalR.LogLevel[logLevel]}: ${this.cleanse(message)}`);
|
||||
break;
|
||||
default:
|
||||
// console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug
|
||||
console.log(`[signalR] ${signalR.LogLevel[logLevel]}: ${this.cleanse(message)}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class SignalRConnector extends Component {
|
||||
|
||||
//
|
||||
|
@ -71,6 +102,7 @@ class SignalRConnector extends Component {
|
|||
const url = `${window.Lidarr.urlBase}/signalr/messages`;
|
||||
|
||||
this.connection = new signalR.HubConnectionBuilder()
|
||||
.configureLogging(new Logger(signalR.LogLevel.Information))
|
||||
.withUrl(`${url}?access_token=${window.Lidarr.apiKey}`)
|
||||
.withAutomaticReconnect({
|
||||
nextRetryDelayInMilliseconds: (retryContext) => {
|
||||
|
|
|
@ -97,7 +97,6 @@ class GeneralSettings extends Component {
|
|||
settings,
|
||||
hasSettings,
|
||||
isResettingApiKey,
|
||||
isMono,
|
||||
isWindows,
|
||||
isWindowsService,
|
||||
isDocker,
|
||||
|
@ -163,7 +162,7 @@ class GeneralSettings extends Component {
|
|||
<UpdateSettings
|
||||
advancedSettings={advancedSettings}
|
||||
settings={settings}
|
||||
isMono={isMono}
|
||||
isWindows={isWindows}
|
||||
isDocker={isDocker}
|
||||
onInputChange={onInputChange}
|
||||
/>
|
||||
|
@ -205,7 +204,6 @@ GeneralSettings.propTypes = {
|
|||
settings: PropTypes.object.isRequired,
|
||||
isResettingApiKey: PropTypes.bool.isRequired,
|
||||
hasSettings: PropTypes.bool.isRequired,
|
||||
isMono: PropTypes.bool.isRequired,
|
||||
isWindows: PropTypes.bool.isRequired,
|
||||
isWindowsService: PropTypes.bool.isRequired,
|
||||
isDocker: PropTypes.bool.isRequired,
|
||||
|
|
|
@ -24,7 +24,6 @@ function createMapStateToProps() {
|
|||
return {
|
||||
advancedSettings,
|
||||
isResettingApiKey,
|
||||
isMono: systemStatus.isMono,
|
||||
isWindows: systemStatus.isWindows,
|
||||
isWindowsService: systemStatus.isWindows && systemStatus.mode === 'service',
|
||||
isDocker: systemStatus.isDocker,
|
||||
|
|
|
@ -88,7 +88,7 @@ function HostSettings(props) {
|
|||
</FormGroup>
|
||||
|
||||
{
|
||||
enableSsl.value &&
|
||||
enableSsl.value ?
|
||||
<FormGroup
|
||||
advancedSettings={advancedSettings}
|
||||
isAdvanced={true}
|
||||
|
@ -104,11 +104,12 @@ function HostSettings(props) {
|
|||
onChange={onInputChange}
|
||||
{...sslPort}
|
||||
/>
|
||||
</FormGroup>
|
||||
</FormGroup> :
|
||||
null
|
||||
}
|
||||
|
||||
{
|
||||
enableSsl.value &&
|
||||
enableSsl.value ?
|
||||
<FormGroup
|
||||
advancedSettings={advancedSettings}
|
||||
isAdvanced={true}
|
||||
|
@ -123,11 +124,12 @@ function HostSettings(props) {
|
|||
onChange={onInputChange}
|
||||
{...sslCertPath}
|
||||
/>
|
||||
</FormGroup>
|
||||
</FormGroup> :
|
||||
null
|
||||
}
|
||||
|
||||
{
|
||||
enableSsl.value &&
|
||||
enableSsl.value ?
|
||||
<FormGroup
|
||||
advancedSettings={advancedSettings}
|
||||
isAdvanced={true}
|
||||
|
@ -142,7 +144,8 @@ function HostSettings(props) {
|
|||
onChange={onInputChange}
|
||||
{...sslCertPassword}
|
||||
/>
|
||||
</FormGroup>
|
||||
</FormGroup> :
|
||||
null
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ function UpdateSettings(props) {
|
|||
const {
|
||||
advancedSettings,
|
||||
settings,
|
||||
isMono,
|
||||
isWindows,
|
||||
isDocker,
|
||||
onInputChange
|
||||
} = props;
|
||||
|
@ -64,7 +64,7 @@ function UpdateSettings(props) {
|
|||
</FormGroup>
|
||||
|
||||
{
|
||||
isMono &&
|
||||
!isWindows &&
|
||||
<div>
|
||||
<FormGroup
|
||||
advancedSettings={advancedSettings}
|
||||
|
@ -125,7 +125,7 @@ function UpdateSettings(props) {
|
|||
UpdateSettings.propTypes = {
|
||||
advancedSettings: PropTypes.bool.isRequired,
|
||||
settings: PropTypes.object.isRequired,
|
||||
isMono: PropTypes.bool.isRequired,
|
||||
isWindows: PropTypes.bool.isRequired,
|
||||
isDocker: PropTypes.bool.isRequired,
|
||||
onInputChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
|
|
@ -49,7 +49,7 @@ class MediaManagement extends Component {
|
|||
error,
|
||||
settings,
|
||||
hasSettings,
|
||||
isMono,
|
||||
isWindows,
|
||||
onInputChange,
|
||||
onSavePress,
|
||||
...otherProps
|
||||
|
@ -129,7 +129,7 @@ class MediaManagement extends Component {
|
|||
legend="Importing"
|
||||
>
|
||||
{
|
||||
isMono &&
|
||||
!isWindows &&
|
||||
<FormGroup
|
||||
advancedSettings={advancedSettings}
|
||||
isAdvanced={true}
|
||||
|
@ -340,7 +340,7 @@ class MediaManagement extends Component {
|
|||
</FieldSet>
|
||||
|
||||
{
|
||||
advancedSettings && isMono &&
|
||||
advancedSettings && !isWindows &&
|
||||
<FieldSet
|
||||
legend="Permissions"
|
||||
>
|
||||
|
@ -445,7 +445,7 @@ MediaManagement.propTypes = {
|
|||
error: PropTypes.object,
|
||||
settings: PropTypes.object.isRequired,
|
||||
hasSettings: PropTypes.bool.isRequired,
|
||||
isMono: PropTypes.bool.isRequired,
|
||||
isWindows: PropTypes.bool.isRequired,
|
||||
onSavePress: PropTypes.func.isRequired,
|
||||
onInputChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
|
|
@ -22,7 +22,7 @@ function createMapStateToProps() {
|
|||
advancedSettings,
|
||||
...sectionSettings,
|
||||
hasPendingChanges: !_.isEmpty(namingSettings.pendingChanges) || sectionSettings.hasPendingChanges,
|
||||
isMono: systemStatus.isMono
|
||||
isWindows: systemStatus.isWindows
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
@ -15,7 +15,8 @@ class About extends Component {
|
|||
render() {
|
||||
const {
|
||||
version,
|
||||
isMonoRuntime,
|
||||
isNetCore,
|
||||
isMono,
|
||||
isDocker,
|
||||
runtimeVersion,
|
||||
migrationVersion,
|
||||
|
@ -36,18 +37,26 @@ class About extends Component {
|
|||
/>
|
||||
|
||||
{
|
||||
isMonoRuntime &&
|
||||
isMono &&
|
||||
<DescriptionListItem
|
||||
title="Mono Version"
|
||||
data={runtimeVersion}
|
||||
/>
|
||||
}
|
||||
|
||||
{
|
||||
isNetCore &&
|
||||
<DescriptionListItem
|
||||
title=".NET Core"
|
||||
data={'Yes'}
|
||||
/>
|
||||
}
|
||||
|
||||
{
|
||||
isDocker &&
|
||||
<DescriptionListItem
|
||||
title="Docker"
|
||||
data={'True'}
|
||||
data={'Yes'}
|
||||
/>
|
||||
}
|
||||
|
||||
|
@ -90,7 +99,8 @@ class About extends Component {
|
|||
|
||||
About.propTypes = {
|
||||
version: PropTypes.string.isRequired,
|
||||
isMonoRuntime: PropTypes.bool.isRequired,
|
||||
isNetCore: PropTypes.bool.isRequired,
|
||||
isMono: PropTypes.bool.isRequired,
|
||||
runtimeVersion: PropTypes.string.isRequired,
|
||||
isDocker: PropTypes.bool.isRequired,
|
||||
migrationVersion: PropTypes.number.isRequired,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue