Changeset 13733 for branches/WebJobManager
- Timestamp:
- 03/24/16 17:19:13 (9 years ago)
- Location:
- branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager
- Files:
-
- 28 added
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/HomeController.cs
r13689 r13733 8 8 namespace HeuristicLab.Clients.Hive.WebJobManager.Controllers 9 9 { 10 /// <summary> 11 /// Controller for initial landing page 12 /// </summary> 10 13 public class HomeController : Controller 11 14 { 12 private ILoginViewModelService loginViewModelService;15 private LoginViewModelService loginViewModelService; 13 16 private HiveServiceClient client; 14 17 public HomeController(ILoginViewModelService loginViewModelService) 15 18 { 16 this.loginViewModelService = loginViewModelService;19 this.loginViewModelService = (LoginViewModelService)loginViewModelService; 17 20 } 21 #region Login 22 /// <summary> 23 /// Opens initial home page 24 /// </summary> 25 /// <returns>View from home page</returns> 18 26 public IActionResult Index() 19 27 { 20 28 ViewBag.Title = "Login"; 29 loginViewModelService.clear(); 21 30 return View(loginViewModelService.GetLoginViewModel()); 22 31 } 23 public IActionResult Login(string loginName, string password) 32 /// <summary> 33 /// Checks login 34 /// </summary> 35 /// <param name="loginName">Login name</param> 36 /// <param name="password">Login password</param> 37 /// <returns>Logged in view if correct or shows error</returns> 38 public IActionResult Login(string loginName, string password)//Checks login 24 39 { 25 40 if (!string.IsNullOrEmpty(loginName) && !string.IsNullOrEmpty(password)) 26 41 { 27 42 var model = loginViewModelService.GetLoginViewModel(); 28 HiveServiceLocatorWeb ManagerService hiveServiceLocator = (HiveServiceLocatorWebManagerService)HiveServiceLocatorWebManagerService.Instance;43 HiveServiceLocatorWeb hiveServiceLocator = (HiveServiceLocatorWeb)HiveServiceLocatorWeb.Instance; 29 44 HeuristicLab.Clients.Common.Properties.Settings.Default.UserName = loginName; 30 45 HeuristicLab.Clients.Common.Properties.Settings.Default.Password = Common.CryptoService.EncryptString(password); … … 37 52 var test = client.GetJobs();//Throws messageSecurityException if login failss 38 53 ViewBag.Title = "Login succesful"; 39 return View("LoginHome"); 54 55 return RedirectToAction("Index","Job"); 40 56 } 41 57 catch(MessageSecurityException e) … … 55 71 } 56 72 } 73 public IActionResult Logout() 74 { 75 return RedirectToAction("Index","Home"); 76 } 77 #endregion 57 78 } 58 79 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs
r13714 r13733 18 18 namespace HeuristicLab.Clients.Hive.WebJobManager.Controllers 19 19 { 20 /// <summary> 21 /// Controller for everything Job related (includes uploads and uploader) 22 /// </summary> 20 23 public class JobController : Controller 21 24 { … … 26 29 public JobController(IHostingEnvironment env) 27 30 { 28 HiveServiceLocatorWeb ManagerService hiveServiceLocator = (HiveServiceLocatorWebManagerService)HiveServiceLocatorWebManagerService.Instance;31 HiveServiceLocatorWeb hiveServiceLocator = (HiveServiceLocatorWeb)HiveServiceLocatorWeb.Instance; 29 32 client = hiveServiceLocator.getHiveServiceClient(); 30 33 vm = new JobViewModel(); … … 34 37 } 35 38 #region Jobs 39 /// <summary> 40 /// initial job page, shows all jobs 41 /// </summary> 42 /// <returns></returns> 36 43 public IActionResult Index() 37 44 { … … 46 53 if (e is MessageSecurityException || e is InvalidOperationException) 47 54 { 48 HiveServiceLocatorWeb ManagerService.SetLoginErrorMessage();55 HiveServiceLocatorWeb.SetLoginErrorMessage(); 49 56 return RedirectToAction("Index", "Home"); 50 57 } … … 54 61 return View(vm); 55 62 } 63 /// <summary> 64 /// Initial page and a selected job 65 /// </summary> 66 /// <param name="id">Job id selected</param> 67 /// <returns></returns> 56 68 public IActionResult Selected(Guid id) 57 69 { 58 if (((HiveServiceLocatorWeb ManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())70 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 59 71 { 60 72 HiveClientWeb.Instance.Refresh(); … … 77 89 else 78 90 { 79 HiveServiceLocatorWebManagerService.SetLoginErrorMessage(); 80 return RedirectToAction("Index", "Home"); 81 } 82 } 83 public IActionResult Delete(Guid id)// delete a job 84 { 85 if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin()) 91 HiveServiceLocatorWeb.SetLoginErrorMessage(); 92 return RedirectToAction("Index", "Home"); 93 } 94 } 95 /// <summary> 96 /// Deletes a job 97 /// </summary> 98 /// <param name="id">Job id</param> 99 /// <returns></returns> 100 public IActionResult Delete(Guid id) 101 { 102 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 86 103 { 87 104 … … 96 113 else 97 114 { 98 HiveServiceLocatorWeb ManagerService.SetLoginErrorMessage();115 HiveServiceLocatorWeb.SetLoginErrorMessage(); 99 116 return RedirectToAction("Index", "Home"); 100 117 } … … 103 120 104 121 #region Uploads 122 /// <summary> 123 /// Shows the uploaded directories 124 /// </summary> 125 /// <returns></returns> 105 126 public IActionResult Uploads() 106 127 { 107 if (((HiveServiceLocatorWeb ManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())128 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 108 129 { 109 130 UploadedJobViewModel upper = new UploadedJobViewModel(); 110 131 fillUploadsPaths(upper, -1); 111 132 ViewBag.Name = client.ClientCredentials.UserName.UserName; 112 133 ViewBag.Title = "Uploaded files"; 113 134 return View("Uploads", upper); … … 115 136 else 116 137 { 117 HiveServiceLocatorWebManagerService.SetLoginErrorMessage(); 118 return RedirectToAction("Index", "Home"); 119 } 120 } 138 HiveServiceLocatorWeb.SetLoginErrorMessage(); 139 return RedirectToAction("Index", "Home"); 140 } 141 } 142 /// <summary> 143 /// //Shows content of selected dir 144 /// </summary> 145 /// <param name="index">Array index selected directory</param> 146 /// <returns></returns> 121 147 public IActionResult UploadDir(int index) 122 148 { 123 if (((HiveServiceLocatorWeb ManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())149 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 124 150 { 125 151 UploadedJobViewModel upper = new UploadedJobViewModel(); … … 131 157 else 132 158 { 133 HiveServiceLocatorWebManagerService.SetLoginErrorMessage(); 134 return RedirectToAction("Index", "Home"); 135 } 136 } 159 HiveServiceLocatorWeb.SetLoginErrorMessage(); 160 return RedirectToAction("Index", "Home"); 161 } 162 } 163 /// <summary> 164 /// Loads all the paths from the selected uploads folder 165 /// </summary> 166 /// <param name="vm">Viewmodel to save every directory path</param> 167 /// <param name="index">Index selected directory</param> 137 168 private void fillUploadsPaths(UploadedJobViewModel vm, int index) 169 138 170 { 139 171 var tempdex = index; //Fix when maps gets deleted … … 165 197 } 166 198 } 199 /// <summary> 200 /// Deletes a file 201 /// </summary> 202 /// <param name="index">Index directory</param> 203 /// <param name="filedex">Index file to delete</param> 204 /// <returns></returns> 167 205 public IActionResult DeleteFile(int index, int filedex) 168 206 { 169 if (((HiveServiceLocatorWeb ManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())207 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 170 208 { 171 209 UploadedJobViewModel upper = new UploadedJobViewModel(); … … 183 221 else 184 222 { 185 HiveServiceLocatorWebManagerService.SetLoginErrorMessage(); 186 return RedirectToAction("Index", "Home"); 187 } 188 } 189 223 HiveServiceLocatorWeb.SetLoginErrorMessage(); 224 return RedirectToAction("Index", "Home"); 225 } 226 } 227 /// <summary> 228 /// Opens a selected file 229 /// </summary> 230 /// <param name="index">Index directory</param> 231 /// <param name="filedex">Index selected file</param> 232 /// <returns></returns> 190 233 public IActionResult OpenFile(int index, int filedex) 191 234 { 192 if (((HiveServiceLocatorWeb ManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())235 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 193 236 { 194 237 UploadedJobViewModel upper = new UploadedJobViewModel(); … … 221 264 else 222 265 { 223 HiveServiceLocatorWebManagerService.SetLoginErrorMessage(); 224 return RedirectToAction("Index", "Home"); 225 } 226 } 227 266 HiveServiceLocatorWeb.SetLoginErrorMessage(); 267 return RedirectToAction("Index", "Home"); 268 } 269 } 270 /// <summary> 271 /// Adds current opened file to hive, uses FileOpeningService singleton 272 /// </summary> 273 /// <returns></returns> 228 274 public IActionResult AddToHive() 229 275 { 230 if (((HiveServiceLocatorWeb ManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())276 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 231 277 { 232 278 var job = FileOpeningService.Instance.AddCurrentModelToHive(); … … 241 287 else 242 288 { 243 HiveServiceLocatorWeb ManagerService.SetLoginErrorMessage();289 HiveServiceLocatorWeb.SetLoginErrorMessage(); 244 290 return RedirectToAction("Index", "Home"); 245 291 } … … 248 294 /* public async Task<IActionResult> DownloadFile(int index, int filedex) 249 295 { 250 if (((HiveServiceLocatorWeb ManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())296 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 251 297 { 252 298 UploadedJobViewModel upper = new UploadedJobViewModel(); … … 269 315 else 270 316 { 271 HiveServiceLocatorWeb ManagerService.SetLoginErrorMessage();317 HiveServiceLocatorWeb.SetLoginErrorMessage(); 272 318 return RedirectToAction("Index", "Home"); 273 319 } … … 277 323 278 324 #region Uploader 279 public IActionResult Uploader() 280 { 281 if (((HiveServiceLocatorWebManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin()) 282 { 283 ViewBag.Title = "Upload Jobs"; 284 ViewBag.Name = client.ClientCredentials.UserName.UserName; 285 return View("Uploader"); 286 } 287 else 288 { 289 HiveServiceLocatorWebManagerService.SetLoginErrorMessage(); 290 return RedirectToAction("Index", "Home"); 291 } 292 } 325 326 /// <summary> 327 /// Uploads file onto server directory 328 /// </summary> 329 /// <param name="files">Files</param> 330 /// <param name="directory">Directory path for server</param> 331 /// <returns></returns> 293 332 [HttpPost] 294 333 public async Task<IActionResult> Uploader(ICollection<IFormFile> files, string directory) -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/ResourceController.cs
r13689 r13733 17 17 public ResourceController(IHostingEnvironment env) 18 18 { 19 HiveServiceLocatorWeb ManagerService hiveServiceLocator = (HiveServiceLocatorWebManagerService)HiveServiceLocatorWebManagerService.Instance;19 HiveServiceLocatorWeb hiveServiceLocator = (HiveServiceLocatorWeb)HiveServiceLocatorWeb.Instance; 20 20 client = hiveServiceLocator.getHiveServiceClient(); 21 21 … … 24 24 public IActionResult Index() 25 25 { 26 if (((HiveServiceLocatorWeb ManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())26 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 27 27 { 28 28 … … 32 32 else 33 33 { 34 HiveServiceLocatorWeb ManagerService.SetLoginErrorMessage();34 HiveServiceLocatorWeb.SetLoginErrorMessage(); 35 35 return RedirectToAction("Index", "Home"); 36 36 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/UserController.cs
r13689 r13733 17 17 public UserController(IHostingEnvironment env) 18 18 { 19 HiveServiceLocatorWeb ManagerService hiveServiceLocator = (HiveServiceLocatorWebManagerService)HiveServiceLocatorWebManagerService.Instance;19 HiveServiceLocatorWeb hiveServiceLocator = (HiveServiceLocatorWeb)HiveServiceLocatorWeb.Instance; 20 20 client = hiveServiceLocator.getHiveServiceClient(); 21 21 … … 24 24 public IActionResult Index() 25 25 { 26 if (((HiveServiceLocatorWeb ManagerService)(HiveServiceLocatorWebManagerService.Instance)).CheckLogin())26 if (((HiveServiceLocatorWeb)(HiveServiceLocatorWeb.Instance)).CheckLogin()) 27 27 { 28 28 … … 32 32 else 33 33 { 34 HiveServiceLocatorWeb ManagerService.SetLoginErrorMessage();34 HiveServiceLocatorWeb.SetLoginErrorMessage(); 35 35 return RedirectToAction("Index", "Home"); 36 36 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Models/AlgorithmContainer.cs
r13712 r13733 7 7 namespace HeuristicLab.Clients.Hive.WebJobManager.Models 8 8 { 9 /// <summary> 10 /// Used for file opening, contains algorithm, depth and random 11 /// </summary> 9 12 public class AlgorithmContainer 10 13 { -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Models/BatchRunContainer.cs
r13696 r13733 7 7 namespace HeuristicLab.Clients.Hive.WebJobManager.Models 8 8 { 9 /// <summary> 10 /// Used for file opening, contains batch run, depth and random 11 /// </summary> 9 12 public class BatchRunContainer 10 { 13 {//used by file opening 11 14 public BatchRun batch { get; set; } 12 15 public List<int[]> depth { get; set; } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Models/ExperimentContainer.cs
r13696 r13733 7 7 namespace HeuristicLab.Clients.Hive.WebJobManager.Models 8 8 { 9 /// <summary> 10 /// Used for file opening, contains experiment, depth and random 11 /// </summary> 9 12 public class ExperimentContainer 10 13 { -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Models/HiveTaskContainer.cs
r13712 r13733 6 6 namespace HeuristicLab.Clients.Hive.WebJobManager.Models 7 7 { 8 /// <summary> 9 /// Used by SelectedJob, contains current hivetask 10 /// </summary> 8 11 public class HiveTaskContainer 9 12 { -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Imports/ConcurrentTaskDownloaderWeb.cs
r13712 r13733 28 28 namespace HeuristicLab.Clients.Hive.WebJobManager.Services.Imports 29 29 { 30 31 // 30 32 /// <summary> 31 /// Downloads and deserializes jobs. It avoids too many jobs beeing downloaded or deserialized at the same time to avoid memory problems33 /// Rewritten to use HiveServiceLocatorWeb and HiveClientWeb 32 34 /// </summary> 33 35 public class ConcurrentTaskDownloaderWeb<T> : IDisposable where T : class, ITask { … … 70 72 Task t = null; 71 73 HiveClientWeb.TryAndRepeat(() => { 72 t = HiveServiceLocatorWeb ManagerService.Instance.CallHiveService(s => s.GetTask((Guid)taskId));74 t = HiveServiceLocatorWeb.Instance.CallHiveService(s => s.GetTask((Guid)taskId)); 73 75 }, Settings.Default.MaxRepeatServiceCalls, "Failed to download task."); 74 76 return t; … … 85 87 if (abort) return null; 86 88 HiveClientWeb.TryAndRepeat(() => { 87 result = HiveServiceLocatorWeb ManagerService.Instance.CallHiveService(s => s.GetTaskData(task.Id));89 result = HiveServiceLocatorWeb.Instance.CallHiveService(s => s.GetTaskData(task.Id)); 88 90 }, Settings.Default.MaxRepeatServiceCalls, "Failed to download task data."); 89 91 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Imports/TaskDownloaderWeb.cs
r13712 r13733 27 27 28 28 namespace HeuristicLab.Clients.Hive.WebJobManager.Services.Imports { 29 30 /// <summary> 31 /// Rewritten to use HiveClientWeb and HiveServiceLocatorWeb 32 /// </summary> 29 33 public class TaskDownloaderWeb : IDisposable { 30 34 private IEnumerable<Guid> taskIds; -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/LoginViewModelService.cs
r13656 r13733 33 33 } 34 34 35 public void destroy()35 public void clear() 36 36 { 37 instance = null;38 37 vm = null; 38 HiveServiceLocatorWeb.clear(); 39 39 } 40 40 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Startup.cs
r13689 r13733 29 29 this.hostingEnvironment = hostingEnvironment; 30 30 } 31 // This method gets called by the runtime. Use this method to add services to the container. 32 // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940 33 public void ConfigureServices(IServiceCollection services) 31 public void ConfigureServices(IServiceCollection services) 34 32 { 35 33 36 34 services.AddMvc(); 37 35 services.AddSingleton<ILoginViewModelService, LoginViewModelService>(); 38 services.AddSingleton<IHiveServiceLocator, HiveServiceLocatorWeb ManagerService>();36 services.AddSingleton<IHiveServiceLocator, HiveServiceLocatorWeb>(); 39 37 services.AddSignalR(); 40 38 } 41 39 42 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 43 public void Configure(IApplicationBuilder app) 40 public void Configure(IApplicationBuilder app) 44 41 { 45 42 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/ViewModels/LoginViewModel.cs
r13656 r13733 7 7 namespace HeuristicLab.Clients.Hive.WebJobManager.ViewModels 8 8 { 9 /// <summary> 10 /// Used for login 11 /// </summary> 9 12 public class LoginViewModel 10 13 { -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Home/Index.cshtml
r13689 r13733 6 6 <div class="col-xs-offset-4 col-sm-4" > 7 7 <div class="form-login"> 8 <h4>Welcome to Heuristic 8 <h4>Welcome to HeuristicLab Hive</h4> 9 9 <form asp-controller="Home" asp-action="Login" method="POST"> 10 <label asp-for="loginName"></label> 11 <input type="text" asp-for="loginName" class="form-control input-sm chat-input" /> 12 <label asp-for="password"></label> 13 <input type="password" asp-for="password" class="form-control input-sm chat-input" /> 10 <i class="fa fa-user"></i> 11 <label asp-for="loginName"> 12 13 </label> 14 <input 15 type="text" 16 asp-for="loginName" 17 class="form-control input-sm chat-input" /> 18 <i class="fa fa-key"></i> 19 <label 20 asp-for="password"> 21 22 </label> 23 <input 24 type="password" 25 asp-for="password" 26 class="form-control input-sm chat-input" /> 14 27 <br/> 15 28 <div class="wrapper"> 16 29 <span class="group-btn"> 17 <button type="submit" class="btn btn-primary btn-md" 18 style="width: 100%"> 19 Login 30 <button 31 type="submit" 32 class="btn btn-primary btn-md" 33 style="width: 100%;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 34 text-shadow:2px 2px black;"> 35 Login <i class="fa fa-sign-in"></i> 20 36 </button> 21 37 </span> 22 <span style="color:red"><br/>@Model.errorMessage</span> 38 <span style="color:red"> 39 <br/>@Model.errorMessage 40 </span> 23 41 </div> 24 42 </form> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml
r13719 r13733 1 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.JobViewModel 1 @using HeuristicLab.Clients.Hive.WebJobManager.ViewModels 2 @model JobViewModel 2 3 3 4 <div> 5 @Html.Partial("Navbar", new NavbarViewModel("Job")) 4 6 5 <ul class="nav nav-tabs"> 6 <li role="presentation" class="active"><a asp-controller="Job" asp-action="Index">Jobs <span class="badge">@Model.userJobs.Count</span></a></li> 7 <li role="presentation"><a asp-controller="User" asp-action="Index">User management</a></li> 8 <li role="presentation"><a asp-controller="Resource" asp-action="Index">Resources</a></li> 7 <ul class="nav nav-pills nav-justified"> 8 <li role="presentation" 9 class="active"> 10 <a asp-controller="Job" 11 asp-action="Index"> 12 Jobs 13 </a> 14 </li> 15 <li role="presentation" 16 class=""> 17 <a asp-controller="Job" 18 asp-action="Uploads"> 19 Uploads 20 </a> 21 </li> 9 22 </ul> 10 <div class="row" style="text-align:center"> 23 24 <div class="row" 25 style="text-align:center"> 11 26 @Model.message 12 27 </div> 13 <div class="row" style="margin:10px"> 14 <a class="btn btn-info btn-lg btn-block" 15 asp-controller="Job" 16 asp-action="Uploads"> 17 Uploads 18 </a> 28 <div class="row" 29 style="margin:10px"> 30 19 31 </div> 20 <div class="row" style="padding:10px; margin-right:0px!important"> 32 <div class="row" 33 style="padding:10px; margin-right:0px!important"> 21 34 @if (Model.userJobs.Count == 0) 22 {35 { 23 36 <div> 24 <p style="text-align:center">No jobs found</p> 37 <p style="text-align:center"> 38 No jobs found 39 </p> 25 40 </div> 26 41 … … 29 44 <div class="col-sm-4"> 30 45 <div class="btn-group-vertical btn-block"> 46 <a class="btn btn-info btn-lg btn-block disabled" 47 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 48 text-shadow:2px 2px black;"> 49 <i class="fa fa-cog"></i> Hive jobs 50 </a> 31 51 @foreach (var job in Model.userJobs) 32 52 { 33 <a class="btn btn-default @(Model.selectedJob != null && job.Id == Model.selectedJob.Id ? "active" : "" )" 53 <a class="btn btn-default 54 @(Model.selectedJob != null && job.Id == Model.selectedJob.Id ? "active" : "" ) 55 " 34 56 asp-controller="Job" 35 57 asp-action="Selected" 36 58 asp-route-id="@job.Id" 59 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 60 text-align:left;" 37 61 onclick="showLoader()"> 38 62 @job.Job.Name - @job.Job.DateCreated 39 <span class="badge">@job.Job.JobCount</span> 63 <span class="label 64 @(job.Job.FinishedCount == @job.Job.JobCount ? "label-success" : "label-default") 65 label-as-badge pull-right"> 66 <strong>@job.Job.FinishedCount / @job.Job.JobCount</strong> 67 </span> 40 68 </a> 41 69 } … … 48 76 </i> 49 77 </p> 50 @if (Model.selectedJob != null)51 {52 <div class="col-sm-8" id="content" style="padding:5px; padding-left:10px;">53 <div class="row">54 <h2 style="padding-left:20px">55 @Model.selectedJob.Job.Name56 <a onclick="popUpDelete()"57 style="margin-bottom:10px;"58 class='btn btn-danger'>59 <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>60 </a>61 <a style="display:none"62 asp-action="Delete"63 asp-route-id="@Model.selectedJob.Id"64 asp-controller="Job" id="del"65 onclick="showDeleter()"></a>66 78 67 <script type="text/javascript"> 68 function popUpDelete() { 69 if (confirm("Are you sure you want to delete this job?") == true) { 70 document.getElementById("del").click(); 71 } 79 <div class="col-sm-8" 80 id="content" 81 style="padding:5px; padding-left:10px;"> 82 @if (Model.selectedJob != null) 83 { 84 <div class="panel panel-default" 85 style="border-width:2px!important;padding:17px; 86 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> 87 <div class="row"> 88 <h2 style="padding-left:20px"> 89 @Model.selectedJob.Job.Name 90 <a onclick="popUpDelete()" 91 style="margin-bottom:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 92 text-shadow:2px 2px black;" 93 class='btn btn-danger'> 94 <span class="glyphicon glyphicon-trash" 95 aria-hidden="true"></span> 96 Delete job 97 </a> 98 <a style="display:none; " 99 asp-action="Delete" 100 asp-route-id="@Model.selectedJob.Id" 101 asp-controller="Job" id="del" 102 onclick="showDeleter()"></a> 103 104 <script type="text/javascript"> 105 function popUpDelete() { 106 if (confirm("Are you sure you want to delete this job?") == true) { 107 document.getElementById("del").click(); 108 } 109 110 } 111 </script> 112 113 </h2> 114 <div class="col-sm-6" style="padding-left:30px"> 115 <p>Description: @Model.selectedJob.Job.Description</p> 116 <p>Resources: @Model.selectedJob.Job.ResourceNames</p> 117 <p>Created: @Model.selectedJob.Job.DateCreated</p> 118 <p>Owned by: @Model.selectedJob.Job.OwnerUsername</p> 119 120 </div> 121 <div class="col-sm-6" style="padding-left:30px"> 122 <p id="jobcalculating"> 123 Calculating: @Model.selectedJob.Job.CalculatingCount 124 </p> 125 <p id="jobfinished"> 126 Finished: @Model.selectedJob.Job.FinishedCount 127 </p> 128 <p> 129 Automatic refresh: 130 <input type="checkbox" 131 checked 132 data-toggle="toggle" 133 data-onstyle="success" 134 id="refreshtogg" 135 onchange="autoRefresh()" /> 136 </p> 137 </div> 138 139 </div> 140 141 <script src="~/js/scripts/graphs/graphdatacollector.js"></script> 142 <script src="~/js/scripts/graphs/graphhubber.js"></script> 143 <div class="row" style="text-align:center"> 144 145 <div id="graphMain" style="width:100%;height:0px"> 146 147 </div> 148 <div class="btn btn-lg btn-info" 149 onclick="redrawMain()" 150 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 151 text-shadow:2px 2px black;">Refresh main graph</div> 152 </div> 153 <div class="row"> 154 <h3 style="padding-left:20px; "> 155 @Model.selectedJob.Job.JobCount Tasks 156 </h3> 157 @foreach (var task in Model.selectedJob.HiveTasks) 158 { 159 @Html.Partial("SelectedJobPartials/_TaskPartial", 160 new HeuristicLab.Clients.Hive.WebJobManager.Models.HiveTaskContainer(task)) 72 161 73 162 } 74 </script> 163 </div> 164 </div> 165 } 166 </div> 75 167 76 </h2>77 <div class="col-sm-6" style="padding-left:30px">78 <p>Description: @Model.selectedJob.Job.Description</p>79 <p>Resources: @Model.selectedJob.Job.ResourceNames</p>80 <p>Created: @Model.selectedJob.Job.DateCreated</p>81 <p>Owned by: @Model.selectedJob.Job.OwnerUsername</p>82 83 </div>84 <div class="col-sm-6" style="padding-left:30px">85 <p>Calculating: @Model.selectedJob.Job.CalculatingCount</p>86 <p>Finished: @Model.selectedJob.Job.FinishedCount</p>87 </div>88 89 </div>90 91 <script src="~/js/scripts/graphs/graphdatacollector.js"></script>92 <script src="~/js/scripts/graphs/graphhubber.js"></script>93 <div class="row">94 <div class="btn btn-lg btn-info" onclick="redrawMain()">Refresh main graph</div>95 <div id="graphMain" style="width:100%;height:400px">96 97 </div>98 </div>99 <div class="row" >100 <h3 style="padding-left:20px; ">Tasks</h3>101 @foreach (var task in Model.selectedJob.HiveTasks)102 {103 @Html.Partial("SelectedJobPartials/_TaskPartial",104 new HeuristicLab.Clients.Hive.WebJobManager.Models.HiveTaskContainer(task))105 106 }107 </div>108 </div>109 }110 168 } 111 169 <script type="text/javascript"> 112 170 function showLoader() { 171 document.getElementById("content").style.display = "none"; 113 172 document.getElementById("loader").style.display = ""; 114 document.getElementById("content").style.display = "none"; 173 115 174 } 116 175 function showDeleter() { 176 document.getElementById("content").style.display = "none"; 117 177 document.getElementById("loader").style.display = ""; 118 document.getElementById("content").style.display = "none"; 178 119 179 document.getElementById("spinner").className = "fa fa-trash-o fa-spin fa-5x"; 120 180 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFile.cshtml
r13689 r13733 1 1 @model HeuristicLab.Clients.Hive.WebJobManager.ViewModels.FileOpeningViewModel 2 2 3 <div> 4 5 <ul class="nav nav-tabs"> 6 <li role="presentation" class="active"><a asp-controller="Job" asp-action="Uploads">Jobs -> Uploads -> @Model.SelectedTask.ItemTask.Name</a></li> 7 <li role="presentation"><a asp-controller="User" asp-action="Index">User management</a></li> 8 <li role="presentation"><a asp-controller="Resource" asp-action="Index">Resources</a></li> 3 4 <body class="row" 5 data-spy="scroll" 6 data-target="#scrolly" 7 data-offset-top="500" 8 onscroll="showScrolly()" 9 style="margin-bottom:500px;margin-left:1px;margin-right:1px;"> 10 11 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Job")) 12 13 <ul class="nav nav-pills nav-justified"> 14 <li role="presentation" 15 class=""> 16 <a asp-controller="Job" 17 asp-action="Index"> 18 Jobs 19 </a> 20 </li> 21 <li role="presentation" 22 class="active"> 23 <a asp-controller="Job" 24 asp-action="Uploads"> 25 Uploads 26 </a> 27 </li> 9 28 </ul> 10 @if (Model.SelectedAlgorithm != null) 11 { 12 @Html.Partial("OpenFilePartials/_Algorithm", Model); 13 14 } 15 else if(Model.SelectedBatchRun != null) 16 { 17 @Html.Partial("OpenFilePartials/_BatchRun", Model); 18 19 } 20 else if(Model.SelectedExperiment != null) 21 { 22 @Html.Partial("OpenFilePartials/_Experiment", Model); 23 24 } 25 29 <div class="row" 30 style="margin-left:20px"> 31 <a class="btn btn-default" 32 asp-controller="Job" 33 asp-action="Uploads"> 34 <i class="fa fa-angle-double-left"></i> Back to uploads 35 </a> 36 </div> 37 38 <div class="col-md-9"> 39 @if (Model.SelectedAlgorithm != null) 40 { 41 @Html.Partial("OpenFilePartials/_Algorithm", Model); 42 43 } 44 else if (Model.SelectedBatchRun != null) 45 { 46 @Html.Partial("OpenFilePartials/_BatchRun", Model); 47 48 } 49 else if (Model.SelectedExperiment != null) 50 { 51 @Html.Partial("OpenFilePartials/_Experiment", Model); 52 53 } 54 55 <hr style="border-color:gray; margin-top:50px" /> 56 <div id="finish" 57 style="text-align:center"> 58 <h2> 59 Hive job information 60 </h2> 61 <div class="row" 62 style="margin-bottom:20px"> 63 64 <div class="col-sm-6" 65 style="text-align:right"> 66 <h5>Job name</h5> 67 </div> 68 <div class="col-sm-6" 69 style="text-align:left"> 70 <div class="form-group"> 71 <div class="input-group"> 72 <input type="text" 73 class="form-control" 74 name="jname" 75 id="jname" 76 placeholder="Job name"> 77 </div> 78 </div> 79 </div> 80 </div> 81 <div class="row" 82 style="margin-bottom:20px"> 83 <div class="col-sm-6" 84 style="text-align:right"> 85 <h5> 86 Resource 87 </h5> 88 </div> 89 <div class="col-sm-6" 90 style="text-align:left"> 91 <div class="form-group"> 92 <div class="input-group"> 93 <div class="input-group-addon"> 94 HEAL/ 95 </div> 96 <input type="text" 97 class="form-control" 98 name="resource" 99 id="resource" 100 placeholder="Resource (default: HEAL)"> 101 </div> 102 </div> 103 </div> 104 </div> 105 106 <div class="row"> 107 <h5 class="col-sm-6" 108 style="text-align:right;margin-top:20px"> 109 Set global job priority 110 </h5> 111 <div class="col-sm-6"> 112 <div class="btn-group pull-left" 113 style="margin:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 114 text-shadow:2px 2px black;"> 115 <button type="button" 116 id="prior" 117 class="btn btn-info dropdown-toggle" 118 data-toggle="dropdown" 119 aria-haspopup="true" aria-expanded="false"> 120 Normal <span class="caret"></span> 121 </button> 122 <ul class="dropdown-menu" 123 style="text-shadow:none"> 124 <li><a onclick="changePriority([],0,'')">Low</a></li> 125 <li><a onclick="changePriority([],1,'')">Normal</a></li> 126 <li><a onclick="changePriority([],2,'')">Urgent</a></li> 127 <li><a onclick="changePriority([],3,'')">Critical</a></li> 128 </ul> 129 </div> 130 </div> 131 </div> 132 133 134 <a class="btn btn-lg btn-success" 135 id="fakehiveadd" 136 onclick="addtoHive()" 137 style="margin:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 138 text-shadow:2px 2px black;"> 139 Add this job to Hive 140 </a> 141 142 143 144 <a class="btn btn-success " id="realhiveadd" asp-controller="Job" asp-action="AddToHive" style="display:none"></a> 145 <h4 id="result" style="display:none">Start uploading experiment...</h4> 146 <div class="progress" id="progdiv" style="display:none"> 147 148 <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" 149 id="progress" 150 aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:10%"> 151 152 </div> 153 </div> 154 </div> 155 156 157 158 159 </div> 160 <nav style="margin-top:50px; " 161 class="col-md-2" id="scrolly"> 162 <ul class="nav nav-pills nav-stacked" 163 data-spy="affix" 164 data-offset-top="0"> 165 166 <li><a href="#top">Top</a></li> 167 @if (Model.SelectedAlgorithm != null) 168 { 169 <li><a href="#algorithm">Algorithm parameters</a></li> 170 <li><a href="#problem">Problem parameters</a></li> 171 } 172 else 173 { 174 <li><a href="#tasks">Child tasks</a></li> 175 176 } 177 <li><a href="#finish">Job info and upload</a></li> 178 </ul> 179 </nav> 26 180 <script src="~/js/scripts/hubber.js"></script> 27 </div> 181 <script> 182 showScrolly = function () { 183 document.getElementById("scrolly").style.display = ""; 184 185 } 186 $(function () { 187 $('nav > ul > li > a').click(function () { 188 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 189 var target = $(this.hash); 190 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 191 if (target.length) { 192 $('html, body').animate({ 193 scrollTop: target.offset().top 194 }, 1000); 195 return false; 196 } 197 } 198 }); 199 }); 200 </script> 201 </body> 202 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Algorithm.cshtml
r13712 r13733 8 8 @Model.message 9 9 </div> 10 <div class="row" style="text-align: left">11 <h1 data-toggle="tooltip" title="@Model.SelectedTask.ItemTask.ItemName10 <div class="row" style="text-align:center"> 11 <h1 id="top" data-toggle="tooltip" title="@Model.SelectedTask.ItemTask.ItemName 12 12 @Model.SelectedTask.ItemTask.Description"> 13 13 <span class="label label-primary">Algorithm: @Model.SelectedTask.ItemTask.Name</span> 14 14 </h1> 15 <a class="btn btn-success" id="fakehiveadd" onclick="addtoHive()">Add to Hive</a> 16 17 <div class="btn-group"> 18 <button 19 type="button" 20 id="prior@(randy)" 21 class="btn btn-info dropdown-toggle" 22 data-toggle="dropdown" 23 aria-haspopup="true" aria-expanded="false"> 24 Normal <span class="caret"></span> 25 </button> 26 <ul class="dropdown-menu"> 27 <li><a onclick="changePriority([],0,@randy)">Low</a></li> 28 <li><a onclick="changePriority([],1,@randy)">Normal</a></li> 29 <li><a onclick="changePriority([],2,@randy)">Urgent</a></li> 30 <li><a onclick="changePriority([],3,@randy)">Critical</a></li> 31 </ul> 32 </div> 33 34 35 <a class="btn btn-success" id="realhiveadd" asp-controller="Job" asp-action="AddToHive" style="display:none"></a> 36 <h4 id="result" style="display:none">Start uploading algorithm...</h4> 37 <div class="progress" id="progdiv" style="display:none"> 38 39 <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" 40 id="progress" 41 aria-valuenow="00" aria-valuemin="0" aria-valuemax="100" style="width:10%"> 42 40% 43 </div> 44 </div> 15 45 16 </div> 46 17 47 <div class="row"> 48 <div class="btn-group-justified"> 49 <a class="btn btn-default active" id="btnprob" onclick="setProb()">Problems</a> 50 <a class="btn btn-default" id="btnalg" onclick="setAlgo()">Algorithm</a> 51 </div> 52 </div> 53 <div class="row" id="problem"> 54 <div class="col"> 55 <table class="table table-condensed"> 56 <thead> 57 <tr> 58 <th>Parameter</th> 59 <th>Value</th> 60 </tr> 61 </thead> 62 <tbody> 63 @foreach (var prob in Model.SelectedAlgorithm.Problem.Parameters.OrderBy(x => x.Name)) 64 { 65 <tr> 66 <td>@prob.Name</td> 67 68 <td>@prob.ActualValue</td> 69 </tr> 70 71 } 72 </tbody> 73 </table> 74 </div> 75 </div> 76 <div class="row" id="algorithm" style="display:none"> 18 <div class="row" id="algorithm"> 77 19 78 20 <div class="col"> 79 <table class="table table-condensed"> 21 <h4>Algorithm parameters</h4> 22 <table class="table table-condensed" 23 style="table-layout:fixed;overflow-wrap:break-word"> 80 24 <thead> 81 25 <tr> … … 99 43 100 44 </div> 45 <hr style="border-color:gray" /> 46 47 <div class="row" id="problem"> 48 <div class="col"> 49 <h4>Problem parameters</h4> 50 <table class="table table-condensed" 51 style="table-layout:fixed;overflow-wrap:break-word"> 52 <thead> 53 <tr> 54 <th>Parameter</th> 55 <th>Value</th> 56 </tr> 57 </thead> 58 <tbody> 59 @foreach (var prob in Model.SelectedAlgorithm.Problem.Parameters.OrderBy(x => x.Name)) 60 { 61 <tr> 62 <td>@prob.Name</td> 63 64 <td>@prob.ActualValue</td> 65 </tr> 66 67 } 68 </tbody> 69 </table> 70 </div> 71 </div> 72 73 101 74 <script type="text/javascript"> 102 103 function setProb() {104 resetAll();105 document.getElementById("problem").style.display = "";106 document.getElementById("btnprob").className += " active";107 108 }109 function setAlgo() {110 resetAll();111 document.getElementById("algorithm").style.display = "";112 document.getElementById("btnalg").className += " active";113 }114 115 116 function resetAll() {117 document.getElementById("problem").style.display = "none";118 document.getElementById("algorithm").style.display = "none";119 document.getElementById("btnprob").className = document.getElementById("btnprob").className.replace(/(?:^|\s)active(?!\S)/g, '');120 document.getElementById("btnalg").className = document.getElementById("btnalg").className.replace(/(?:^|\s)active(?!\S)/g, '');121 }122 75 $(document).ready(function () { 123 76 $('[data-toggle="tooltip"]').tooltip(); 124 77 }); 125 78 </script> 79 126 80 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_AlgorithmSmall.cshtml
r13714 r13733 13 13 href="#collapseExample@(randomal)" 14 14 aria-expanded="false" 15 aria-controls="collapseExample@(randomal)"> 15 aria-controls="collapseExample@(randomal)" 16 style="margin:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 17 text-shadow:2px 2px black;"> 16 18 @Model.algo.Name 17 19 </a> 18 20 19 21 </p> 20 <div class="collapse" id="collapseExample@(randomal)" style="margin-left:10px;margin-right:10px;margin-top:-10px"> 22 <div class="collapse" 23 id="collapseExample@(randomal)" 24 style="margin-left:10px;margin-right:10px;margin-top:-10px"> 25 21 26 <img src="~/img/accoladealg.png" style="width:100%;" /> 22 <div class="panel panel-primary" style="border-width:2px!important; 23 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 24 text-shadow:none"> 27 28 <div class="panel panel-primary" 29 style="border-width:2px!important; 30 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 31 text-shadow:none"> 25 32 <div class="panel-heading panel-primary text-center"> 26 33 <p>@Model.algo.Description</p> 27 34 28 <div class="btn-group"> 35 <div class="btn-group" 36 style="text-shadow:none"> 29 37 <button type="button" 30 38 id="prior@(randomal)" … … 42 50 </div> 43 51 </div> 44 <table class="table table-responsive card-block" style="table-layout:fixed;overflow-wrap:break-word"> 52 <h4>Algorithm parameters</h4> 53 <table class="table table-condensed" 54 style="table-layout:fixed;overflow-wrap:break-word"> 55 <thead> 56 <tr> 57 <th>Parameter</th> 58 <th>Value</th> 59 </tr> 60 </thead> 61 <tbody> 62 @foreach (var par in Model.algo.Parameters.OrderBy(x => x.Name)) 63 { 64 <tr> 65 <td>@par.Name</td> 66 67 <td>@par.ActualValue</td> 68 </tr> 69 70 } 71 </tbody> 72 </table> 73 <hr style="border-color:gray" /> 74 <h4>Problem parameters</h4> 75 <table class="table table-responsive card-block" 76 style="table-layout:fixed;overflow-wrap:break-word"> 45 77 <thead> 46 78 <tr> … … 61 93 </tbody> 62 94 </table> 63 <table class="table table-condensed" style="table-layout:fixed;overflow-wrap:break-word">64 <thead>65 <tr>66 <th>Parameter</th>67 <th>Value</th>68 </tr>69 </thead>70 <tbody>71 @foreach (var par in Model.algo.Parameters.OrderBy(x => x.Name))72 {73 <tr>74 <td>@par.Name</td>75 95 76 <td>@par.ActualValue</td>77 </tr>78 96 79 }80 </tbody>81 </table>82 97 </div> 83 98 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRun.cshtml
r13712 r13733 6 6 @Model.message 7 7 </div> 8 <div class="row" style="text-align:left"> 9 <h1 data-toggle="tooltip" title="@Model.SelectedTask.ItemTask.ItemName 8 <div class="row" 9 style="text-align:center"> 10 <h1 id="top" 11 data-toggle="tooltip" 12 title="@Model.SelectedTask.ItemTask.ItemName 10 13 @Model.SelectedTask.ItemTask.Description "> 11 <span class="label label-warning ">Batch: @Model.SelectedBatchRun.Name</span> 14 <span class="label label-warning " 15 style="text-shadow:2px 2px black;"> 16 Batch: @Model.SelectedBatchRun.Name 17 </span> 12 18 </h1> 13 <a class="btn btn-success" id="fakehiveadd" onclick="addtoHive()">Add to Hive</a>14 15 <div class="btn-group">16 <button type="button"17 id="prior@(randy)"18 class="btn btn-info dropdown-toggle"19 data-toggle="dropdown"20 aria-haspopup="true" aria-expanded="false">21 Normal <span class="caret"></span>22 </button>23 <ul class="dropdown-menu">24 <li><a onclick="changePriority([],0,@randy)">Low</a></li>25 <li><a onclick="changePriority([],1,@randy)">Normal</a></li>26 <li><a onclick="changePriority([],2,@randy)">Urgent</a></li>27 <li><a onclick="changePriority([],3,@randy)">Critical</a></li>28 </ul>29 </div>30 31 <a class="btn btn-success" id="realhiveadd" asp-controller="Job" asp-action="AddToHive" style="display:none"></a>32 <h4 id="result" style="display:none">Start uploading batch run...</h4>33 <div class="progress" id="progdiv" style="display:none">34 35 <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar"36 id="progress"37 aria-valuenow="00" aria-valuemin="0" aria-valuemax="100" style="width:10%">38 40%39 </div>40 </div>41 19 </div> 42 <h4 >20 <h4 id="tasks"> 43 21 Repeats: @Model.SelectedBatchRun.Repetitions x 44 22 45 23 </h4> 46 24 <p class="text-center"> 47 <input type="checkbox" checked data-toggle="toggle" data-onstyle="warning" 25 <input type="checkbox" 26 checked 27 data-toggle="toggle" 28 data-onstyle="warning" 48 29 onchange="toggleChild([], @randy)" /> 49 30 Distribute child tasks -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRunSmall.cshtml
r13714 r13733 16 16 href="#collapseExample@(randombr)" 17 17 aria-expanded="false" 18 aria-controls="collapseExample@(randombr)"> 18 aria-controls="collapseExample@(randombr)" 19 style="margin:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 20 text-shadow:2px 2px black;"> 19 21 @Model.batch.Name 20 22 </a> … … 26 28 27 29 > 28 <img src="~/img/accoladebatch.png" style="width:100%" /> 30 <img src="~/img/accoladebatch.png" 31 style="width:100%" /> 32 29 33 <div class="panel panel-warning" 30 34 style="border-color:#f6cd94!important; border-width:2px!important; 31 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);32 text-shadow:2px 2px black">35 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 36 text-shadow:2px 2px black"> 33 37 <div class="panel-heading text-center"> 34 38 <p class="panel-title"> … … 38 42 39 43 40 <input type="checkbox" checked data-toggle="toggle" data-onstyle="warning" 44 <input type="checkbox" 45 checked 46 data-toggle="toggle" 47 data-onstyle="warning" 41 48 onchange="toggleChild(@builder, @randombr)" /> 42 49 Distribute child tasks 43 50 44 51 </p> 45 <div class="btn-group"> 52 <div class="btn-group" 53 style="text-shadow:none"> 54 46 55 <button type="button" 47 56 id="prior@(randombr)" 48 57 class="btn btn-info dropdown-toggle" 49 58 data-toggle="dropdown" 50 aria-haspopup="true" aria-expanded="false"> 59 aria-haspopup="true" 60 aria-expanded="false"> 51 61 Normal <span class="caret"></span> 52 62 </button> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_Experiment.cshtml
r13712 r13733 2 2 @{System.Random randomizer = new Random(); 3 3 int randy = randomizer.Next(5000); } 4 <div style="margin-left:20px;margin-right:20px"> 4 5 6 <div style="margin-left:20px;margin-right:20px; "> 5 7 <div class="row" style="text-align:center"> 6 8 @Model.message 7 9 </div> 8 <div class="row" style="text-align:left"> 9 <h1 data-toggle="tooltip" title=" @Model.SelectedTask.ItemTask.ItemName 10 <div class="row" style="text-align:center"> 11 <h1 id="top" 12 data-toggle="tooltip" 13 title=" @Model.SelectedTask.ItemTask.ItemName 10 14 @Model.SelectedTask.ItemTask.Description "> 11 <span class="label label-danger">Experiment: @Model.SelectedTask.ItemTask.Name</span> 15 <span class="label label-danger" 16 style="text-shadow:2px 2px black;"> 17 Experiment: @Model.SelectedTask.ItemTask.Name 18 </span> 12 19 </h1> 13 <a class="btn btn-success" id="fakehiveadd" onclick="addtoHive()">Add to Hive</a>14 20 15 16 <div class="btn-group">17 <button type="button"18 id="prior@(randy)"19 class="btn btn-info dropdown-toggle"20 data-toggle="dropdown"21 aria-haspopup="true" aria-expanded="false">22 Normal <span class="caret"></span>23 </button>24 <ul class="dropdown-menu">25 <li><a onclick="changePriority([],0,@randy)">Low</a></li>26 <li><a onclick="changePriority([],1,@randy)">Normal</a></li>27 <li><a onclick="changePriority([],2,@randy)">Urgent</a></li>28 <li><a onclick="changePriority([],3,@randy)">Critical</a></li>29 </ul>30 </div>31 <a class="btn btn-success" id="realhiveadd" asp-controller="Job" asp-action="AddToHive" style="display:none"></a>32 <h4 id="result" style="display:none">Start uploading experiment...</h4>33 <div class="progress" id="progdiv" style="display:none">34 35 <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar"36 id="progress"37 aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:10%">38 39 </div>40 </div>41 21 </div> 42 <h4 >22 <h4 id="tasks"> 43 23 Children: @Model.SelectedExperiment.Optimizers.Count 44 24 </h4> … … 84 64 } 85 65 </div> 66 86 67 <script type="text/javascript"> 87 68 -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_ExperimentSmall.cshtml
r13714 r13733 13 13 href="#collapseExample@(randomex)" 14 14 aria-expanded="false" 15 aria-controls="collapseExample@(randomex)"> 15 aria-controls="collapseExample@(randomex)" 16 style="margin:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 17 text-shadow:2px 2px black;"> 16 18 @Model.exp.Name 17 19 </a> 18 20 19 21 </p> 20 <div class="collapse" id="collapseExample@(randomex)" style="margin-left:10px;margin-right:10px;margin-top:-10px"> 21 <img src="~/img/accoladeexp.png" style="width:100%" /> 22 <div class="panel panel-danger" style="border-color:#c12e2a!important; border-width:2px!important; 23 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 24 text-shadow:2px 2px black"> 22 <div class="collapse" 23 id="collapseExample@(randomex)" 24 style="margin-left:10px;margin-right:10px;margin-top:-10px"> 25 26 <img src="~/img/accoladeexp.png" 27 style="width:100%" /> 28 29 <div class="panel panel-danger" 30 style="border-color:#c12e2a!important; border-width:2px!important; 31 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 32 text-shadow:2px 2px black"> 33 25 34 <div class="panel-heading panel-danger text-center"> 26 <p class="panel-title">Children: @Model.exp.Optimizers.Count</p> 35 <p class="panel-title"> 36 Children: @Model.exp.Optimizers.Count 37 </p> 27 38 <p> 28 39 <label> 29 40 30 <input type="checkbox" checked data-toggle="toggle" data-onstyle="danger" 41 <input type="checkbox" 42 checked 43 data-toggle="toggle" 44 data-onstyle="danger" 31 45 onchange="toggleChild(@builder, @randomex)" /> 32 46 Distribute child tasks 33 47 </label> 34 48 </p> 35 <div class="btn-group"> 49 <div class="btn-group" 50 style="text-shadow:none"> 36 51 <button type="button" 37 52 id="prior@(randomex)" -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/SelectedJobPartials/_AlgTask.cshtml
r13719 r13733 5 5 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 6 6 text-shadow:2px 2px black"> 7 8 <script type="text/javascript">//Has to be up front to ensure right order of javascript array 9 initSaveData("@(Model.hiveTask.Task.Id)", 10 @Html.Raw(JsonConvert.SerializeObject(Model.hiveTask.Task.StateLog)), "@(Model.hiveTask.ItemTask.Name)"); 11 12 </script> 13 14 7 15 <div class="panel-heading" 8 16 data-toggle="collapse" … … 55 63 </tr> 56 64 <tr> 57 <td></td> 65 <td style="word-break:break-all" id="exceptionpar@(Model.hiveTask.Task.Id)"> 66 <i class="fa fa-cog fa-spin fa-2x" id="spinner"></i> 67 </td> 58 68 <td id="statechangespar@(Model.hiveTask.Task.Id)"> 59 69 <i class="fa fa-cog fa-spin fa-2x" id="spinner"></i> 70 </td> 71 </tr> 72 <tr style="display:none" id="restarter@(Model.hiveTask.Task.Id)"> 73 <td><input style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 74 text-shadow:2px 2px black;" 75 id="restarterbtn@(Model.hiveTask.Task.Id)" 76 class="btn btn-success" 77 type="button" 78 onclick="restart('@(Model.hiveTask.Task.Id)');event.cancelBubble=true;" 79 value="Restart task"/> 60 80 </td> 61 81 </tr> … … 69 89 type="checkbox" 70 90 data-toggle="toggle" 71 data-on=" Line"91 data-on="Bar" 72 92 data-off="Pie" 73 93 onchange="redrawGraph('@(Model.hiveTask.Task.Id)')" /> … … 78 98 </div> 79 99 </div> 80 <script type="text/javascript"> 81 initSaveData("@(Model.hiveTask.Task.Id)", 82 @Html.Raw(JsonConvert.SerializeObject(Model.hiveTask.Task.StateLog))); 83 84 document.getElementById("graph@(Model.hiveTask.Task.Id)").style = "width: 100%; height: 400px;"; 85 86 Plotly.newPlot('graph@(Model.hiveTask.Task.Id)', 87 getDataPie("@Model.hiveTask.Task.Id")); 88 </script> 100 89 101 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/SelectedJobPartials/_BatchTask.cshtml
r13719 r13733 4 4 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 5 5 text-shadow:2px 2px black"> 6 7 <script type="text/javascript"> //Has to be up front to ensure right order of javascript array 8 initSaveData("@(Model.hiveTask.Task.Id)", 9 @Html.Raw(JsonConvert.SerializeObject(Model.hiveTask.Task.StateLog)), "@(Model.hiveTask.ItemTask.Name)"); 10 11 </script> 12 13 6 14 <div class="panel-heading" 7 15 data-toggle="collapse" … … 14 22 <tr> 15 23 <th>Batch run: @Model.hiveTask.ItemTask.Name</th> 16 <th style="font-size:large ">24 <th style="font-size:large; "> 17 25 @if (Model.hiveTask.Task.Priority == 0) 18 26 { … … 65 73 <i class="fa fa-cog fa-spin fa-2x" id="spinner"></i> 66 74 </td> 75 76 </tr> 77 <tr> 78 <td style="word-break:break-all" id="exceptionpar@(Model.hiveTask.Task.Id)"> 79 <i class="fa fa-cog fa-spin fa-2x" id="spinner"></i> 80 </td> 81 </tr> 82 <tr style="display:none" id="restarter@(Model.hiveTask.Task.Id)"> 83 <td> 84 <input style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 85 text-shadow:2px 2px black;" 86 id="restarterbtn@(Model.hiveTask.Task.Id)" 87 class="btn btn-success" 88 type="button" 89 onclick="restart('@(Model.hiveTask.Task.Id)');event.cancelBubble=true;" 90 value="Restart task"/> 91 </td> 67 92 </tr> 68 93 </tbody> … … 74 99 type="checkbox" 75 100 data-toggle="toggle" 76 data-on=" Line"101 data-on="Bar" 77 102 data-off="Pie" 78 103 onchange="redrawGraph('@(Model.hiveTask.Task.Id)')"> … … 94 119 </div> 95 120 } 96 <script type="text/javascript"> 97 initSaveData("@(Model.hiveTask.Task.Id)", 98 @Html.Raw(JsonConvert.SerializeObject(Model.hiveTask.Task.StateLog))); 99 100 document.getElementById("graph@(Model.hiveTask.Task.Id)").style = "width: 100%; height: 400px;"; 101 102 Plotly.newPlot('graph@(Model.hiveTask.Task.Id)', 103 getData("@Model.hiveTask.Task.Id")); 104 105 </script> 121 106 122 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/SelectedJobPartials/_ExpTask.cshtml
r13719 r13733 7 7 text-shadow:2px 2px black" 8 8 > 9 10 11 <script type="text/javascript">//Has to be up front to ensure right order of javascript array 12 initSaveData("@(Model.hiveTask.Task.Id)", 13 @Html.Raw(JsonConvert.SerializeObject(Model.hiveTask.Task.StateLog)), "@(Model.hiveTask.ItemTask.Name)"); 14 15 </script> 16 17 9 18 <div class="panel-heading" 10 19 data-toggle="collapse" … … 68 77 </td> 69 78 </tr> 79 <tr > 80 <td style="display:none" id="restarter@(Model.hiveTask.Task.Id)"> 81 <input style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 82 text-shadow:2px 2px black;" 83 id="restarterbtn@(Model.hiveTask.Task.Id)" 84 class="btn btn-success" 85 type="button" 86 onclick="restart('@(Model.hiveTask.Task.Id)');event.cancelBubble=true;" 87 value="Restart task" /> 88 </td> 89 <td style="word-break:break-all" id="exceptionpar@(Model.hiveTask.Task.Id)"> 90 <i class="fa fa-cog fa-spin fa-2x" id="spinner"></i> 91 </td> 92 </tr> 70 93 </tbody> 71 94 </table> … … 77 100 data-toggle="toggle" 78 101 79 data-on=" Line"102 data-on="Bar" 80 103 data-off="Pie" 81 104 onchange="redrawGraph('@(Model.hiveTask.Task.Id)')"> … … 97 120 </div> 98 121 } 99 <script type="text/javascript"> 100 initSaveData("@(Model.hiveTask.Task.Id)", 101 @Html.Raw(JsonConvert.SerializeObject(Model.hiveTask.Task.StateLog))); 102 103 document.getElementById("graph@(Model.hiveTask.Task.Id)").style = "width: 100%!important; height: 400px;"; 104 105 Plotly.newPlot('graph@(Model.hiveTask.Task.Id)', 106 getData("@Model.hiveTask.Task.Id")); 107 </script> 122 108 123 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Upload.cshtml
r13656 r13733 3 3 <div> 4 4 5 <ul class="nav nav-tabs"> 6 <li role="presentation" class="active"><a asp-controller="Job" asp-action="Index">Jobs <span class="badge"></span></a></li> 7 <li role="presentation"><a asp-controller="User" asp-action="Index">User management</a></li> 8 <li role="presentation"><a asp-controller="Resource" asp-action="Index">Resources</a></li> 9 </ul> 5 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Job")) 6 7 10 8 <div style="margin:10px"> 11 <form method="post" asp-action="Upload" asp-controller="Job" enctype="multipart/form-data"> 12 <input onchange="printFiles()" type="file" id="files" name="files" multiple accept=".hl" style="display:none" /> 13 <div onclick="firefilebutton()" class="btn btn-info btn-lg btn-block ">Choose file(s)</div> 14 <div class="row" style="margin:10px"> 9 10 <form method="post" 11 asp-action="Upload" 12 asp-controller="Job" 13 enctype="multipart/form-data"> 14 <input onchange="printFiles()" 15 type="file" 16 id="files" 17 name="files" 18 multiple 19 accept=".hl" 20 style="display:none" /> 21 22 <div onclick="firefilebutton()" 23 class="btn btn-info btn-lg btn-block "> 24 Choose file(s) 25 </div> 26 27 <div class="row" 28 style="margin:10px"> 15 29 <div id="selectedfiles"></div> 16 <div style="visibility:hidden; margin-bottom:10px;" id="del" class='btn btn-danger' onclick='deletefiles()'> 17 <span class='glyphicon glyphicon-trash' aria-hidden='true'></span> Remove files 30 <div style="visibility:hidden; margin-bottom:10px;" 31 id="del" 32 class='btn btn-danger' 33 onclick='deletefiles()'> 34 <span class='glyphicon glyphicon-trash' 35 aria-hidden='true'></span> Remove files 18 36 </div> 19 <input style="visibility:hidden;" id="upl" class="btn btn-lg btn-block btn-success" type="submit" value="Check contents" /> 37 <input style="visibility:hidden;" 38 id="upl" 39 class="btn btn-lg btn-block btn-success" 40 type="submit" 41 value="Check contents" /> 20 42 </div> 21 43 … … 37 59 "</p>"; 38 60 } 39 61 40 62 } 41 else {63 else { 42 64 document.getElementById("upl").style.visibility = "hidden"; 43 65 document.getElementById("del").style.visibility = "hidden"; -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Uploads.cshtml
r13689 r13733 3 3 <div> 4 4 5 <ul class="nav nav-tabs"> 6 <li role="presentation" class="active"><a asp-controller="Job" asp-action="Index">Jobs -> Uploads</a></li> 7 <li role="presentation"><a asp-controller="User" asp-action="Index">User management</a></li> 8 <li role="presentation"><a asp-controller="Resource" asp-action="Index">Resources</a></li> 5 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Job")) 6 7 <ul class="nav nav-pills nav-justified"> 8 <li role="presentation" 9 class=""> 10 <a asp-controller="Job" 11 asp-action="Index"> 12 Jobs 13 </a> 14 </li> 15 <li role="presentation" 16 class="active"> 17 <a asp-controller="Job" 18 asp-action="Uploads"> 19 Uploads 20 </a> 21 </li> 9 22 </ul> 10 <div class="row" style="text-align:center">11 @Model.message12 </div>13 23 <div class="row" style="margin:10px"> 14 <a class="btn btn-success btn-lg btn-block" 15 asp-controller="Job" 16 asp-action="Uploader"> 17 Upload new file(s) 18 </a> 24 <div style="text-align:center">@Model.message</div> 25 19 26 </div> 20 27 <div class="row" style="padding:10px"> … … 22 29 { 23 30 <div> 24 <p style="text-align:center">No files uploaded</p> 31 <p style="text-align:center"> 32 No files uploaded 33 </p> 34 <a class="btn btn-success btn-lg btn-block" 35 asp-controller="Job" 36 asp-action="Uploader" 37 style="margin:10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 38 text-shadow:2px 2px black;"> 39 <i class="fa fa-cloud-upload"></i> Upload new file(s) 40 </a> 25 41 </div> 26 42 … … 29 45 <div class="col-sm-4"> 30 46 <div class="btn-group-vertical btn-block"> 47 <a class="btn btn-success btn-lg btn-block 48 @(Model.SelectedIndex == -1 ? "active" : "") 49 " 50 asp-controller="Job" 51 asp-action="UploadDir" 52 asp-route-index="-1" 53 onclick="showUploader()" 54 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 55 text-shadow:2px 2px black;"> 56 <i class="fa fa-cloud-upload"></i> Upload new file(s) 57 </a> 31 58 @for (int i = 0; i < Model.DisplayDatePaths.Count; i++) 32 59 { 33 60 <a class="btn btn-default @(i == Model.SelectedIndex ? "active" : "" )" 61 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" 34 62 asp-controller="Job" 35 63 asp-action="UploadDir" 36 asp-route-index="@(i)"> 64 asp-route-index="@(i)" 65 onclick="showDownloader()"> 37 66 @Model.DisplayDatePaths[i] 38 67 </a> … … 41 70 </div> 42 71 </div> 43 @if (Model.SelectedIndex != -1) 44 { 45 <div class="col-sm-8"> 72 <p style="display:none" 73 id="downloader" 74 class="text-center"> 75 <br /><br /><br /><br /><br /><br /><br /> 76 <i class="fa fa-cloud-download fa-spin fa-5x" id="spinner"> 77 </i> 78 </p> 79 <p style="display:none" 80 id="uploader" 81 class="text-center"> 82 <br /><br /><br /><br /><br /><br /><br /> 83 <i class="fa fa-cloud-upload fa-spin fa-5x" id="spinner"> 84 </i> 85 </p> 86 <p style="display:none" 87 id="deleter" 88 class="text-center"> 89 <br /><br /><br /><br /><br /><br /><br /> 90 <i class="fa fa-trash-o fa-spin fa-5x" id="spinner"> 91 </i> 92 </p> 93 <div id="content"> 94 @if (Model.SelectedIndex != -1) 95 { 96 <div class="col-sm-8"> 46 97 47 @for (int i = 0; i < Model.DisplayFilesPaths.Count; i++)98 @for (int i = 0; i < Model.DisplayFilesPaths.Count; i++) 48 99 { 49 <div class="btn-group-justified btn-block">100 <div class="btn-group-justified btn-block"> 50 101 51 <a class="btn btn-default @(Model.DisplayFilesPaths[i].EndsWith(".hl") ? "" : "disabled" )" 52 asp-controller="Job" 53 asp-action="OpenFile" 54 asp-route-index="@(Model.SelectedIndex)" 55 asp-route-filedex="@i" 56 style="width:6%"> 57 @Model.DisplayFilesPaths[i] 58 </a> 59 <a id="del" 60 class='btn btn-group btn-danger' 61 asp-controller="Job" 62 asp-action="DeleteFile" 63 asp-route-index="@(Model.SelectedIndex)" 64 asp-route-filedex="@i" > 65 <span class='glyphicon glyphicon-trash' aria-hidden='true'></span> 66 </a> 67 </div> 68 } 102 <a class="btn btn-default @(Model.DisplayFilesPaths[i].EndsWith(".hl") ? "" : "disabled" )" 103 asp-controller="Job" 104 asp-action="OpenFile" 105 asp-route-index="@(Model.SelectedIndex)" 106 asp-route-filedex="@i" 107 style="width:6%;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);"> 108 @Model.DisplayFilesPaths[i] 109 </a> 110 <a id="del" 111 style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 112 text-shadow:2px 2px black;" 113 class='btn btn-group btn-danger' 114 asp-controller="Job" 115 asp-action="DeleteFile" 116 asp-route-index="@(Model.SelectedIndex)" 117 asp-route-filedex="@i" 118 onclick="showDeleter()"> 119 <span class='glyphicon glyphicon-trash' aria-hidden='true'></span> 120 </a> 121 </div> 122 } 69 123 70 124 71 </div>125 </div> 72 126 73 } 127 } 128 else 129 { 130 <div class="col-sm-8"> 131 132 @Html.Partial("UploaderPartial/_UploaderPartial") 133 </div> 134 } 135 </div> 74 136 75 137 } 76 138 </div> 139 <script type="text/javascript"> 140 function showDownloader() { 141 document.getElementById("content").style.display = "none"; 142 document.getElementById("downloader").style.display = ""; 143 144 } 145 function showUploader() { 146 document.getElementById("content").style.display = "none"; 147 document.getElementById("uploader").style.display = ""; 148 149 } 150 function showDeleter() { 151 document.getElementById("content").style.display = "none"; 152 document.getElementById("deleter").style.display = ""; 153 } 154 </script> 77 155 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Resource/Index.cshtml
r13689 r13733 2 2 <div> 3 3 4 <ul class="nav nav-tabs"> 5 <li role="presentation"><a asp-controller="Job" asp-action="Index">Jobs</a></li> 6 <li role="presentation"><a asp-controller="User" asp-action="Index">User management</a></li> 7 <li role="presentation" class="active"><a asp-controller="Resource" asp-action="Index">Resources</a></li> 8 </ul> 4 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Resource")) 5 6 9 7 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Shared/_Layout.cshtml
r13712 r13733 12 12 </environment> 13 13 <link href="https://gitcdn.github.io/bootstrap-toggle/2.2.0/css/bootstrap-toggle.min.css" rel="stylesheet"> 14 14 <link rel="stylesheet" href="//rawgithub.com/Caged/d3-tip/master/examples/example-styles.css"> 15 15 </head> 16 <body >16 <body > 17 17 <div> 18 18 <nav class="navbar navbar-default navbar-static-top" … … 32 32 <script src="~/js/raphael.js"></script> 33 33 <script src="~/js/plotly.js"></script> 34 <script src="~/js/moment.js"></script> 35 <script src="~/js/moment-timezone-with-data.js"></script> 36 <script src="~/js/d3.js"></script> 37 <script src="~/js/d3.v3.min.js"></script> 38 <script src="~/js/d3-gantt-jobstatus.js"></script> 39 <script src="~/js/d3-tip.js"></script> 34 40 @RenderBody() 35 41 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/User/Index.cshtml
r13689 r13733 2 2 <div> 3 3 4 <ul class="nav nav-tabs"> 5 <li role="presentation" ><a asp-controller="Job" asp-action="Index">Jobs</a></li> 6 <li role="presentation" class="active"><a asp-controller="User" asp-action="Index">User management</a></li> 7 <li role="presentation"><a asp-controller="Resource" asp-action="Index">Resources</a></li> 8 </ul> 4 @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("User")) 5 6 9 7 </div> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/css/StyleSheet.css
r13712 r13733 46 46 color:white!important; 47 47 } 48 49 .label-as-badge { 50 border-radius: 1em; 51 } 52 53 .bar-off{ 54 fill : #c2c2d6; 55 } 56 .bar-off:hover{ 57 fill : #e0e0eb; 58 } 59 .bar-wait{ 60 61 fill : #f0a742; 62 } 63 .bar-wait:hover{ 64 fill : #f4bd71; 65 } 66 .bar-trans{ 67 fill : #80d4ff; 68 } 69 .bar-trans:hover{ 70 fill : #99ddff; 71 } 72 .bar-calc{ 73 fill : #2f6fa6; 74 } 75 .bar-calc:hover{ 76 fill : #3884c7; 77 } 78 .bar-paus{ 79 fill : #47476b; 80 } 81 .bar-paus:hover{ 82 fill : #5c5c8a; 83 } 84 .bar-fin{ 85 fill : #5cb85c; 86 } 87 .bar-fin:hover{ 88 fill : #71c171; 89 } 90 .bar-abo{ 91 fill : #c2302c; 92 } 93 .bar-abo:hover{ 94 fill : #d54944; 95 } 96 .bar-fail{ 97 fill : #c2302c; 98 } 99 .bar-fail:hover{ 100 fill : #d54944; 101 } 102 103 rect.selection { 104 stroke : gray; 105 stroke-dasharray: 4px; 106 stroke-opacity : 0.5; 107 fill : transparent; 108 } 109 110 /* disable text selection */ 111 svg *::selection { 112 background : transparent; 113 } 114 115 svg *::-moz-selection { 116 background:transparent; 117 } 118 119 svg *::-webkit-selection { 120 background:transparent; 121 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/Scripts/Graphs/GraphDataCollector.js
r13719 r13733 1 1 var dataCollection = []; 2 3 function initSaveData(id, coll) {//initial data save 4 var temp = dataConversion(coll); 2 var taskStatus = { 3 "Offline": "bar-off", 4 "Waiting": "bar-wait", 5 "Transferring": "bar-trans", 6 "Calculating": "bar-calc", 7 "Paused": "bar-paus", 8 "Finished": "bar-fin", 9 "Aborted": "bar-abo", 10 "Failed": "bar-fail" 11 } 12 13 function initSaveData(id, coll, name) {//initial data save 14 var temp = dataConversion(coll, name); 5 15 temp.unshift(id); //add ID in front of array 6 16 dataCollection.push(temp);// [id,timearr, piearr] 7 console.log("#CREATION: " + id); 8 } 9 function saveData(id, coll) { 10 var temp = dataConversion(coll); 11 for (var i = 0; i < dataCollection.length; i++) { 12 if (dataCollection[i][0] == id) { 13 dataCollection[i][1] = temp[0]; 14 dataCollection[i][2] = temp[1]; 17 // console.log("#CREATION: " + id); 18 } 19 function saveData(id, coll, name) { 20 var temp = dataConversion(coll, name); 21 for (var i = 0; i < dataCollection.length; i++) { 22 if (dataCollection[i][0] == id) { 23 dataCollection[i][1] = temp[0]; // [data,layout] 24 dataCollection[i][2] = temp[1]; // data 25 dataCollection[i][3] = temp[2]; // [tasks, name] 15 26 } 16 27 } … … 31 42 } 32 43 } 33 34 } 35 function dataConversion(coll) { 36 37 38 return [dataConversionLine(coll),dataConversionPie(coll)]; 39 } 40 function dataConversionLine(coll) { 44 } 45 function getDataGantt(id) { 46 for (var i = 0; i < dataCollection.length; i++) { 47 if (dataCollection[i][0] == id) { 48 return dataCollection[i][3]; 49 } 50 } 51 } 52 function dataConversion(coll, name) { 53 var line = dataConversionLine(coll, name); 54 var pie = dataConversionPie(coll); 55 var gantt = dataConversionGantt(coll, name); 56 return [line, pie, gantt]; 57 } 58 function dataConversionGantt(coll, nam) { 59 var tasks = []; 60 for (var v = 0; v < coll.length; v++) { 61 62 var temp = {}; 63 temp.startDate = Date.parse(coll[v].DateTime); 64 if (v < coll.length - 1) 65 temp.endDate = Date.parse(coll[v + 1].DateTime); 66 else { 67 68 var dat = Date.parse(coll[v].DateTime); 69 //console.log(dat); 70 temp.endDate = dat + 600000; 71 temp.last = true; 72 } 73 temp.taskName = nam; 74 75 if (coll[v].State == 0) 76 temp.status = "Offline"; 77 else if (coll[v].State == 1) 78 temp.status = "Waiting"; 79 else if (coll[v].State == 2) 80 temp.status = "Transferring"; 81 else if (coll[v].State == 3) 82 temp.status = "Calculating"; 83 else if (coll[v].State == 4) 84 temp.status = "Paused"; 85 else if (coll[v].State == 5) 86 temp.status = "Finished"; 87 else if (coll[v].State == 6) 88 temp.status = "Aborted"; 89 else if (coll[v].State == 7) 90 temp.status = "Failed"; 91 tasks.push(temp); 92 } 93 return [tasks, nam]; 94 } 95 function dataConversionLine(coll, nam) { 41 96 var xarr = []; 42 97 var yarr = []; 98 43 99 for (var v = 0; v < coll.length; v++) { 100 44 101 xarr.push(Date.parse(coll[v].DateTime)); 102 // console.log(xarr[v]); 103 // xarr[v] = xarr[v] - 3600000; 45 104 if (coll[v].State == 1) 46 105 yarr.push("Waiting"); 47 else if (coll[v].State == 2) 106 else if (coll[v].State == 2) 48 107 yarr.push("Transferring"); 49 else if (coll[v].State == 3) 108 else if (coll[v].State == 3) 50 109 yarr.push("Calculating"); 51 110 else if (coll[v].State == 5) … … 54 113 yarr.push("Failed"); 55 114 } 115 116 56 117 var data = [{//Time graph 57 118 x: xarr, … … 59 120 type: 'scatter', 60 121 mode: 'lines', 61 name: 'Task ',62 connectgaps: true,63 line: {shape:'hv'}122 name: nam, 123 connectgaps: true, 124 line: { shape: 'hvh' } 64 125 }]; 65 layout = {126 layout = { 66 127 "showlegend": true, 67 128 "width": "100%", 68 129 "xaxis": { 69 "autorange": true, 130 "autorange": true, 70 131 "range": [ 71 Date.parse(coll[0].DateTime), 72 Date.parse(coll[coll.length - 1].DateTime)73 ], 74 "title": "Time", 132 Date.parse(coll[0].DateTime), 133 Date.parse(coll[coll.length - 1].DateTime) 134 ], 135 "title": "Time", 75 136 "type": "date" 76 137 } 77 138 78 139 } 79 80 return [data,layout]; 81 } 82 function dataConversionHBar(coll) { 83 var xarr = []; 84 var yarr = []; 85 for (var v = 0; v < coll.length; v++) { 86 xarr.push(coll[v].DateTime.substr(11, 8)); 87 if (coll[v].State == 1) 88 yarr.push("Waiting"); 89 else if (coll[v].State == 2) 90 yarr.push("Transferring"); 91 else if (coll[v].State == 3) 92 yarr.push("Calculating"); 93 else if (coll[v].State == 5) 94 yarr.push("Finished"); 95 else if (coll[v].State == 7) 96 yarr.push("Failed"); 97 } 98 var data = [{//Time graph 99 x: xarr, 100 y: yarr, 101 type: 'scatter' 102 }]; 103 104 return data; 105 } 140 141 return [data, layout]; 142 } 143 106 144 function dataConversionPie(coll) { 107 145 var waiting = 0; 108 146 var transfer = 0; 109 147 var calc = 0; 110 for (var v = 0; v < coll.length -1; v++) {111 if (coll[v].State == 1)148 for (var v = 0; v < coll.length - 1; v++) { 149 if (coll[v].State == 1) 112 150 waiting += Date.parse(coll[v + 1].DateTime) - Date.parse(coll[v].DateTime); 113 else if (coll[v].State == 2) 151 else if (coll[v].State == 2) 114 152 transfer += Date.parse(coll[v + 1].DateTime) - Date.parse(coll[v].DateTime); 115 else if (coll[v].State == 3) 153 else if (coll[v].State == 3) 116 154 calc += Date.parse(coll[v + 1].DateTime) - Date.parse(coll[v].DateTime); 117 155 } … … 133 171 document.getElementById("graph" + val).style.width = "100%"; 134 172 document.getElementById("graph" + val).style.height = "400px"; 173 document.getElementById("graph" + val).innerHTML = ""; 174 document.getElementById("graph" + val).style.marginLeft = "0px"; 135 175 if (document.getElementById("graphtoggle" + val).checked) { 136 176 setTimeout(function () { 177 178 var temp = getDataGantt(val); 179 var w = $("#graph" + val).parent().width() - 30; 180 document.getElementById("graph" + val).style.height = "200px"; 181 var gantt = d3.gantt().selector('#graph' + val).height('200').width(w).margin({ 182 top: 20, 183 right: 40, 184 bottom: 20, 185 left: 20 186 }).drawytitles(false).taskTypes([temp[1]]).taskStatus(taskStatus); 187 // document.getElementById("graph" + val).style.marginLeft = "-40px"; 188 gantt(temp[0]); 189 }, 100); 190 191 192 /* setTimeout(function () { 137 193 Plotly.newPlot('graph' + val, getData(val)[0], getData(val)[1]); 138 }, 100); 139 console.log("#REDRAWN LINE: " + val);194 }, 100);*/ 195 // console.log("#REDRAWN LINE: " + val); 140 196 } else { 141 197 setTimeout(function () { … … 144 200 //console.log("#REDRAWN PIE: " + val); 145 201 } 146 202 147 203 148 204 } 149 205 function redrawMain() { 206 document.getElementById("graphMain").innerHTML = ""; 207 208 var tempdata = []; 209 var tempnames = []; 210 for (var i = 0; i < dataCollection.length; i++) { 211 var t = dataCollection[i][3][0].slice(); 212 var name = t[0].taskName.substring(0, 5) + " | " + i + ":"; 213 214 for (var v = 0; v < t.length; v++) { 215 t[v].taskName = name; 216 } 217 tempdata = tempdata.concat(t); 218 tempnames = tempnames.concat(name) 219 } 220 var h = (tempnames.length * 20) + 100; 221 document.getElementById("graphMain").style.height = h + "px"; 222 223 var w = $("#graphMain").parent().width() - 100; 224 225 var gantt = d3.gantt().selector("#graphMain").height(h - 50).width(w).taskTypes(tempnames).taskStatus(taskStatus); 226 document.getElementById("graphMain").style.marginLeft = "20px"; 227 gantt(tempdata); 228 /* LINE VERSION 150 229 var temp = []; 151 230 var min = dataCollection[0][1][0][0].x[0]; … … 173 252 } 174 253 Plotly.newPlot('graphMain', temp, layout); 175 176 177 } 254 */ 255 256 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/Scripts/Graphs/GraphHubber.js
r13719 r13733 5 5 $.connection.hub.start().done(function () { 6 6 hubber.server.initConnection(); 7 hubber.server.updateAll();7 // hubber.server.updateAll(); 8 8 redrawMain(); 9 9 }); 10 hubber.client.processData = function (id, data ) {10 hubber.client.processData = function (id, data, name) { 11 11 var obj = JSON.parse(data); 12 12 13 editTaskData(id, obj); 13 saveData(id, obj.StateLog); 14 //console.log(name); 15 saveData(id, obj.StateLog, name); 16 console.log("#UPDATED " + id); 17 } 18 hubber.client.processJobData = function (calc, fin) { 19 editJobData(calc, fin); 14 20 } 15 21 hubber.client.requestDone = function () { 16 17 setTimeout(function () { 18 hubber.server.updateAll(); 19 console.log("#REFRESH ALL"); 20 21 }, 5000); 22 if (document.getElementById("refreshtogg").checked) { 23 setTimeout(function () { 24 hubber.server.updateAll(); 25 console.log("#REFRESH ALL"); 26 27 }, 5000); 28 } 22 29 } 23 30 //hubber.c 24 31 }) 25 32 33 function autoRefresh() { 34 if (document.getElementById("refreshtogg").checked) 35 hubber.server.updateAll(); 36 37 } 38 function restart(id) { 39 document.getElementById("restarterbtn" + id).disabled = true; 40 document.getElementById("restarterbtn" + id).value = "Sending restart request..."; 41 hubber.server.restartTask(id); 42 } 43 function editJobData(c, f) { 44 $("#jobcalculating").html("Calculating: " + c); 45 $("#jobfinished").html("Finished: " + f); 46 } 47 26 48 function editTaskData(id, task) { 27 49 //lastupdate 28 var dat = new Date(task.LastHeartbeat); 29 $("#lastupdpar" + id).html("Last update: " + dat.toUTCString()); 50 if (task.LastHeartbeat != null) { 51 var dat = new Date(task.LastHeartbeat); 52 $("#lastupdpar" + id).html("Last update: " + dat.toUTCString()); 53 } 54 else 55 $("#lastupdpar" + id).html("No updates yet"); 56 //task restarter 57 document.getElementById("restarter" + id).style.display = "none"; 30 58 //state 31 if (task.State == "1") { 59 if (task.State == "0") { 60 $("#statepar" + id).css({ 61 'color': 'gray', 62 'font-weight': 'normal' 63 }); 64 $("#statepar" + id).html("State: Offline"); 65 } 66 else if (task.State == "1") { 32 67 $("#statepar" + id).css({ 33 68 'color': 'white', … … 39 74 $("#statepar" + id).css({ 40 75 'color': 'white', 41 'font-weight': 'normal' 76 'font-weight': 'normal', 77 'text-shadow': '2px 2px black' 42 78 }); 43 79 $("#statepar" + id).html("State: Transferring"); … … 50 86 $("#statepar" + id).html("State: Calculating"); 51 87 } 88 else if (task.State == "4") { 89 $("#statepar" + id).css({ 90 'color': 'white', 91 'font-weight': 'normal' 92 }); 93 $("#statepar" + id).html("State: Paused"); 94 document.getElementById("restarter" + id).style.display = ""; 95 document.getElementById("restarterbtn" + id).disabled = false; 96 document.getElementById("restarterbtn" + id).value = "Restart task"; 97 } 52 98 else if (task.State == "5") { 53 99 $("#statepar" + id).css({ 54 100 'color': '#009900', 55 'font-weight': '900' 101 'font-weight': '900', 102 'text-shadow': '1px 1px black' 56 103 }); 57 104 $("#statepar" + id).html("State: Finished"); 58 var datf = new Date(task.StateLog[task.StateLog.length - 1].DateTime);105 var datf = new Date(task.StateLog[task.StateLog.length - 1].DateTime); 59 106 $("#lastupdpar" + id).html("Finished: " + datf.toUTCString()); 107 } 108 else if (task.State == "6") { 109 $("#statepar" + id).css({ 110 'color': '#e60000', 111 'font-weight': '900', 112 'text-shadow': '1px 1px black' 113 }); 114 $("#statepar" + id).html("State: Aborted"); 115 116 document.getElementById("restarter" + id).style.display = ""; 117 document.getElementById("restarterbtn" + id).disabled = false; 118 document.getElementById("restarterbtn" + id).value = "Restart task"; 60 119 } 61 120 else if (task.State == "7") { 62 121 $("#statepar" + id).css({ 63 'color': '#df2020', 64 'font-weight': '900' 122 'color': '#e60000', 123 'font-weight': '900', 124 'text-shadow': '1px 1px black' 65 125 }); 66 126 $("#statepar" + id).html("State: Failed"); 127 128 document.getElementById("restarter" + id).style.display = ""; 129 document.getElementById("restarterbtn" + id).disabled = false; 130 document.getElementById("restarterbtn" + id).value = "Restart task"; 67 131 } 68 132 69 133 //execution time 70 134 $("#executionpar" + id).html(task.ExecutionTime + " executed"); 135 //exception 136 if (task.StateLog[task.StateLog.length - 1].Exception != null) 137 if (task.StateLog[task.StateLog.length - 1].Exception != "") { 138 $("#exceptionpar" + id).html("Exception: " + task.StateLog[task.StateLog.length - 1].Exception) 139 $("#exceptionpar" + id).css({ 140 'color': '#e60000', 141 'font-weight': '700', 142 'text-shadow': '1px 1px black' 143 }); 144 } 145 else if (task.State == "6") { 146 $("#exceptionpar" + id).html("Task is aborted.") 147 $("#exceptionpar" + id).css({ 148 'color': '#e65c00', 149 'font-weight': '700', 150 'text-shadow': '1px 1px black' 151 }); 152 } 153 else { 154 $("#exceptionpar" + id).html("No exceptions"); 155 $("#exceptionpar" + id).css({ 156 'color': 'white', 157 'text-shadow': '2px 2px black' 158 }); 159 } 160 else { 161 $("#exceptionpar" + id).html("No exceptions"); 162 $("#exceptionpar" + id).css({ 163 'color': 'white', 164 'text-shadow': '2px 2px black' 165 }); 166 } 71 167 //state changes 72 $("#statechangespar" + id).html("Statelogs: " +task.StateLog.length);168 $("#statechangespar" + id).html("Statelogs: " + task.StateLog.length); 73 169 //graph title 74 170 var dat1 = new Date(task.StateLog[0].DateTime); -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/Scripts/hubber.js
r13714 r13733 22 22 function addtoHive() { 23 23 24 var jobname = prompt("Please enter a job name", "Job");24 var jobname = document.getElementById("jname").value; 25 25 if (jobname && jobname != "" && jobname != null) { 26 26 hubber.server.changeName(jobname); … … 29 29 document.getElementById("result").style.display = ""; 30 30 document.getElementById("realhiveadd").click(); 31 } else { 32 alert("Job name not set!"); 31 33 } 32 34 }
Note: See TracChangeset
for help on using the changeset viewer.