This commit is contained in:
2020-08-12 23:24:09 +00:00
parent 7ffd420c2d
commit bdbfa98e79

View File

@@ -30,6 +30,27 @@ namespace AyaNova.Api.Controllers
serverState = apiServerState; serverState = apiServerState;
} }
private static string SupportUrl()
{
/*
contactSupportUrl() {
let dbId = encodeURIComponent(
window.$gz.store.state.globalSettings.serverDbId
);
let company = encodeURIComponent(
window.$gz.store.state.globalSettings.company
);
return `https://contact.ayanova.com/contact?dbid=${dbId}&company=${company}`;
}
*/
var dbId = Uri.EscapeDataString(AyaNova.Core.License.ServerDbId);
var company = Uri.EscapeDataString(AyaNova.Core.License.ActiveKey.RegisteredTo);
return $"https://contact.ayanova.com/contact?dbid={dbId}&company={company}";
}
/// <summary> /// <summary>
/// Server landing page /// Server landing page
/// </summary> /// </summary>
@@ -73,7 +94,7 @@ namespace AyaNova.Api.Controllers
<h1>{AyaNovaVersion.FullNameAndVersion}</h1> <h1>{AyaNovaVersion.FullNameAndVersion}</h1>
<h2><a href=""/"" target=""_blank"">AyaNova App</a></h2> <h2><a href=""/"" target=""_blank"">AyaNova App</a></h2>
<h2><a href=""/docs"" target=""_blank"">User and technical guide</a></h2> <h2><a href=""/docs"" target=""_blank"">User and technical guide</a></h2>
<h2><a href=""https://contact.ayanova.com/contact"" target=""_blank"">Contact technical support</a></h2> <h2><a href=""{SupportUrl()}"" target=""_blank"">Contact technical support</a></h2>
<h2><a href=""/api-docs"" target=""_blank"">API explorer for developers</a></h2> <h2><a href=""/api-docs"" target=""_blank"">API explorer for developers</a></h2>
</div> </div>
</body> </body>
@@ -88,8 +109,57 @@ namespace AyaNova.Api.Controllers
}; };
} }
#region sigtest script
/* /// <summary>
/// Get API server info for general display
/// </summary>
/// <returns>API server info</returns>
[HttpGet("server-info")]
public ActionResult ServerInfo()
{
return Ok(new
{
data = new
{
ServerVersion = AyaNovaVersion.FullNameAndVersion,
DBSchemaVersion = AySchema.currentSchema,
ServerLocalTime = DateUtil.ServerDateTimeString(System.DateTime.UtcNow),
ServerTimeZone = TimeZoneInfo.Local.Id,
ServerDbId = AyaNova.Core.License.ServerDbId,
License = AyaNova.Core.License.LicenseInfoAsJson
}
});
}
#if (DEBUG)
/// <summary>
/// Get build mode of server, used for automated testing purposes
/// </summary>
/// <returns>"DEBUG" or "RELEASE"</returns>
[HttpGet("build-mode")]
public ActionResult BuildMode()
{
return Ok(new { data = new { BuildMode = "DEBUG" } });
}
#else
/// <summary>
/// Get build mode of server, used for automated testing purposes
/// </summary>
/// <returns>"DEBUG" or "RELEASE"</returns>
[HttpGet("build-mode")]
public ActionResult BuildMode()
{
return Ok(new { data = new { BuildMode = "RELEASE" } });
}
#endif
}
}
#region sigtest script
/*
<div style=""text-align: center;""> <div style=""text-align: center;"">
<hr/> <hr/>
@@ -116,23 +186,23 @@ namespace AyaNova.Api.Controllers
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Prevent scrolling when touching the canvas // Prevent scrolling when touching the canvas
//addEventListener('touchstart', FUNCTION, {passive: false}); //addEventListener('touchstart', FUNCTION, {passive: false});
document.body.addEventListener(""touchstart"", function (e) { document.body.addEventListener(""touchstart"", function (e) {
if (e.target == canvas) { if (e.target == canvas) {
e.preventDefault(); e.preventDefault();
} }
}, {passive: false}); }, {passive: false});
document.body.addEventListener(""touchend"", function (e) { document.body.addEventListener(""touchend"", function (e) {
if (e.target == canvas) { if (e.target == canvas) {
e.preventDefault(); e.preventDefault();
} }
}, {passive: false}); }, {passive: false});
document.body.addEventListener(""touchmove"", function (e) { document.body.addEventListener(""touchmove"", function (e) {
if (e.target == canvas) { if (e.target == canvas) {
e.preventDefault(); e.preventDefault();
} }
}, {passive: false}); }, {passive: false});
/////////////////////////////////////////////// ///////////////////////////////////////////////
$('#sigpad').sigpad(); $('#sigpad').sigpad();
}); });
@@ -221,9 +291,9 @@ namespace AyaNova.Api.Controllers
// Adds the clear button / link // Adds the clear button / link
if (options.showClear === true) { if (options.showClear === true) {
// var clear_tag = (options.clearStyle == 'link' ? 'div' : 'button'); // var clear_tag = (options.clearStyle == 'link' ? 'div' : 'button');
// $('#' + id + '-controls').append('<' + clear_tag + ' id=""' + id + '-clear"" style=""float:left"">' + options.clearLabel + '</' + clear_tag + '><br style=""clear:both"" />'); // $('#' + id + '-controls').append('<' + clear_tag + ' id=""' + id + '-clear"" style=""float:left"">' + options.clearLabel + '</' + clear_tag + '><br style=""clear:both"" />');
$('#' + id + '-controls').append('<div ' + ' id=""' + id + '-clear"" >' + $('#' + id + '-controls').append('<div ' + ' id=""' + id + '-clear"" >' +
'<span class=""btn btn-sm btn-danger icon-Delete ay-icon-large""></span></div>'); '<span class=""btn btn-sm btn-danger icon-Delete ay-icon-large""></span></div>');
@@ -424,55 +494,7 @@ namespace AyaNova.Api.Controllers
}); });
})(jQuery); })(jQuery);
</script>"; </script>";
}
*/
#endregion
/// <summary>
/// Get API server info for general display
/// </summary>
/// <returns>API server info</returns>
[HttpGet("server-info")]
public ActionResult ServerInfo()
{
return Ok(new
{
data = new
{
ServerVersion = AyaNovaVersion.FullNameAndVersion,
DBSchemaVersion = AySchema.currentSchema,
ServerLocalTime = DateUtil.ServerDateTimeString(System.DateTime.UtcNow),
ServerTimeZone = TimeZoneInfo.Local.Id,
ServerDbId = AyaNova.Core.License.ServerDbId,
License = AyaNova.Core.License.LicenseInfoAsJson
}
});
}
#if (DEBUG)
/// <summary>
/// Get build mode of server, used for automated testing purposes
/// </summary>
/// <returns>"DEBUG" or "RELEASE"</returns>
[HttpGet("build-mode")]
public ActionResult BuildMode()
{
return Ok(new { data = new { BuildMode = "DEBUG" } });
}
#else
/// <summary>
/// Get build mode of server, used for automated testing purposes
/// </summary>
/// <returns>"DEBUG" or "RELEASE"</returns>
[HttpGet("build-mode")]
public ActionResult BuildMode()
{
return Ok(new { data = new { BuildMode = "RELEASE" } });
}
#endif
}
} }
*/
#endregion