diff --git a/src/ClientApp/src/components/Home.js b/src/ClientApp/src/components/Home.js index 6b5cad6..b589a43 100644 --- a/src/ClientApp/src/components/Home.js +++ b/src/ClientApp/src/components/Home.js @@ -69,10 +69,7 @@ export class Home extends Component { } handleInputChange(name, selectedValue) { - //if (name === "templateType") { - // this.setState({ level2SelectorType: selectedValue === ".NET Templates" ? "net" : "steeltoe"}) - //} - + if (name === "targetFrameworkVersion" && selectedValue === "netcoreapp3.1" && this.state.steeltoeVersion === "2.3.0") { this.setState({ "steeltoeVersion": "2.4.0", @@ -104,6 +101,7 @@ export class Home extends Component {
+
Project Metadata
diff --git a/src/ClientApp/src/components/InputSelector.js b/src/ClientApp/src/components/InputSelector.js index 534634f..08f52e0 100644 --- a/src/ClientApp/src/components/InputSelector.js +++ b/src/ClientApp/src/components/InputSelector.js @@ -26,7 +26,7 @@ export class InputSelector extends Component {
}) } - +
diff --git a/src/Controllers/CurlRequestAttribute.cs b/src/Controllers/CurlRequestAttribute.cs new file mode 100644 index 0000000..38b09b6 --- /dev/null +++ b/src/Controllers/CurlRequestAttribute.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNetCore.Mvc.Abstractions; +using Microsoft.AspNetCore.Mvc.ActionConstraints; +using Microsoft.AspNetCore.Routing; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Steeltoe.Initializr.Controllers +{ + public class IsCurlRequestAttribute : ActionMethodSelectorAttribute + { + public override bool IsValidForRequest(RouteContext routeContext, ActionDescriptor action) + { + var headers = routeContext.HttpContext.Request.Headers; + return headers["User-Agent"].Any(h => h.ToLower().Contains("curl")); + } + } +} diff --git a/src/Controllers/HomeController.cs b/src/Controllers/HomeController.cs index f0c0abf..cce6d1e 100644 --- a/src/Controllers/HomeController.cs +++ b/src/Controllers/HomeController.cs @@ -97,7 +97,7 @@ Get project: private string GetRow(string title, string description, int[] fieldWidths) { - return $"| {title.PadRight(fieldWidths[0] - 1)}| {description.PadRight(fieldWidths[1] - 1)}|\n"; + return $"| {title.PadRight(fieldWidths[0] - 1)}| {description.PadRight(fieldWidths[1] - 1)}|\n"; } private string GetHorizontalBorder(int[] widths)