mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
commit
920de489be
@ -12,6 +12,7 @@ namespace CarCareTracker.Helper
|
||||
UserConfig GetUserConfig(ClaimsPrincipal user);
|
||||
bool SaveUserConfig(ClaimsPrincipal user, UserConfig configData);
|
||||
bool AuthenticateRootUser(string username, string password);
|
||||
string GetMOTD();
|
||||
string GetLogoUrl();
|
||||
string GetServerLanguage();
|
||||
bool GetServerEnableShopSupplies();
|
||||
@ -32,6 +33,15 @@ namespace CarCareTracker.Helper
|
||||
_userConfig = userConfig;
|
||||
_cache = memoryCache;
|
||||
}
|
||||
public string GetMOTD()
|
||||
{
|
||||
var motd = _config["LUBELOGGER_MOTD"];
|
||||
if (string.IsNullOrWhiteSpace(motd))
|
||||
{
|
||||
motd = "";
|
||||
}
|
||||
return motd;
|
||||
}
|
||||
public OpenIDConfig GetOpenIDConfig()
|
||||
{
|
||||
OpenIDConfig openIdConfig = _config.GetSection("OpenIDConfig").Get<OpenIDConfig>() ?? new OpenIDConfig();
|
||||
@ -55,7 +65,7 @@ namespace CarCareTracker.Helper
|
||||
{
|
||||
var allowedFileExtensions = _config["LUBELOGGER_ALLOWED_FILE_EXTENSIONS"];
|
||||
if (string.IsNullOrWhiteSpace(allowedFileExtensions)){
|
||||
return ".png,.jpg,.jpeg,.pdf,.xls,.xlsx,.docx";
|
||||
return StaticHelper.DefaultAllowedFileExtensions;
|
||||
}
|
||||
return allowedFileExtensions;
|
||||
}
|
||||
|
||||
@ -8,10 +8,12 @@ namespace CarCareTracker.Helper
|
||||
/// </summary>
|
||||
public static class StaticHelper
|
||||
{
|
||||
public static string VersionNumber = "1.2.5";
|
||||
public static string DbName = "data/cartracker.db";
|
||||
public static string UserConfigPath = "config/userConfig.json";
|
||||
public static string GenericErrorMessage = "An error occurred, please try again later";
|
||||
public static string ReminderEmailTemplate = "defaults/reminderemailtemplate.txt";
|
||||
public static string DefaultAllowedFileExtensions = ".png,.jpg,.jpeg,.pdf,.xls,.xlsx,.docx";
|
||||
|
||||
public static string GetTitleCaseReminderUrgency(ReminderUrgency input)
|
||||
{
|
||||
@ -225,5 +227,22 @@ namespace CarCareTracker.Helper
|
||||
{
|
||||
return new DateTimeOffset(date).ToUnixTimeMilliseconds();
|
||||
}
|
||||
public static void InitMessage(IConfiguration config)
|
||||
{
|
||||
Console.WriteLine($"LubeLogger {VersionNumber}");
|
||||
Console.WriteLine("Website: https://lubelogger.com");
|
||||
Console.WriteLine("Documentation: https://docs.lubelogger.com");
|
||||
Console.WriteLine("GitHub: https://github.com/hargata/lubelog");
|
||||
var mailConfig = config.GetSection("MailConfig").Get<MailConfig>();
|
||||
if (mailConfig != null && !string.IsNullOrWhiteSpace(mailConfig.EmailServer))
|
||||
{
|
||||
Console.WriteLine($"SMTP Configured for {mailConfig.EmailServer}");
|
||||
} else
|
||||
{
|
||||
Console.WriteLine("SMTP Not Configured");
|
||||
}
|
||||
var motd = config["LUBELOGGER_MOTD"] ?? "Not Configured";
|
||||
Console.WriteLine($"Message Of The Day: {motd}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,9 @@ using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
//Print Messages
|
||||
StaticHelper.InitMessage(builder.Configuration);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllersWithViews();
|
||||
|
||||
|
||||
@ -212,7 +212,7 @@
|
||||
<img src="/defaults/lubelogger_logo.png" />
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<small class="text-body-secondary">Version 1.2.5</small>
|
||||
<small class="text-body-secondary">@($"{translator.Translate(userLanguage, "Version")} {StaticHelper.VersionNumber}")</small>
|
||||
</div>
|
||||
<p class="lead">
|
||||
Proudly developed in the rural town of Price, Utah by Hargata Softworks.
|
||||
@ -259,28 +259,28 @@
|
||||
<script>
|
||||
function showReminderUrgencyThresholdModal(){
|
||||
Swal.fire({
|
||||
title: 'Configure Reminder Urgency Thresholds',
|
||||
title: decodeHTMLEntities('@translator.Translate(userLanguage, "Configure Reminder Urgency Thresholds")'),
|
||||
html: `
|
||||
<form>
|
||||
<div class='d-flex flex-row align-items-center'>
|
||||
<label class='form-label me-auto'>Urgent(Days)</label>
|
||||
<input type="text" id="inputUrgentDays" class="form-control" style='width:40%' placeholder="Urgent" value='@Model.UserConfig.ReminderUrgencyConfig.UrgentDays'>
|
||||
<label class='form-label me-auto'>${decodeHTMLEntities('@translator.Translate(userLanguage, "Urgent(Days)")')}</label>
|
||||
<input type="text" id="inputUrgentDays" class="form-control" style='width:40%' placeholder="${decodeHTMLEntities('@translator.Translate(userLanguage, "Urgent")')}" value='@Model.UserConfig.ReminderUrgencyConfig.UrgentDays'>
|
||||
</div>
|
||||
<div class='d-flex flex-row align-items-center mt-2'>
|
||||
<label class='form-label me-auto'>Very Urgent(Days)</label>
|
||||
<input type="text" id="inputVeryUrgentDays" class="form-control" style='width:40%' placeholder="Very Urgent" value='@Model.UserConfig.ReminderUrgencyConfig.VeryUrgentDays'>
|
||||
<label class='form-label me-auto'>${decodeHTMLEntities('@translator.Translate(userLanguage, "Very Urgent(Days)")')}</label>
|
||||
<input type="text" id="inputVeryUrgentDays" class="form-control" style='width:40%' placeholder="${decodeHTMLEntities('@translator.Translate(userLanguage, "Very Urgent")')}" value='@Model.UserConfig.ReminderUrgencyConfig.VeryUrgentDays'>
|
||||
</div>
|
||||
<div class='d-flex flex-row align-items-center mt-2'>
|
||||
<label class='form-label me-auto'>Urgent(Distance)</label>
|
||||
<input type="text" id="inputUrgentDistance" class="form-control" style='width:40%' placeholder="Urgent" value='@Model.UserConfig.ReminderUrgencyConfig.UrgentDistance'>
|
||||
<label class='form-label me-auto'>${decodeHTMLEntities('@translator.Translate(userLanguage, "Urgent(Distance)")')}</label>
|
||||
<input type="text" id="inputUrgentDistance" class="form-control" style='width:40%' placeholder="${decodeHTMLEntities('@translator.Translate(userLanguage, "Urgent")')}" value='@Model.UserConfig.ReminderUrgencyConfig.UrgentDistance'>
|
||||
</div>
|
||||
<div class='d-flex flex-row align-items-center mt-2'>
|
||||
<label class='form-label me-auto'>Very Urgent(Distance)</label>
|
||||
<input type="text" id="inputVeryUrgentDistance" class="form-control" style='width:40%' placeholder="Very Urgent" value='@Model.UserConfig.ReminderUrgencyConfig.VeryUrgentDistance'>
|
||||
<label class='form-label me-auto'>${decodeHTMLEntities('@translator.Translate(userLanguage, "Very Urgent(Distance)")')}</label>
|
||||
<input type="text" id="inputVeryUrgentDistance" class="form-control" style='width:40%' placeholder="${decodeHTMLEntities('@translator.Translate(userLanguage, "Very Urgent")')}" value='@Model.UserConfig.ReminderUrgencyConfig.VeryUrgentDistance'>
|
||||
</div>
|
||||
</form>
|
||||
`,
|
||||
confirmButtonText: 'Save',
|
||||
confirmButtonText: decodeHTMLEntities('@translator.Translate(userLanguage, "Save")'),
|
||||
focusConfirm: false,
|
||||
preConfirm: () => {
|
||||
const urgentDays = $("#inputUrgentDays").val();
|
||||
|
||||
@ -38,6 +38,11 @@
|
||||
<button type="button" class="btn btn-secondary mt-2" onclick="remoteLogin()"><i class="bi bi-box-arrow-in-right me-2"></i>@($"{translator.Translate(userLanguage, "Login via")} {openIdConfigName}")</button>
|
||||
</div>
|
||||
}
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="form-group">
|
||||
<small class="text-body-secondary">@config.GetMOTD()</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<a href="/Login/ForgotPassword" class="btn btn-link mt-2">@translator.Translate(userLanguage, "Forgot Password")</a>
|
||||
</div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user