[13862] | 1 | @using HeuristicLab.Clients.Hive.WebJobManager.ViewModels;
|
---|
| 2 | @using Newtonsoft.Json;
|
---|
| 3 | @model OkbManagementVM
|
---|
| 4 | <div id="userId" style="display:none">@ViewBag.SessionId</div>
|
---|
| 5 | <script src="~/js/hubs/okbmanagerhubber.js"></script>
|
---|
[13871] | 6 | <div ng-app="wjmokbmanager" ng-controller="okbmanangerCtrl" id="controllerdiv" class="animated fadeIn" ng-init="init()">
|
---|
[13862] | 7 |
|
---|
| 8 |
|
---|
| 9 | @Html.Partial("Navbar", new NavbarViewModel("OKBAdmin", Model.User))
|
---|
[13871] | 10 | @if (ViewBag.Success != null && ViewBag.Success)
|
---|
| 11 | {
|
---|
[13862] | 12 |
|
---|
[13871] | 13 | @Html.Partial("_SuccessMessage", Model.message)
|
---|
| 14 | }
|
---|
| 15 | else
|
---|
| 16 | {
|
---|
| 17 | @Html.Partial("_ErrorMessage", Model.message)
|
---|
[13862] | 18 |
|
---|
[13871] | 19 | }
|
---|
| 20 |
|
---|
| 21 |
|
---|
[13862] | 22 | <ul class="nav nav-pills nav-justified">
|
---|
| 23 |
|
---|
| 24 | <li role="presentation"
|
---|
| 25 | ng-class="{active: currentData.name === 'Platforms'}">
|
---|
[13871] | 26 | <a ng-click="selectDataCat('platforms')" href="">
|
---|
| 27 | Platforms
|
---|
| 28 | </a>
|
---|
[13862] | 29 | </li>
|
---|
| 30 | <li role="presentation"
|
---|
| 31 | ng-class="{active: currentData.name === 'Algorithm classes'}">
|
---|
| 32 | <a ng-click="selectDataCat('algoclass')" href="">
|
---|
| 33 | Algorithm classes
|
---|
| 34 | </a>
|
---|
| 35 | </li>
|
---|
| 36 | <li role="presentation"
|
---|
| 37 | ng-class="{active: currentData.name === 'Algorithms'}">
|
---|
| 38 | <a ng-click="selectDataCat('algos')" href="">
|
---|
| 39 | Algorithms
|
---|
| 40 | </a>
|
---|
| 41 | </li>
|
---|
| 42 | <li role="presentation"
|
---|
| 43 | ng-class="{active: currentData.name === 'Problem classes'}">
|
---|
| 44 | <a ng-click="selectDataCat('probclass')" href="">
|
---|
| 45 | Problem classes
|
---|
| 46 | </a>
|
---|
| 47 | </li>
|
---|
| 48 | <li role="presentation"
|
---|
| 49 | ng-class="{active: currentData.name === 'Problems'}">
|
---|
| 50 | <a ng-click="selectDataCat('problems')" href="">
|
---|
[13871] | 51 | Problems
|
---|
[13862] | 52 | </a>
|
---|
| 53 | </li>
|
---|
| 54 | </ul>
|
---|
[13871] | 55 | <div class="row animated fadeIn" style="padding:10px">
|
---|
| 56 | <div class="col-sm-4" ng-if="currentData.name != ''" style="padding-left:15px">
|
---|
| 57 | <div class="btn-group btn-group-justified btn-block"
|
---|
| 58 | role="group" style="margin-bottom:-4px">
|
---|
| 59 | <a class="btn btn-info btn-lg disabled"
|
---|
| 60 | 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);
|
---|
| 61 | text-shadow:2px 2px black;">
|
---|
| 62 | <i class="fa fa-list"></i> {{currentData.name}}
|
---|
| 63 | </a>
|
---|
| 64 | <a class="btn btn-success"
|
---|
| 65 | ng-class="{active: currentData.data.selected.Id === -1}"
|
---|
| 66 | style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
---|
| 67 | text-shadow:2px 2px black;"
|
---|
| 68 | ng-click="selectDataMember(null)">
|
---|
| 69 | <i class="fa fa-plus-circle"></i>
|
---|
| 70 | </a>
|
---|
| 71 | </div>
|
---|
| 72 | <div class="btn-group-vertical btn-block">
|
---|
| 73 | <a class="btn btn-default"
|
---|
| 74 | ng-repeat="dat in currentData.data.arr track by $index"
|
---|
| 75 | ng-class="{active: currentData.data.selected.Id === dat.Id}"
|
---|
| 76 | style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); overflow:hidden"
|
---|
| 77 | ng-click="selectDataMember($index)">
|
---|
| 78 | {{dat.Name}}
|
---|
| 79 | </a>
|
---|
| 80 | </div>
|
---|
| 81 | </div>
|
---|
| 82 | <!--NOTIFICATIONS-->
|
---|
| 83 | <div class="alert alert-success" id="success-alert" style="display:flex">
|
---|
| 84 | <span id="succText"></span>
|
---|
| 85 | </div>
|
---|
| 86 | <!--Panel-->
|
---|
| 87 | <div class="col-sm-8 animated fadeIn" ng-if="currentData.name != ''"
|
---|
| 88 | id="content"
|
---|
| 89 | style="padding:5px; padding-left:10px;">
|
---|
| 90 | <div class="panel panel-primary"
|
---|
| 91 | style="border-width:2px!important;
|
---|
| 92 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
|
---|
| 93 | <div class="panel-heading" style="padding:15px">
|
---|
| 94 | <!--Title for new algo class and problem class-->
|
---|
| 95 | <h1 ng-if="currentData.data.selected.Id === -1 && currentData.name.length > 11">Add new {{currentData.name.slice(0,-2) | lowercase}}</h1>
|
---|
| 96 | <!--Title for new others-->
|
---|
| 97 | <h1 ng-if="currentData.data.selected.Id === -1 && currentData.name.length < 11">Add new {{currentData.name.slice(0,-1) | lowercase}}</h1>
|
---|
| 98 | <!--Title for existing member-->
|
---|
| 99 | <h1 ng-if="currentData.data.selected.Id != -1"> {{currentData.data.selected.Name}}</h1>
|
---|
| 100 | </div>
|
---|
| 101 | <div class="panel-body" style="padding:10px">
|
---|
| 102 | <div class="form-group" style="padding-bottom:30px">
|
---|
[13862] | 103 |
|
---|
[13871] | 104 | <label for="inpusername"
|
---|
| 105 | class="col-sm-3 control-label">
|
---|
| 106 | Name
|
---|
| 107 | </label>
|
---|
| 108 | <div class="col-sm-8">
|
---|
| 109 | <input type="text"
|
---|
| 110 | class="form-control"
|
---|
| 111 | id="inpusername"
|
---|
| 112 | name="inpusername"
|
---|
| 113 | placeholder="Name"
|
---|
| 114 | ng-model="currentData.data.selected.Name">
|
---|
| 115 | </div>
|
---|
| 116 | </div>
|
---|
| 117 | <div class="form-group">
|
---|
| 118 |
|
---|
| 119 | <label for="inpdesc"
|
---|
| 120 | class="col-sm-3 control-label">
|
---|
| 121 | Description
|
---|
| 122 | </label>
|
---|
| 123 | <div class="col-sm-8">
|
---|
| 124 | <textarea style="resize:vertical"
|
---|
| 125 | class="form-control"
|
---|
| 126 | id="inpdesc"
|
---|
| 127 | name="inpdesc"
|
---|
| 128 | placeholder="Description"
|
---|
| 129 | ng-model="currentData.data.selected.Description"></textarea>
|
---|
| 130 | </div>
|
---|
| 131 |
|
---|
| 132 | </div>
|
---|
| 133 | <!-- PLATFORM-->
|
---|
| 134 | <div class="form-group"
|
---|
| 135 | style="padding-top:30px"
|
---|
| 136 | ng-if="currentData.type != 'ND'">
|
---|
| 137 |
|
---|
| 138 | <label for="inpplat"
|
---|
| 139 | class="col-sm-3 control-label">
|
---|
| 140 | Platform
|
---|
| 141 | </label>
|
---|
| 142 | <div class="col-sm-8">
|
---|
| 143 | <select class="form-control"
|
---|
| 144 | id="inpplat"
|
---|
| 145 | name="inpplat"
|
---|
| 146 | ng-model="currentData.data.selected.PlatformId"
|
---|
| 147 | ng-options="plat.Id as plat.Name for plat in platforms.arr"></select>
|
---|
| 148 | </div>
|
---|
| 149 |
|
---|
| 150 | </div>
|
---|
| 151 | <!--ALGO CLASS-->
|
---|
| 152 | <div class="form-group"
|
---|
| 153 | style="padding-top:30px"
|
---|
| 154 | ng-if="currentData.type === 'ALG'">
|
---|
| 155 | <label for="inpplat"
|
---|
| 156 | class="col-sm-3 control-label">
|
---|
| 157 | Algorithm Class
|
---|
| 158 | </label>
|
---|
| 159 | <div class="col-sm-8">
|
---|
| 160 | <select class="form-control"
|
---|
| 161 | id="inpplat"
|
---|
| 162 | name="inpplat"
|
---|
| 163 | ng-model="currentData.data.selected.AlgorithmClassId"
|
---|
| 164 | ng-options="alg.Id as alg.Name for alg in algoclass.arr"></select>
|
---|
| 165 | </div>
|
---|
| 166 |
|
---|
| 167 | </div>
|
---|
| 168 | <!--PROBLEM CLASS-->
|
---|
| 169 | <div class="form-group"
|
---|
| 170 | style="padding-top:30px"
|
---|
| 171 | ng-if="currentData.type === 'PROB'">
|
---|
| 172 | <label for="inpplat"
|
---|
| 173 | class="col-sm-3 control-label">
|
---|
| 174 | Problem Class
|
---|
| 175 | </label>
|
---|
| 176 | <div class="col-sm-8">
|
---|
| 177 | <select class="form-control"
|
---|
| 178 | id="inpplat"
|
---|
| 179 | name="inpplat"
|
---|
| 180 | ng-model="currentData.data.selected.ProblemClassId"
|
---|
| 181 | ng-options="prob.Id as prob.Name for prob in probclass.arr"></select>
|
---|
| 182 | </div>
|
---|
| 183 |
|
---|
| 184 | </div>
|
---|
| 185 | <!--DATA TYPE-->
|
---|
| 186 |
|
---|
| 187 | </div>
|
---|
| 188 | <div class="panel-body"
|
---|
| 189 | ng-if="currentData.data.selected.Id != -1">
|
---|
| 190 | <div class="row" ng-if="currentData.type != 'ND'" style="padding:20px;padding-top:0">
|
---|
| 191 | <h3>Data type</h3>
|
---|
| 192 | <div class="form-group"
|
---|
| 193 | style="padding-top:10px">
|
---|
| 194 | <label class="col-sm-3 control-label">
|
---|
| 195 | Name
|
---|
| 196 | </label>
|
---|
| 197 | <div class="col-sm-8">
|
---|
| 198 | <input type="text"
|
---|
| 199 | class="form-control"
|
---|
| 200 | disabled
|
---|
| 201 | ng-model="currentData.data.selected.DataTypeName">
|
---|
| 202 | </div>
|
---|
| 203 |
|
---|
| 204 | </div>
|
---|
| 205 | <div class="form-group"
|
---|
| 206 | style="padding-top:30px">
|
---|
| 207 | <label class="col-sm-3 control-label">
|
---|
| 208 | Type Name
|
---|
| 209 | </label>
|
---|
| 210 | <div class="col-sm-8">
|
---|
| 211 | <input type="text"
|
---|
| 212 | class="form-control"
|
---|
| 213 | disabled
|
---|
| 214 | ng-model="currentData.data.selected.DataTypeTypeName">
|
---|
| 215 | </div>
|
---|
| 216 |
|
---|
| 217 | </div>
|
---|
| 218 | </div>
|
---|
| 219 | <form method="post"
|
---|
| 220 | asp-action="Uploader"
|
---|
| 221 | asp-controller="OkbManagement" enctype="multipart/form-data">
|
---|
| 222 | <input onchange="printFile()"
|
---|
| 223 | type="file"
|
---|
| 224 | id="fileupl"
|
---|
| 225 | name="fileupl"
|
---|
| 226 | accept=".hl"
|
---|
| 227 | style="display:none" />
|
---|
| 228 | <div onclick="firefilebutton()"
|
---|
| 229 | class="btn btn-info"
|
---|
| 230 | id="uplbutt"
|
---|
| 231 | style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
---|
| 232 | text-shadow:1px 1px black;">
|
---|
| 233 | <i class="fa fa-folder-open-o"></i> Choose new file
|
---|
| 234 | </div>
|
---|
| 235 |
|
---|
| 236 | <input type="submit" class="btn btn-primary" id="upl" disabled value="Upload" />
|
---|
| 237 | <input type="text"
|
---|
| 238 | id="name"
|
---|
| 239 | name="name"
|
---|
| 240 | value="{{currentData.name }}"
|
---|
| 241 | style="display:none" />
|
---|
| 242 | <input type="text"
|
---|
| 243 | id="id"
|
---|
| 244 | name="id"
|
---|
| 245 | value="{{currentData.data.selected.Id }}"
|
---|
| 246 | style="display:none" />
|
---|
| 247 | <script type="text/javascript">
|
---|
| 248 | function firefilebutton() {
|
---|
| 249 | document.getElementById("fileupl").click();
|
---|
| 250 |
|
---|
| 251 |
|
---|
| 252 | }
|
---|
| 253 | function printFile() {
|
---|
| 254 | var files = document.getElementById("fileupl").files;
|
---|
| 255 | if (files.length > 0) {
|
---|
| 256 | document.getElementById("upl").disabled = false;
|
---|
| 257 |
|
---|
| 258 | for (var i = 0; i < files.length; i++) {
|
---|
| 259 | document.getElementById("uplbutt").innerHTML = files[i].name + " selected";
|
---|
| 260 | }
|
---|
| 261 | }
|
---|
| 262 | }
|
---|
| 263 |
|
---|
| 264 |
|
---|
| 265 | </script>
|
---|
| 266 | </form>
|
---|
| 267 | </div>
|
---|
| 268 | <div class="panel-footer" style="height:60px">
|
---|
| 269 | <div class="col-sm-3">
|
---|
| 270 | <a class="btn btn-success btn-block"
|
---|
| 271 | style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
---|
| 272 | text-shadow:2px 2px black;"
|
---|
| 273 | ng-if="currentData.data.selected.Id != -1"
|
---|
| 274 | ng-click="saveCurrent()">
|
---|
| 275 | <i class="fa fa-save"></i> Save
|
---|
| 276 | </a>
|
---|
| 277 | <a class="btn btn-success btn-block"
|
---|
| 278 | style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
---|
| 279 | text-shadow:2px 2px black;"
|
---|
| 280 | ng-if="currentData.data.selected.Id === -1"
|
---|
| 281 | ng-click="saveCurrent()">
|
---|
| 282 | <i class="fa fa-plus-circle"></i> Add
|
---|
| 283 | </a>
|
---|
| 284 | </div>
|
---|
| 285 | <div class="col-sm-offset-6 col-sm-3">
|
---|
| 286 | <a class="btn btn-danger btn-block"
|
---|
| 287 | style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
---|
| 288 | text-shadow:2px 2px black;"
|
---|
| 289 | ng-if="currentData.data.selected.Id != -1"
|
---|
| 290 | ng-click="deleteCurrent()">
|
---|
| 291 | <i class="fa fa-trash-o"></i> Delete
|
---|
| 292 | </a>
|
---|
| 293 | </div>
|
---|
| 294 | </div>
|
---|
| 295 |
|
---|
| 296 |
|
---|
| 297 |
|
---|
| 298 | </div>
|
---|
| 299 | </div>
|
---|
| 300 |
|
---|
| 301 | </div>
|
---|
| 302 |
|
---|
[13862] | 303 | <script type="text/javascript">
|
---|
| 304 | window.onload = function (){
|
---|
| 305 | var vm = angular.element(document.getElementById('controllerdiv')).scope();
|
---|
| 306 | console.log(vm);
|
---|
| 307 | vm.initData(@Html.Raw(JsonConvert.SerializeObject(Model.client.Platforms)), "platforms");
|
---|
| 308 | vm.initData(@Html.Raw(JsonConvert.SerializeObject(Model.client.AlgorithmClasses)), "algoclass");
|
---|
| 309 | vm.initData(@Html.Raw(JsonConvert.SerializeObject(Model.client.ProblemClasses)), "probclass");
|
---|
| 310 | vm.initData(@Html.Raw(JsonConvert.SerializeObject(Model.client.Algorithms)), "algos");
|
---|
| 311 | vm.initData(@Html.Raw(JsonConvert.SerializeObject(Model.client.Problems)), "problems");
|
---|
| 312 | }
|
---|
| 313 | </script>
|
---|
| 314 | </div>
|
---|