Browse Source

Fixed logo and favicon loading.

tags/3.0.0^2
Teknikode 1 year ago
parent
commit
af6ffcaf6d
2 changed files with 8 additions and 6 deletions
  1. 6
    4
      Teknik/Controllers/DefaultController.cs
  2. 2
    2
      Utilities/Constants.cs

+ 6
- 4
Teknik/Controllers/DefaultController.cs View File

@@ -58,8 +58,9 @@ namespace Teknik.Controllers
[ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)]
public IActionResult Favicon([FromServices] IHostingEnvironment env)
{
//string imageFile = FileHelper.MapPath(env, Constants.FAVICON_PATH);
return File(Constants.FAVICON_PATH, "image/x-icon");
string imageFile = FileHelper.MapPath(env, Constants.FAVICON_PATH);
FileStream fs = new FileStream(imageFile, FileMode.Open, FileAccess.Read);
return File(fs, "image/x-icon");
}

// Get the Logo
@@ -68,8 +69,9 @@ namespace Teknik.Controllers
[ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)]
public IActionResult Logo([FromServices] IHostingEnvironment env)
{
//string imageFile = FileHelper.MapPath(env, Constants.LOGO_PATH);
return File(Constants.LOGO_PATH, "image/svg+xml");
string imageFile = FileHelper.MapPath(env, Constants.LOGO_PATH);
FileStream fs = new FileStream(imageFile, FileMode.Open, FileAccess.Read);
return File(fs, "image/svg+xml");
}

// Get the Robots.txt

+ 2
- 2
Utilities/Constants.cs View File

@@ -4,8 +4,8 @@ namespace Teknik.Utilities
{
public const string SERVERUSER = "Server Admin";
public const string TRUSTEDDEVICECOOKIE = "TeknikTrustedDevice";
public const string LOGO_PATH = "~/Images/logo-black.svg";
public const string FAVICON_PATH = "~/Images/favicon.ico";
public const string LOGO_PATH = "images/logo-black.svg";
public const string FAVICON_PATH = "images/favicon.ico";
public const string ROBOTS_PATH = "~/App_Data/robots.txt";
public const string LOG_FILE_NAME_PREFIX = "Teknik";
public const string LOG_FILE_EXT = ".log";

Loading…
Cancel
Save