Skip to content

Commit

Permalink
Merge pull request #60 from qJake/project-updates
Browse files Browse the repository at this point in the history
1.0.2: Hass.io fixes
  • Loading branch information
qJake authored Feb 8, 2020
2 parents 7775164 + 47302a5 commit 638aaeb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
1 change: 1 addition & 0 deletions Docker/PrepareArmImage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Write-Host 'Packaging .tar.gz release...'
cd "HADotNet.CommandCenter\bin\Release\netcoreapp3.1\debian.10-arm\publish\"
7z a -ttar HADotNet.CommandCenter-armhf.tar *
7z a -tgzip HADotNet.CommandCenter-armhf.tar.gz HADotNet.CommandCenter-armhf.tar
rm -Force ../../../../../../HADotNet.CommandCenter-armhf.tar.gz -ErrorAction SilentlyContinue
Move-Item HADotNet.CommandCenter-armhf.tar.gz ../../../../../../
cd ../../../../../../Docker

Expand Down
4 changes: 2 additions & 2 deletions HADotNet.CommandCenter/HADotNet.CommandCenter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<RuntimeIdentifiers>win10;alpine.3.10-x64;debian.10-arm</RuntimeIdentifiers>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AssemblyVersion>1.0.1.0</AssemblyVersion>
<FileVersion>1.0.1.0</FileVersion>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Deterministic>false</Deterministic>
Expand Down
7 changes: 4 additions & 3 deletions HADotNet.CommandCenter/Models/Config/SystemSettings.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.ComponentModel.DataAnnotations;
using HADotNet.CommandCenter.Utils;
using System.ComponentModel.DataAnnotations;

namespace HADotNet.CommandCenter.Models.Config
{
public class SystemSettings
{
[Required]
[RequiredStandalone]
[Url(ErrorMessage = "Enter the full URL starting with http:// or https://.")]
[Display(Name = "Home Assistant Base URL")]
public string BaseUri { get; set; }
Expand All @@ -21,7 +22,7 @@ public class SystemSettings
[Display(Name = "Override Asset Base URL")]
public string OverrideAssetUri { get; set; }

[Required]
[RequiredStandalone]
[MinLength(100, ErrorMessage = "This doesn't look like a long-lived access token.")]
[MaxLength(200, ErrorMessage = "This doesn't look like a long-lived access token.")]
[Display(Name = "Long-Lived Access Token")]
Expand Down
18 changes: 18 additions & 0 deletions HADotNet.CommandCenter/Utils/RequiredStandaloneAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.ComponentModel.DataAnnotations;

namespace HADotNet.CommandCenter.Utils
{
public class RequiredStandaloneAttribute : ValidationAttribute
{
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
{
if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("HASSIO_TOKEN")))
{
return ValidationResult.Success;
}

return string.IsNullOrWhiteSpace(value?.ToString()) ? new ValidationResult(validationContext.DisplayName + " is required.") : ValidationResult.Success;
}
}
}
9 changes: 2 additions & 7 deletions HADotNet.CommandCenter/Views/Admin/Settings.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="ui large header">Welcome to Home Assistant Control Center (HACC)!</div>
<p>Before you begin, please set up your instance information below, and then you can configure your dashboard!</p>
<div class="ui header">Need help?</div>
<p>Not sure how to set up HACC? Refer to our <b><a href="https://github.com/qJake/HADotNet.CommandCenter/wiki/Initial-System-Setup" target="_blank" rel="nofollow">initial system setup</a></b> article, or expand the <b>Support</b> menu to open an issue!</p>
<p>Not sure how to set up HACC? Refer to our <b><a href="https://github.com/qJake/HADotNet.CommandCenter/wiki/Initial-System-Setup" target="_blank" rel="nofollow">initial system setup</a></b> article, or expand the <b>HACC Project</b> menu to open an issue!</p>
</div>
</div>
}
Expand Down Expand Up @@ -73,12 +73,6 @@
<span class="ui up pointing small red label" asp-validation-for="OverrideAssetUri"></span>
</div>
</div>
<div class="field">
<button type="submit" class="ui green icon labeled button">
<i class="check icon"></i>
Save Settings
</button>
</div>
</div>
</div>
</div>
Expand All @@ -89,6 +83,7 @@
<div class="ui grid">
<div class="row">
<div class="six wide computer twelve wide tablet sixteen wide mobile column">
<p>Need help getting set up? Check out our <strong><a href="https://github.com/qJake/HADotNet.CommandCenter/wiki/Initial-System-Setup" target="_blank">installation guide</a></strong>!</p>
<div class="ui segment">
<div class="field">
<label asp-for="BaseUri"></label>
Expand Down

0 comments on commit 638aaeb

Please sign in to comment.