Merge branch 'master' into dev
This commit is contained in:
Коммит
d392116b0a
|
@ -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 {
|
|||
<form name="form" action="/starter.zip" method="post" autoComplete="off" onSubmit={this.OnSubmit} >
|
||||
<div>
|
||||
<InputSelector id="steeltoeVersion" title="Steeltoe Version" name="steeltoeVersion" values={["2.3.0", "2.4.0"]} defaultValue="2.4.0" selectedValue={this.state.steeltoeVersion} onChange={this.handleInputChange} invalidText={this.state.steeltoeVersionInvalid} />
|
||||
|
||||
<div className="line">
|
||||
<div className="left">Project Metadata</div>
|
||||
<div className="right">
|
||||
|
|
|
@ -26,7 +26,7 @@ export class InputSelector extends Component {
|
|||
</div>
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
<input type="hidden" name={this.props.name} value={this.props.selectedValue} />
|
||||
|
||||
</div>
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче