Added new alarm filter
This commit is contained in:
@@ -138,14 +138,12 @@ namespace Step.Controllers.WebApi
|
||||
public IHttpActionResult GetSharedFolderFileList(string sharedPath)
|
||||
{
|
||||
List<object> filelist = new List<object>();
|
||||
|
||||
// NC - PC shared folder path
|
||||
string sharedFullPath = NcConfig.SharedPath + sharedPath;
|
||||
|
||||
if (!Directory.Exists(sharedFullPath))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
// Create list of directories
|
||||
foreach (string item in Directory.GetDirectories(sharedFullPath))
|
||||
{
|
||||
filelist.Add(new
|
||||
@@ -158,7 +156,7 @@ namespace Step.Controllers.WebApi
|
||||
}
|
||||
|
||||
string sharedNcPath = NcConfig.SharedName + sharedPath.Replace('\\', '/');
|
||||
|
||||
// Add files to list
|
||||
foreach (string item in Directory.GetFiles(sharedFullPath))
|
||||
{
|
||||
if (VALID_FILE_EXTENSIONS.Contains(Path.GetExtension(item).ToLower()))
|
||||
@@ -191,6 +189,7 @@ namespace Step.Controllers.WebApi
|
||||
{
|
||||
if (item.IsAFile)
|
||||
{
|
||||
// Get part program under "file" key
|
||||
if (item.ParameterName == "file")
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
@@ -204,7 +203,7 @@ namespace Step.Controllers.WebApi
|
||||
// Check if reps parameter is null or isn't a valid int
|
||||
if (repsParam == null || !Int32.TryParse(repsParam.Value, out int reps))
|
||||
return BadRequest();
|
||||
|
||||
// Upload
|
||||
CmsError cmsError = ncHandler.UploadPartProgramAndAddToQueue(QUEUE_TMP_FOLDER, item.FileName, reps, out queueItem);
|
||||
if (cmsError.IsError())
|
||||
return BadRequest(cmsError.localizationKey);
|
||||
|
||||
Reference in New Issue
Block a user