You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

new.tmpl 24 kB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. {{template "base/head" .}}
  2. <style>
  3. .train-job-title {
  4. font-family: SourceHanSansSC-medium !important;
  5. color: rgba(16, 16, 16, 100) !important;
  6. font-size: 16px !important;
  7. padding-left: 3rem !important;
  8. }
  9. .min_title{
  10. font-size: 14px !important;
  11. margin-bottom: 2rem !important;
  12. }
  13. .width {
  14. width: 100% !important;
  15. }
  16. .width80 {
  17. width: 80.7% !important;
  18. margin-left: 10px;
  19. }
  20. .width806 {
  21. width: 80.6% !important;
  22. margin-left: -2px;
  23. }
  24. .width85 {
  25. width: 85% !important;
  26. margin-left: 10.5rem !important;
  27. align-items: center;
  28. }
  29. .width81 {
  30. margin-left: 1.5rem !important;
  31. width: 81% !important;
  32. }
  33. .add {
  34. font-size: 18px;
  35. padding: 0.5rem;
  36. border: 1px solid rgba(187, 187, 187, 100);
  37. border-radius: 0px 5px 5px 0px;
  38. line-height: 21px;
  39. text-align: center;
  40. color: #C2C7CC;
  41. }
  42. .min {
  43. font-size: 18px;
  44. padding: 0.5rem;
  45. border: 1px solid rgba(187, 187, 187, 100);
  46. border-radius: 5px 0px 0px 5px;
  47. line-height: 21px;
  48. text-align: center;
  49. color: #C2C7CC;
  50. }
  51. .label-fix-width{
  52. width: 140px !important;
  53. text-align: right;
  54. font-family: SourceHanSansSC-medium !important;
  55. color: rgba(16, 16, 16, 100) !important;
  56. font-size: 14px !important;
  57. }
  58. </style>
  59. <!-- <div class="ui page dimmer">
  60. <div class="ui text loader">{{.i18n.Tr "loading"}}</div>
  61. </div> -->
  62. <div id="mask">
  63. <div id="loadingPage">
  64. <div class="rect1"></div>
  65. <div class="rect2"></div>
  66. <div class="rect3"></div>
  67. <div class="rect4"></div>
  68. <div class="rect5"></div>
  69. </div>
  70. </div>
  71. <div class="repository">
  72. {{template "repo/header" .}}
  73. <div class="ui container">
  74. <div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}" data-queue="{{.QueuesDetail}}" data-queue-start="{{.i18n.Tr "repo.wait_count_start"}}" data-queue-end="{{.i18n.Tr "repo.wait_count_end"}}"></div>
  75. {{template "base/alert" .}}
  76. <h4 class="ui top attached header">
  77. {{.i18n.Tr "repo.modelarts.train_job.new"}}
  78. </h4>
  79. <div class="ui attached segment">
  80. <!-- equal width -->
  81. <form class="ui form" action="{{.Link}}" method="post">
  82. {{.CsrfTokenHtml}}
  83. <input type="hidden" name="action" value="update">
  84. <input type="hidden" id="ai_image_name" value="{{.image}}">
  85. <h4 class="train-job-title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
  86. <div class="required unite min_title inline field">
  87. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_cluster"}}</label>
  88. <div class="ui blue mini menu compact selectcloudbrain">
  89. <a class="active item" href="{{.RepoLink}}/cloudbrain/train-job/create">
  90. <svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg>
  91. {{.i18n.Tr "cloudbrain.resource_cluster_openi"}}
  92. </a>
  93. <a class="item" href="{{.RepoLink}}/grampus/train-job/npu/create">
  94. <svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg>
  95. {{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta)
  96. </a>
  97. </div>
  98. </div>
  99. <div class="required min_title inline field">
  100. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label>
  101. <div class="ui blue mini menu compact selectcloudbrain">
  102. <a class="active item" href="{{.RepoLink}}/cloudbrain/train-job/create">
  103. <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
  104. height="16">
  105. <path fill="none" d="M0 0h24v24H0z" />
  106. <path
  107. d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" />
  108. </svg>
  109. CPU/GPU
  110. </a>
  111. <a class="item" href="{{.RepoLink}}/modelarts/train-job/create">
  112. <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
  113. height="16">
  114. <path fill="none" d="M0 0h24v24H0z" />
  115. <path
  116. d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" />
  117. </svg>
  118. Ascend NPU</a>
  119. </div>
  120. {{template "custom/wait_count_train" Dict "ctx" $ "type" .train_gpu_types}}
  121. </div>
  122. <div class="required min_title inline field">
  123. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
  124. <input style="width: 60%;" name="display_job_name" id="display_job_name"
  125. placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}"
  126. tabindex="3" onkeyup="this.value=this.value.replace(/[, ]/g,'')" autofocus required
  127. maxlength="36">
  128. <span class="tooltips" style="display: block;margin-left: 11.5rem;">{{.i18n.Tr "repo.cloudbrain_jobname_err"}}</span>
  129. </div>
  130. <div class="inline min_title field">
  131. <label class="label-fix-width" style="font-weight: normal;"
  132. for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
  133. {{if .description}}
  134. <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}>{{.description}}</textarea>
  135. {{else}}
  136. <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)"></textarea>
  137. {{end}}
  138. </div>
  139. <div class="ui divider"></div>
  140. <h4 class="train-job-title ui header ">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:</h4>
  141. <div class="required min_title inline field">
  142. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label>
  143. <select class="ui dropdown width80 left2" id="code_version" name="branch_name">
  144. {{if .branch_name}}
  145. <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option>
  146. {{range $k, $v :=.Branches}}
  147. {{ if ne $v $.branch_name }}
  148. <option name="branch_name" value="{{$v}}">{{$v}}</option>
  149. {{end}}
  150. {{end}}
  151. {{else}}
  152. <option name="branch_name" value="{{.branchName}}">{{.branchName}}</option>
  153. {{range $k, $v :=.Branches}}
  154. {{ if ne $v $.branchName }}
  155. <option name="branch_name" value="{{$v}}">{{$v}}</option>
  156. {{end}}
  157. {{end}}
  158. {{end}}
  159. </select>
  160. </div>
  161. <div class="inline required field" style="display: none;">
  162. <label>{{.i18n.Tr "cloudbrain.task_type"}}</label>
  163. <select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px'
  164. name="job_type">
  165. <option name="job_type" value="TRAIN">TRAIN</option>
  166. </select>
  167. </div>
  168. <div class="required min_title inline field">
  169. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label>
  170. <select id="cloudbrain_gpu_type" class="ui search width806 dropdown gpu-type" placeholder="选择GPU类型"
  171. style='width:385px' name="gpu_type">
  172. {{if .gpu_type}}
  173. {{range .train_gpu_types}}
  174. {{if eq $.gpu_type .Queue}}
  175. <option value="{{.Queue}}">{{.Value}}</option>
  176. {{end}}
  177. {{end}}
  178. {{range .train_gpu_types}}
  179. {{if ne $.gpu_type .Queue}}
  180. <option value="{{.Queue}}">{{.Value}}</option>
  181. {{end}}
  182. {{end}}
  183. {{else}}
  184. {{range .train_gpu_types}}
  185. <option value="{{.Queue}}">{{.Value}}</option>
  186. {{end}}
  187. {{end}}
  188. </select>
  189. </div>
  190. <div id="images-new-cb">
  191. </div>
  192. <div class="inline field min_title required">
  193. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label>
  194. {{if .boot_file}}
  195. <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="{{.boot_file}}"
  196. tabindex="3" autofocus required maxlength="255">
  197. {{else}}
  198. <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3"
  199. autofocus required maxlength="255">
  200. {{end}}
  201. <span>
  202. <i class="question circle icon link"
  203. data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}}
  204. data-position="right center" data-variation="mini"></i>
  205. </span>
  206. <a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">查看样例</a>
  207. </div>
  208. <div id="select-multi-dataset">
  209. </div>
  210. <span class="tooltips"
  211. style="margin-left: 11.5rem;margin-bottom: 1rem;">训练脚本存储在/code中,数据集存储在/dataset中,训练输出请存储在/model中以供后续下载。</span>
  212. <div class="inline min_title field">
  213. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label>
  214. <span id="add_run_para"
  215. style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i
  216. class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span>
  217. <input id="store_run_para" type="hidden" name="run_para_list">
  218. <div class="dynamic field" style="margin-top: 1rem;">
  219. {{if ne 0 (len .params)}}
  220. {{range $k ,$v := .params}}
  221. <div class="two fields width85" id="para{{$k}}">
  222. <div class="field">
  223. <input type="text" name="shipping_first-name" value={{$v.Label}} required>
  224. </div>
  225. <div class="field">
  226. <input type="text" name="shipping_last-name" value={{$v.Value}} required>
  227. </div>
  228. <span>
  229. <i class="trash icon"></i>
  230. </span>
  231. </div>
  232. {{end}}
  233. {{end}}
  234. </div>
  235. </div>
  236. <div class="required min_title inline field">
  237. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label>
  238. <select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="选择资源规格"
  239. style='width:385px' name="resource_spec_id">
  240. {{if .resource_spec_id}}
  241. {{range .train_resource_specs}}
  242. {{if eq $.resource_spec_id .Id}}
  243. <option value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
  244. {{end}}
  245. {{end}}
  246. {{range .train_resource_specs}}
  247. {{if ne $.resource_spec_id .Id}}
  248. <option value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
  249. {{end}}
  250. {{end}}
  251. {{else}}
  252. {{range .train_resource_specs}}
  253. <option name="resource_spec_id" value="{{.Id}}">
  254. GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
  255. {{end}}
  256. {{end}}
  257. </select>
  258. </div>
  259. <div class="inline field" style="padding: 1rem 0;">
  260. <label class="label-fix-width"></label>
  261. <button class="ui create_train_job green button">
  262. {{.i18n.Tr "repo.cloudbrain.new"}}
  263. </button>
  264. <a class="ui button"
  265. href="{{.RepoLink}}/modelarts/train-job">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  266. </div>
  267. <!-- 模态框 -->
  268. </form>
  269. </div>
  270. </div>
  271. </div>
  272. {{template "base/footer" .}}
  273. <script>
  274. $('select.dropdown')
  275. .dropdown();
  276. $('.menu .item')
  277. .tab();
  278. $(document).keydown(function(event){
  279. switch(event.keyCode){
  280. case 13:return false;
  281. }
  282. });
  283. let sever_num = $('#trainjob_work_server_num')
  284. $('.add').click(function () {
  285. sever_num.val(parseInt(sever_num.val()) + 1)
  286. if (sever_num.val() >= 26) {
  287. sever_num.val(parseInt(sever_num.val()) - 1)
  288. }
  289. })
  290. $('.min').click(function () {
  291. sever_num.val(parseInt(sever_num.val()) - 1)
  292. if (sever_num.val() <= 0) {
  293. sever_num.val(parseInt(sever_num.val()) + 1)
  294. }
  295. })
  296. // 参数增加、删除、修改、保存
  297. function Add_parameter(i) {
  298. value = '<div class="two fields width85" id= "para' + i + '">' +
  299. '<div class="field">' +
  300. '<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' +
  301. '</div> ' +
  302. '<div class="field"> ' +
  303. '<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' +
  304. '</div>' +
  305. '<span>' +
  306. '<i class="trash icon">' +
  307. '</i>' +
  308. '</span>' +
  309. '</div>'
  310. $(".dynamic.field").append(value)
  311. }
  312. $('#add_run_para').click(function () {
  313. var len = $(".dynamic.field .two.fields").length
  314. Add_parameter(len)
  315. });
  316. $(".dynamic.field").on("click", ".trash.icon", function () {
  317. var index = $(this).parent().parent().index()
  318. $(this).parent().parent().remove()
  319. var len = $(".dynamic.field .two.fields").length
  320. $(".dynamic.field .two.fields").each(function () {
  321. var cur_index = $(this).index()
  322. $(this).attr('id', 'para' + cur_index)
  323. })
  324. });
  325. $('.ui.parameter.green.button').click(function () {
  326. var parameters = [];
  327. $('table tr').each(function () {
  328. $(this).find('td:eq(1)').each(function () {
  329. parameters.push($(this).text());
  330. })
  331. $(this).find('input').each(function () {
  332. parameters.push($(this).text())
  333. })
  334. });
  335. $('.ui.parameter.modal')
  336. .modal('hide');
  337. for (var i = 2; i < parameters.length; i++) {
  338. switch (i) {
  339. // 数据集uuid待完成
  340. // case (2):
  341. // console.log(1)
  342. // break;
  343. // $("#trainjob_datasets").val(parameters[i]);
  344. // console.log($("#trainjob_datasets").val())
  345. case (3):
  346. $("input[name='boot_file']").val(parameters[i]);
  347. break;
  348. case (4):
  349. var para = parameters[i].split(" ")
  350. for (var j = 0; j < para.length; j++) {
  351. var para_name = para[j].split('=')[0]
  352. var para_value = para[j].split('=')[1]
  353. var len = $(".dynamic.field .two.fields").length
  354. Add_parameter(len)
  355. var pid = 'para' + len
  356. $(".dynamic.field" + " #" + pid + "").find("input[name=shipping_first-name]").val(para_name)
  357. $(".dynamic.field" + " #" + pid + "").find("input[name=shipping_last-name]").val(para_value)
  358. }
  359. break;
  360. // 数据集pool_id待完成
  361. // case (5):
  362. // $("select[name='pool_id']").val(parameters[i]);
  363. // break;
  364. case (6):
  365. $("input[name='work_server_number']").val(parameters[i]);
  366. break;
  367. }
  368. }
  369. })
  370. $('.ui.save.checkbox').click(function () {
  371. $(this).checkbox({
  372. onChange: function () {
  373. if ($('.ui.save.checkbox').checkbox('is checked')) {
  374. $('#save_para').removeClass("disabled")
  375. } else {
  376. $('#save_para').addClass("disabled")
  377. }
  378. }
  379. });
  380. })
  381. $('.question.circle.icon').hover(function () {
  382. $(this).popup('show')
  383. });
  384. $(".item.active.parameter_config").click(function () {
  385. $('.ui.parameter.modal')
  386. .modal('setting', 'closable', false)
  387. .modal('show');
  388. })
  389. $('.ui.deny.button').click(function () {
  390. $('.ui.parameter.modal')
  391. .modal('hide');
  392. })
  393. $('select.dropdown')
  394. .dropdown();
  395. function validate() {
  396. $('.ui.form')
  397. .form({
  398. on: 'blur',
  399. fields: {
  400. boot_file: {
  401. identifier: 'boot_file',
  402. rules: [
  403. {
  404. type: 'regExp[/.+\.py$/g]',
  405. }
  406. ]
  407. },
  408. display_job_name: {
  409. identifier: 'display_job_name',
  410. rules: [
  411. {
  412. type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]',
  413. }
  414. ]
  415. },
  416. attachment: {
  417. identifier: 'attachment',
  418. rules: [
  419. {
  420. type: 'empty',
  421. }
  422. ]
  423. },
  424. work_server_number: {
  425. identifier: 'work_server_number',
  426. rules: [
  427. {
  428. type: 'integer[1..25]',
  429. }
  430. ]
  431. },
  432. branch_name: {
  433. identifier: 'branch_name',
  434. rules: [
  435. {
  436. type: 'empty',
  437. }
  438. ]
  439. }
  440. },
  441. onSuccess: function () {
  442. // $('.ui.page.dimmer').dimmer('show')
  443. document.getElementById("mask").style.display = "block"
  444. },
  445. onFailure: function (e) {
  446. return false;
  447. }
  448. })
  449. }
  450. document.onreadystatechange = function () {
  451. if (document.readyState === "complete") {
  452. document.getElementById("mask").style.display = "none"
  453. }
  454. }
  455. function send_run_para() {
  456. var run_parameters = []
  457. var msg = {}
  458. $(".dynamic.field .two.fields").each(function () {
  459. var para_name = $(this).find('input[name=shipping_first-name]').val()
  460. var para_value = $(this).find('input[name=shipping_last-name]').val()
  461. run_parameters.push({ "label": para_name, "value": para_value })
  462. })
  463. msg["parameter"] = run_parameters
  464. msg = JSON.stringify(msg)
  465. $('#store_run_para').val(msg)
  466. }
  467. validate();
  468. $('.ui.create_train_job.green.button').click(function (e) {
  469. send_run_para()
  470. })
  471. </script>