mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
feat(customization): ✨ Added possibility for custom favicons
This commit is contained in:
parent
3dfb503ee7
commit
40af6593b6
6 changed files with 30 additions and 6 deletions
|
@ -12,6 +12,7 @@
|
||||||
public bool RecentlyAddedPage { get; set; }
|
public bool RecentlyAddedPage { get; set; }
|
||||||
public bool UseCustomPage { get; set; }
|
public bool UseCustomPage { get; set; }
|
||||||
public bool HideAvailableFromDiscover { get; set; }
|
public bool HideAvailableFromDiscover { get; set; }
|
||||||
|
public string Favicon { get; set; }
|
||||||
|
|
||||||
public string AddToUrl(string part)
|
public string AddToUrl(string part)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { OverlayContainer } from '@angular/cdk/overlay';
|
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||||
|
|
||||||
import { Component, OnInit, HostBinding, Inject } from "@angular/core";
|
import { Component, OnInit, HostBinding, Inject } from "@angular/core";
|
||||||
import { NavigationStart, Router } from "@angular/router";
|
import { NavigationStart, Router } from "@angular/router";
|
||||||
|
@ -34,6 +34,7 @@ export class AppComponent implements OnInit {
|
||||||
public userName: string;
|
public userName: string;
|
||||||
public userEmail: string;
|
public userEmail: string;
|
||||||
public accessToken: string;
|
public accessToken: string;
|
||||||
|
public favicon: string;
|
||||||
|
|
||||||
private hubConnected: boolean;
|
private hubConnected: boolean;
|
||||||
|
|
||||||
|
@ -88,9 +89,15 @@ export class AppComponent implements OnInit {
|
||||||
this.customizationFacade.settings$().subscribe(x => {
|
this.customizationFacade.settings$().subscribe(x => {
|
||||||
this.customizationSettings = x;
|
this.customizationSettings = x;
|
||||||
if (this.customizationSettings && this.customizationSettings.applicationName) {
|
if (this.customizationSettings && this.customizationSettings.applicationName) {
|
||||||
this.applicationName = this.customizationSettings.applicationName;
|
this.applicationName = this.customizationSettings.applicationName;
|
||||||
this.document.getElementsByTagName('title')[0].innerText = this.applicationName;
|
this.document.getElementsByTagName('title')[0].innerText = this.applicationName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.customizationSettings && this.customizationSettings.favicon) {
|
||||||
|
this.favicon = this.customizationSettings.favicon;
|
||||||
|
this.document.getElementById('favicon').setAttribute('href', this.favicon);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.customizationSettings && this.customizationSettings.customCss) {
|
if (this.customizationSettings && this.customizationSettings.customCss) {
|
||||||
var dom = this.document.getElementsByTagName('head')[0];
|
var dom = this.document.getElementsByTagName('head')[0];
|
||||||
var css = document.createElement("style");
|
var css = document.createElement("style");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { ISettings } from "./ICommon";
|
import { ISettings } from "./ICommon";
|
||||||
import { RequestLimitType } from ".";
|
import { RequestLimitType } from ".";
|
||||||
|
|
||||||
export interface IExternalSettings extends ISettings {
|
export interface IExternalSettings extends ISettings {
|
||||||
|
@ -193,6 +193,7 @@ export interface ICustomizationSettings extends ISettings {
|
||||||
recentlyAddedPage: boolean;
|
recentlyAddedPage: boolean;
|
||||||
useCustomPage: boolean;
|
useCustomPage: boolean;
|
||||||
hideAvailableFromDiscover: boolean;
|
hideAvailableFromDiscover: boolean;
|
||||||
|
favicon: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IJobSettings {
|
export interface IJobSettings {
|
||||||
|
|
|
@ -34,6 +34,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<mat-hint>
|
||||||
|
The favicon url should be an externally accesible URL. Leave blank for default.
|
||||||
|
</mat-hint>
|
||||||
|
<div class="md-form-field">
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Custom Favicon</mat-label>
|
||||||
|
<input matInput type="url" [(ngModel)]="settings.favicon">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
<div class="md-form-field">
|
<div class="md-form-field">
|
||||||
<mat-slide-toggle [(ngModel)]="settings.hideAvailableFromDiscover" matTooltip="Any media content that is available will now be hidden on the discover page, the user still can search for it">
|
<mat-slide-toggle [(ngModel)]="settings.hideAvailableFromDiscover" matTooltip="Any media content that is available will now be hidden on the discover page, the user still can search for it">
|
||||||
Hide Available Content On The Discover Page
|
Hide Available Content On The Discover Page
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<script type='text/javascript'>window["baseHref"] = '/';</script>
|
<script type='text/javascript'>window["baseHref"] = '/';</script>
|
||||||
<base href="/" />
|
<base href="/" />
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
|
||||||
<link rel="icon" type="image/png" href="images/favicon/favicon.ico"/>
|
<link id="favicon" rel="icon" type="image/png" href="images/favicon/favicon.ico"/>
|
||||||
<link rel="apple-touch-icon" type="image/png" href="images/favicon/apple-touch-icon.png"/>
|
<link rel="apple-touch-icon" type="image/png" href="images/favicon/apple-touch-icon.png"/>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
|
@ -23,6 +23,12 @@
|
||||||
appName = "Ombi";
|
appName = "Ombi";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var favicon = customization.Favicon;
|
||||||
|
if (string.IsNullOrEmpty(favicon))
|
||||||
|
{
|
||||||
|
favicon = "images/favicon/favicon.ico";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue