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
4 years ago
3 years ago
3 years ago
4 years ago
4 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
4 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
4 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
4 years ago
3 years ago
4 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
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 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
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  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. .width48{
  17. width: 48.5% !important;
  18. }
  19. .width80{
  20. width: 80.7% !important;
  21. margin-left: 10px;
  22. }
  23. .width85{
  24. width: 85% !important;
  25. margin-left: 10.5rem !important;
  26. align-items: center;
  27. }
  28. .width81{
  29. margin-left: 1.5rem;
  30. width: 81% !important;
  31. }
  32. .add{font-size: 18px;
  33. padding: 0.5rem;
  34. border: 1px solid rgba(187, 187, 187, 100);
  35. border-radius: 0px 5px 5px 0px;
  36. line-height: 21px;
  37. text-align: center;
  38. color: #C2C7CC;
  39. }
  40. .min{
  41. font-size: 18px;
  42. padding: 0.5rem;
  43. border: 1px solid rgba(187, 187, 187, 100);
  44. border-radius: 5px 0px 0px 5px;
  45. line-height: 21px;
  46. text-align: center;
  47. color: #C2C7CC;
  48. }
  49. .label-fix-width{
  50. width: 140px !important;
  51. text-align: right;
  52. font-family: SourceHanSansSC-medium !important;
  53. color: rgba(16, 16, 16, 100) !important;
  54. font-size: 14px !important;
  55. }
  56. </style>
  57. <!-- <div class="ui page dimmer">
  58. <div class="ui text loader">{{.i18n.Tr "loading"}}</div>
  59. </div> -->
  60. <div id="mask">
  61. <div id="loadingPage">
  62. <div class="rect1"></div>
  63. <div class="rect2"></div>
  64. <div class="rect3"></div>
  65. <div class="rect4"></div>
  66. <div class="rect5"></div>
  67. </div>
  68. </div>
  69. <div class="repository">
  70. {{template "repo/header" .}}
  71. <div class="ui container">
  72. <div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}"></div>
  73. {{template "base/alert" .}}
  74. <h4 class="ui top attached header">
  75. {{.i18n.Tr "repo.modelarts.train_job.new"}}
  76. </h4>
  77. <div class="ui attached segment">
  78. <!-- equal width -->
  79. <form class="ui form" action="{{.Link}}" method="post">
  80. {{.CsrfTokenHtml}}
  81. <input type="hidden" name="action" value="update">
  82. <input type="hidden" id="ai_engine_name" name="engine_names" value="">
  83. <input type="hidden" id="ai_flaver_name" name="flaver_names" value="">
  84. <h4 class="train-job-title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
  85. <div class="required min_title inline field">
  86. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_cluster"}}</label>
  87. <div class="ui blue mini menu compact selectcloudbrain">
  88. <a class="active item" href="{{.RepoLink}}/cloudbrain/train-job/create">
  89. <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>
  90. {{.i18n.Tr "cloudbrain.resource_cluster_openi"}}
  91. </a>
  92. <a class="item" href="{{.RepoLink}}/grampus/train-job/npu/create">
  93. <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>
  94. {{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta)
  95. </a>
  96. </div>
  97. </div>
  98. <div class="required inline min_title field">
  99. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label>
  100. <div class="ui blue mini menu compact selectcloudbrain">
  101. <a class="item" href="{{.RepoLink}}/cloudbrain/train-job/create">
  102. <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
  103. height="16">
  104. <path fill="none" d="M0 0h24v24H0z" />
  105. <path
  106. 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" />
  107. </svg>
  108. CPU/GPU
  109. </a>
  110. <a class="active item" href="{{.RepoLink}}/modelarts/train-job/create">
  111. <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16"
  112. height="16">
  113. <path fill="none" d="M0 0h24v24H0z" />
  114. <path
  115. 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" />
  116. </svg>
  117. Ascend NPU</a>
  118. </div>
  119. {{template "custom/wait_count_train" Dict "ctx" $}}
  120. </div>
  121. <div class="required inline min_title field">
  122. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
  123. <input style="width: 60%;" name="display_job_name" id="display_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" tabindex="3" onkeyup="this.value=this.value.replace(/[, ]/g,'')" autofocus required maxlength="64">
  124. <span class="tooltips" style="margin-left:11.5rem;display: block;">{{.i18n.Tr "cloudbrain.job_name_rule"}}</span>
  125. </div>
  126. <div class="inline min_title field">
  127. <label class="label-fix-width" style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
  128. <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>
  129. </div>
  130. <div class="ui divider"></div>
  131. <h4 class="train-job-title ui header ">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:</h4>
  132. <div class="required inline min_title field">
  133. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label>
  134. <select class="ui dropdown width80 left2" id="code_version" name="branch_name">
  135. {{if .branch_name}}
  136. <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option>
  137. {{range $k, $v :=.Branches}}
  138. {{ if ne $v $.branch_name }}
  139. <option name="branch_name" value="{{$v}}">{{$v}}</option>
  140. {{end}}
  141. {{end}}
  142. {{else}}
  143. <option name="branch_name" value="{{.branchName}}">{{.branchName}}</option>
  144. {{range $k, $v :=.Branches}}
  145. {{ if ne $v $.branchName }}
  146. <option name="branch_name" value="{{$v}}">{{$v}}</option>
  147. {{end}}
  148. {{end}}
  149. {{end}}
  150. </select>
  151. </div>
  152. <div class="required inline min_title fields" style="width: 95%;">
  153. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.AI_driver"}}</label>
  154. <div class="field" style="flex: 1.5;">
  155. <select class="ui dropdown width" id="trainjob_engines">
  156. {{range .engines}}
  157. <option value="{{.Value}}">{{.Value}}</option>
  158. {{end}}
  159. </select>
  160. </div>
  161. <div class="field" style="flex: 2;" id="engine_name">
  162. <select class="ui dropdown width" id="trainjob_engine_versions" name="engine_id">
  163. {{range .engine_versions}}
  164. <option name="engine_id" value="{{.ID}}">{{.Value}}</option>
  165. {{end}}
  166. </select>
  167. </div>
  168. </div>
  169. <div class="inline field min_title required">
  170. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label>
  171. {{if .bootFile}}
  172. <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" tabindex="3" autofocus required maxlength="255" >
  173. {{else}}
  174. <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" autofocus required maxlength="255" >
  175. {{end}}
  176. <span>
  177. <i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i>
  178. </span>
  179. <a href="https://git.openi.org.cn/OpenIOSSG/MINIST_Example" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
  180. </div>
  181. <div id="select-multi-dataset">
  182. </div>
  183. <span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;">{{.i18n.Tr "cloudbrain.dataset_path_rule"}}</span>
  184. <div class="inline min_title field">
  185. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label>
  186. <span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span>
  187. <input id="store_run_para" type="hidden" name="run_para_list">
  188. <div class="dynamic field" style="margin-top: 1rem;">
  189. {{if ne 0 (len .params)}}
  190. {{range $k ,$v := .params}}
  191. <div class="two fields width85" id="para{{$k}}">
  192. <div class="field">
  193. <input type="text" name="shipping_first-name" value={{$v.Label}} required>
  194. </div>
  195. <div class="field">
  196. <input type="text" name="shipping_last-name" value={{$v.Value}} required>
  197. </div>
  198. <span>
  199. <i class="trash icon"></i>
  200. </span>
  201. </div>
  202. {{end}}
  203. {{end}}
  204. </div>
  205. </div>
  206. <div class="required min_title field " style="display: none;">
  207. <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.resource_pool"}}</label>
  208. <select class="ui dropdown" id="trainjob_resource_pool" style='width:385px' name="pool_id">
  209. {{range .resource_pools}}
  210. <option value="{{.ID}}">{{.Value}}</option>
  211. {{end}}
  212. </select>
  213. </div>
  214. <div class="required grouped fields" style="display: none;">
  215. <label style="font-weight: normal;"
  216. for="resource_type">{{.i18n.Tr "repo.modelarts.train_job.resource_type"}}</label>
  217. <div class="field">
  218. <div class="ui grid">
  219. <div class="column">
  220. <div class="ui radio checkbox">
  221. <input type="radio" name="resource_type" checked="" tabindex="0">
  222. </div>
  223. </div>
  224. <div class="three wide column">train-private-1</div>
  225. <div class="three wide column">{{svg "octicon-verified" 16}} 运行中</div>
  226. <div class="three wide column"> CPU:192 核 2048GiB</div>
  227. </div>
  228. </div>
  229. </div>
  230. <div class="required inline min_title field" id="flaver_name">
  231. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label>
  232. <select class="ui dropdown width48" id="trainjob-flavor" name="flavor">
  233. {{range .flavor_infos}}
  234. <option name="flavor" value="{{.Code}}">{{.Value}}</option>
  235. {{end}}
  236. </select>
  237. </div>
  238. <div class="inline required min_title field">
  239. <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}}</label>
  240. <div class="ui labeled input" style="width: 5%;">
  241. <input style="border-radius: 0;text-align: center;" type="hidden" name="work_server_number"
  242. id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255" value="1"
  243. readonly>
  244. <div class="field" id="trainjob_work_server_num_select" name="work_server_number_select">
  245. <select class="ui dropdown width" style='width: 100%;' name="work_server_id">
  246. <option name="server_id" value="1">1</option>
  247. </select>
  248. </div>
  249. </div>
  250. </div>
  251. <div class="inline field" style="padding: 1rem 0;">
  252. <label class="label-fix-width"></label>
  253. <button class="ui create_train_job green button">
  254. {{.i18n.Tr "repo.cloudbrain.new"}}
  255. </button>
  256. <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
  257. </div>
  258. <!-- 模态框 -->
  259. </form>
  260. </div>
  261. </div>
  262. </div>
  263. {{template "base/footer" .}}
  264. <script>
  265. let url_href = window.location.pathname.split('create')[0]
  266. $(".ui.button").attr('href', url_href)
  267. $('select.dropdown')
  268. .dropdown();
  269. $('.menu .item')
  270. .tab();
  271. $(document).keydown(function(event){
  272. switch(event.keyCode){
  273. case 13:return false;
  274. }
  275. });
  276. // let sever_num = $("#trainjob_work_server_num_select .text").text() //$('#trainjob_work_server_num')
  277. // console.log("sever_num:",sever_num)
  278. // $('.add').click(function(){
  279. // sever_num.val(parseInt(sever_num.val())+1)
  280. // if(sever_num.val()>=26){
  281. // sever_num.val(parseInt(sever_num.val())-1)
  282. // }
  283. // })
  284. // $('.min').click(function(){
  285. // sever_num.val(parseInt(sever_num.val())-1)
  286. // if(sever_num.val()<=0){
  287. // sever_num.val(parseInt(sever_num.val())+1)
  288. // }
  289. // })
  290. // 参数增加、删除、修改、保存
  291. function Add_parameter(i) {
  292. value = '<div class="two fields width85" id= "para' + i + '">' +
  293. '<div class="field">' +
  294. '<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' +
  295. '</div> ' +
  296. '<div class="field"> ' +
  297. '<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' +
  298. '</div>' +
  299. '<span>' +
  300. '<i class="trash icon">' +
  301. '</i>' +
  302. '</span>' +
  303. '</div>'
  304. $(".dynamic.field").append(value)
  305. }
  306. $('#add_run_para').click(function () {
  307. var len = $(".dynamic.field .two.fields").length
  308. Add_parameter(len)
  309. });
  310. $(".dynamic.field").on("click", ".trash.icon", function () {
  311. var index = $(this).parent().parent().index()
  312. $(this).parent().parent().remove()
  313. var len = $(".dynamic.field .two.fields").length
  314. $(".dynamic.field .two.fields").each(function () {
  315. var cur_index = $(this).index()
  316. $(this).attr('id', 'para' + cur_index)
  317. })
  318. });
  319. $('.ui.parameter.green.button').click(function () {
  320. var parameters = [];
  321. $('table tr').each(function () {
  322. $(this).find('td:eq(1)').each(function () {
  323. parameters.push($(this).text());
  324. })
  325. $(this).find('input').each(function () {
  326. parameters.push($(this).text())
  327. })
  328. });
  329. $('.ui.parameter.modal')
  330. .modal('hide');
  331. for (var i = 2; i < parameters.length; i++) {
  332. switch (i) {
  333. // 数据集uuid待完成
  334. // case (2):
  335. // console.log(1)
  336. // break;
  337. // $("#trainjob_datasets").val(parameters[i]);
  338. // console.log($("#trainjob_datasets").val())
  339. case (3):
  340. $("input[name='boot_file']").val(parameters[i]);
  341. break;
  342. case (4):
  343. var para = parameters[i].split(" ")
  344. for (var j = 0; j < para.length; j++) {
  345. var para_name = para[j].split('=')[0]
  346. var para_value = para[j].split('=')[1]
  347. var len = $(".dynamic.field .two.fields").length
  348. Add_parameter(len)
  349. var pid = 'para' + len
  350. $(".dynamic.field" + " #" + pid + "").find("input[name=shipping_first-name]").val(para_name)
  351. $(".dynamic.field" + " #" + pid + "").find("input[name=shipping_last-name]").val(para_value)
  352. }
  353. break;
  354. // 数据集pool_id待完成
  355. // case (5):
  356. // $("select[name='pool_id']").val(parameters[i]);
  357. // break;
  358. case (6):
  359. // $("input[name='work_server_number']").val(parameters[i]);
  360. break;
  361. }
  362. }
  363. })
  364. $('.ui.save.checkbox').click(function () {
  365. $(this).checkbox({
  366. onChange: function () {
  367. if ($('.ui.save.checkbox').checkbox('is checked')) {
  368. $('#save_para').removeClass("disabled")
  369. } else {
  370. $('#save_para').addClass("disabled")
  371. }
  372. }
  373. });
  374. })
  375. $('.question.circle.icon').hover(function () {
  376. $(this).popup('show')
  377. });
  378. $(".item.active.parameter_config").click(function () {
  379. $('.ui.parameter.modal')
  380. .modal('setting', 'closable', false)
  381. .modal('show');
  382. })
  383. $('.ui.deny.button').click(function () {
  384. $('.ui.parameter.modal')
  385. .modal('hide');
  386. })
  387. $('select.dropdown')
  388. .dropdown();
  389. function validate() {
  390. $('.ui.form')
  391. .form({
  392. on: 'blur',
  393. fields: {
  394. boot_file: {
  395. identifier: 'boot_file',
  396. rules: [
  397. {
  398. type: 'regExp[/.+\.py$/g]',
  399. }
  400. ]
  401. },
  402. display_job_name: {
  403. identifier: 'display_job_name',
  404. rules: [
  405. {
  406. type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[a-zA-Z0-9_]$/]',
  407. }
  408. ]
  409. },
  410. attachment: {
  411. identifier: 'attachment',
  412. rules: [
  413. {
  414. type: 'empty',
  415. }
  416. ]
  417. },
  418. work_server_number: {
  419. identifier: 'work_server_number',
  420. rules: [
  421. {
  422. type: 'integer[1..25]',
  423. }
  424. ]
  425. }
  426. },
  427. onSuccess: function () {
  428. // $('.ui.page.dimmer').dimmer('show')
  429. document.getElementById("mask").style.display = "block"
  430. },
  431. onFailure: function (e) {
  432. return false;
  433. }
  434. })
  435. }
  436. document.onreadystatechange = function () {
  437. if (document.readyState === "complete") {
  438. document.getElementById("mask").style.display = "none"
  439. }
  440. }
  441. function send_run_para() {
  442. var run_parameters = []
  443. var msg = {}
  444. $(".dynamic.field .two.fields").each(function () {
  445. var para_name = $(this).find('input[name=shipping_first-name]').val()
  446. var para_value = $(this).find('input[name=shipping_last-name]').val()
  447. run_parameters.push({ "label": para_name, "value": para_value })
  448. })
  449. msg["parameter"] = run_parameters
  450. msg = JSON.stringify(msg)
  451. $('#store_run_para').val(msg)
  452. }
  453. function get_name() {
  454. let name1 = $("#engine_name .text").text()
  455. let name2 = $("#flaver_name .text").text()
  456. $("input#ai_engine_name").val(name1)
  457. $("input#ai_flaver_name").val(name2)
  458. let val_server_num_select = $("#trainjob_work_server_num_select .text").text()
  459. // console.log("val_server_num_select:",val_server_num_select)
  460. $("input#trainjob_work_server_num").val(val_server_num_select)
  461. }
  462. $('.ui.create_train_job.green.button').click(function (e) {
  463. get_name()
  464. send_run_para()
  465. validate()
  466. })
  467. </script>