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.

show.tmpl 44 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
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
2 years ago
3 years ago
2 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
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 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
2 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
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
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
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 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
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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933
  1. {{template "base/head" .}}
  2. <link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
  3. <style>
  4. .according-panel-heading {
  5. box-sizing: border-box;
  6. padding: 8px 16px;
  7. color: #252b3a;
  8. background-color: #f2f5fc;
  9. line-height: 1.5;
  10. cursor: pointer;
  11. -moz-user-select: none;
  12. -webkit-user-select: none;
  13. -ms-user-select: none;
  14. -khtml-user-select: none;
  15. user-select: none;
  16. }
  17. .accordion-panel-title {
  18. margin-top: 0;
  19. margin-bottom: 0;
  20. color: #252b3a;
  21. }
  22. .accordion-panel-title-content {
  23. vertical-align: middle;
  24. display: inline-block;
  25. width: calc(100% - 32px);
  26. cursor: default;
  27. }
  28. .acc-margin-bottom {
  29. margin-bottom: 5px;
  30. }
  31. .title_text {
  32. font-size: 12px;
  33. }
  34. .ac-display-inblock {
  35. display: inline-block;
  36. }
  37. .cti-mgRight-sm {
  38. margin-right: 8px;
  39. }
  40. .ac-text-normal {
  41. font-size: 14px;
  42. color: #575d6c;
  43. }
  44. .uc-accordionTitle-black {
  45. color: #333;
  46. }
  47. .accordion-border {
  48. border: 1px solid #cce2ff;
  49. }
  50. .padding0 {
  51. padding: 0 !important;
  52. }
  53. .content-pad {
  54. padding: 15px 35px;
  55. }
  56. .content-margin {
  57. margin: 10px 5px;
  58. }
  59. .tab_2_content {
  60. min-height: 360px;
  61. margin-left: 10px;
  62. }
  63. .ac-grid {
  64. display: block;
  65. *zoom: 1;
  66. }
  67. .ac-grid-col {
  68. float: left;
  69. width: 100%;
  70. }
  71. .ac-grid-col2 .ac-grid-col {
  72. width: 50%;
  73. }
  74. .ti-form {
  75. text-align: left;
  76. max-width: 100%;
  77. vertical-align: middle;
  78. }
  79. .ti-form>tbody {
  80. font-size: 12px;
  81. }
  82. .ti-form>tbody,
  83. .ti-form>tbody>tr {
  84. vertical-align: inherit;
  85. }
  86. .ti-text-form-label {
  87. padding-bottom: 20px;
  88. padding-right: 20px;
  89. color: #8a8e99;
  90. font-size: 12px;
  91. white-space: nowrap !important;
  92. width: 80px;
  93. line-height: 30px;
  94. }
  95. .ti-text-form-content {
  96. line-height: 30px;
  97. padding-bottom: 20px;
  98. }
  99. .ti-form>tbody>tr>td {
  100. vertical-align: top;
  101. white-space: normal;
  102. }
  103. td,
  104. th {
  105. padding: 0;
  106. }
  107. .ac-grid-col .text-span {
  108. width: 450px;
  109. overflow: hidden;
  110. text-overflow: ellipsis;
  111. white-space: nowrap;
  112. }
  113. .redo-color {
  114. color: #3291F8;
  115. }
  116. .ti-action-menu-item:not(:last-child) {
  117. margin-right: 10px;
  118. padding-right: 11px;
  119. text-decoration: none !important;
  120. color: #526ecc;
  121. cursor: pointer;
  122. display: inline-block;
  123. -moz-user-select: none;
  124. -webkit-user-select: none;
  125. -ms-user-select: none;
  126. -khtml-user-select: none;
  127. user-select: none;
  128. position: relative;
  129. }
  130. .ti-action-menu-item:not(:last-child):after {
  131. content: "";
  132. display: inline-block;
  133. position: absolute;
  134. height: 12px;
  135. right: 0;
  136. top: 50%;
  137. -webkit-transform: translateY(-6px);
  138. -ms-transform: translateY(-6px);
  139. -o-transform: translateY(-6px);
  140. transform: translateY(-6px);
  141. border-right: 1px solid #dfe1e6;
  142. }
  143. .text-width80 {
  144. width: 100px;
  145. line-height: 30px;
  146. }
  147. .border-according {
  148. border: 1px solid #dfe1e6;
  149. }
  150. .ti-download-file {
  151. display: flex;
  152. align-items: center;
  153. margin: 0.5rem 0;
  154. }
  155. .disabled {
  156. cursor: default;
  157. pointer-events: none;
  158. color: rgba(0, 0, 0, .6) !important;
  159. opacity: .45 !important;
  160. }
  161. .pad20 {
  162. border: 0px !important;
  163. }
  164. .model_file_bread {
  165. margin-bottom: -0.5rem !important;
  166. padding-left: 1rem;
  167. padding-top: 0.5rem;
  168. }
  169. .menuContent{
  170. position: absolute;
  171. background: #ffffff;
  172. left: 0;
  173. right: 26px;
  174. top: 36px;
  175. z-index:999;
  176. border: 1px solid #96c8da;
  177. border-top: 0;
  178. border-bottom-right-radius: 4px;
  179. border-bottom-left-radius: 4px;
  180. box-shadow: 0 2px 3px 0 rgb(34 36 38 / 15%);
  181. }
  182. </style>
  183. {{template "custom/global_mask" .}}
  184. <div class="repository">
  185. {{template "repo/header" .}}
  186. <div class="ui container">
  187. <h4 class="ui header" id="vertical-segment">
  188. <div class="ui breadcrumb">
  189. <a class="section" href="{{.RepoLink}}/debugjob?debugListType=all">
  190. {{.i18n.Tr "repo.cloudbrain"}}
  191. </a>
  192. <div class="divider"> / </div>
  193. <a class="section" href="{{$.RepoLink}}/modelarts/train-job">
  194. {{$.i18n.Tr "repo.modelarts.train_job"}}
  195. </a>
  196. <div class="divider"> / </div>
  197. <div class="active section">{{.displayJobName}}</div>
  198. </div>
  199. </h4>
  200. {{range $k ,$v := .version_list_task}}
  201. <div class="ui accordion border-according" id="accordion{{.VersionName}}"
  202. data-repopath="{{$.RepoRelPath}}/modelarts/train-job" data-jobid="{{.JobID}}"
  203. data-version="{{.VersionName}}">
  204. <div class="{{if eq $k 0}}active{{end}} title padding0">
  205. <div class="according-panel-heading">
  206. <div class="accordion-panel-title">
  207. <i class="dropdown icon"></i>
  208. <span class="accordion-panel-title-content">
  209. <span>
  210. <div style="float: right;">
  211. {{$.CsrfTokenHtml}}
  212. {{if and (.CanModify) (eq .Status "COMPLETED") ($.Permission.CanWrite $.UnitTypeModelManage) }}
  213. <a class="ti-action-menu-item" id="{{.VersionName}}-create-model"
  214. onclick="showcreate({{.}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a>
  215. {{else}}
  216. <a class="ti-action-menu-item disabled" id="{{.VersionName}}-create-model"
  217. onclick="showcreate({{.}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a>
  218. {{end}}
  219. {{if .CanModify}}
  220. <a class="ti-action-menu-item"
  221. href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/create_version?version_name={{.VersionName}}">{{$.i18n.Tr "repo.modelarts.modify"}}</a>
  222. {{else}}
  223. <a class="ti-action-menu-item disabled"
  224. href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/create_version?version_name={{.VersionName}}">{{$.i18n.Tr "repo.modelarts.modify"}}</a>
  225. {{end}}
  226. {{if .CanDel}}
  227. <a class="ti-action-menu-item stop-show-version {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED" "SUCCEEDED" "STOPPED"}}disabled {{end}}"
  228. id="{{.VersionName}}-stop"
  229. data-jobid="{{.JobID}}"
  230. data-repopath="{{$.RepoRelPath}}/modelarts/train-job"
  231. data-version = "{{.VersionName}}"
  232. >{{$.i18n.Tr "repo.stop"}}</a>
  233. {{else}}
  234. <a class="ti-action-menu-item disabled" id="{{.VersionName}}-stop">{{$.i18n.Tr "repo.stop"}}</a>
  235. {{end}}
  236. {{if .CanDel}}
  237. <a class="ti-action-menu-item" onclick="deleteVersion({{.VersionName}})"
  238. style="color: #FF4D4F;">{{$.i18n.Tr "repo.delete"}}</a>
  239. {{else}}
  240. <a class="ti-action-menu-item disabled" onclick="deleteVersion({{.VersionName}})"
  241. style="color: #FF4D4F;">{{$.i18n.Tr "repo.delete"}}</a>
  242. {{end}}
  243. </div>
  244. <div class="ac-display-inblock title_text acc-margin-bottom">
  245. <span class="cti-mgRight-sm">
  246. {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}
  247. </span>
  248. <span class="cti-mgRight-sm">
  249. {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}}</span>
  250. <span class="cti-mgRight-sm">
  251. {{$.i18n.Tr "repo.modelarts.parent_version"}}:{{.PreVersionName}}</span>
  252. <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}:
  253. <span id="{{.VersionName}}-status-span"><i id="icon"
  254. style="vertical-align: middle;" class="{{.Status}}"></i><span id="text"
  255. style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
  256. </span>
  257. <span
  258. class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span>
  259. <span class="cti-mgRight-sm uc-accordionTitle-black"
  260. id="{{.VersionName}}-duration-span">{{.TrainJobDuration}}</span>
  261. <span id="refresh-status" data-tooltip="刷新" style="cursor: pointer;" data-inverted="" data-version="{{.VersionName}}">
  262. <i class="redo icon redo-color"></i>
  263. </span>
  264. </div>
  265. </span>
  266. </span>
  267. </div>
  268. </div>
  269. </div>
  270. <div class="{{if eq $k 0}}active{{end}} content">
  271. <div class="content-pad">
  272. <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);">
  273. <a class="active item"
  274. data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
  275. <a class="item log_bottom" data-tab="second{{$k}}"
  276. data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a>
  277. <a class="item metric_chart" data-tab="four{{$k}}" data-version="{{.VersionName}}">资源占用情况</a>
  278. <a class="item load-model-file" data-tab="third{{$k}}" data-download-flag="{{$.canDownload}}" data-path="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/model_list" data-version="{{.VersionName}}" data-parents="" data-filename="" data-init="init" >{{$.i18n.Tr "repo.model_download"}}</a>
  279. </div>
  280. <div class="ui tab active" data-tab="first{{$k}}">
  281. <div style="padding-top: 10px;">
  282. <div class="tab_2_content">
  283. <div class="ac-grid ac-grid-col2">
  284. <div class="ac-grid-col">
  285. <table class="ti-form">
  286. <tbody class="ti-text-form">
  287. <tr class="ti-no-ng-animate">
  288. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  289. {{$.i18n.Tr "repo.cloudbrain_task"}}
  290. </td>
  291. <td class="ti-text-form-content">
  292. <div class="text-span text-span-w">
  293. {{.DisplayJobName}}
  294. </div>
  295. </td>
  296. </tr>
  297. <tr class="ti-no-ng-animate">
  298. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  299. {{$.i18n.Tr "repo.modelarts.status"}}
  300. </td>
  301. <td class="ti-text-form-content">
  302. <div class="text-span text-span-w" id="{{.VersionName}}-status">
  303. {{.Status}}
  304. </div>
  305. </td>
  306. </tr>
  307. <tr class="ti-no-ng-animate">
  308. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  309. {{$.i18n.Tr "repo.modelarts.run_version"}}
  310. </td>
  311. <td class="ti-text-form-content">
  312. <div class="text-span text-span-w">
  313. {{.VersionName}}
  314. </div>
  315. </td>
  316. </tr>
  317. <tr class="ti-no-ng-animate">
  318. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  319. {{$.i18n.Tr "repo.modelarts.train_job.start_time"}}
  320. </td>
  321. <td class="ti-text-form-content">
  322. <div class="text-span text-span-w">
  323. <span style="font-size: 12px;" class="">
  324. {{if not (eq .Cloudbrain.StartTime 0)}}
  325. {{TimeSinceUnix1 .Cloudbrain.StartTime}}
  326. {{else}}
  327. --
  328. {{end}}</span>
  329. </div>
  330. </td>
  331. </tr>
  332. <tr class="ti-no-ng-animate">
  333. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  334. {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}
  335. </td>
  336. <td class="ti-text-form-content">
  337. <div class="text-span text-span-w"
  338. id="{{.VersionName}}-duration">
  339. {{.TrainJobDuration}}
  340. </div>
  341. </td>
  342. </tr>
  343. <tr class="ti-no-ng-animate">
  344. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  345. {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
  346. </td>
  347. <td class="ti-text-form-content">
  348. <div class="text-span text-span-w">
  349. {{.FlavorName}}
  350. </div>
  351. </td>
  352. </tr>
  353. <tr class="ti-no-ng-animate">
  354. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  355. {{$.i18n.Tr "repo.modelarts.train_job.compute_node"}}
  356. </td>
  357. <td class="ti-text-form-content">
  358. <div class="text-span text-span-w">
  359. {{.WorkServerNumber}}
  360. </div>
  361. </td>
  362. </tr>
  363. </tbody>
  364. </table>
  365. </div>
  366. <div class="ac-grid-col">
  367. <table class="ti-form">
  368. <tbody class="ti-text-form">
  369. <tr class="ti-no-ng-animate">
  370. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  371. {{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}}
  372. </td>
  373. <td class="ti-text-form-content">
  374. <div class="text-span text-span-w">
  375. {{.EngineName}}
  376. </div>
  377. </td>
  378. </tr>
  379. <tr class="ti-no-ng-animate">
  380. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  381. {{$.i18n.Tr "repo.modelarts.code_version"}}
  382. </td>
  383. <td class="ti-text-form-content">
  384. <div class="text-span text-span-w">
  385. {{.BranchName}}
  386. </div>
  387. </td>
  388. </tr>
  389. <tr class="ti-no-ng-animate">
  390. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  391. {{$.i18n.Tr "repo.modelarts.train_job.start_file"}}
  392. </td>
  393. <td class="ti-text-form-content">
  394. <div class="text-span text-span-w">
  395. {{.BootFile}}
  396. </div>
  397. </td>
  398. </tr>
  399. <tr class="ti-no-ng-animate">
  400. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  401. {{$.i18n.Tr "repo.modelarts.train_job.train_dataset"}}
  402. </td>
  403. <td class="ti-text-form-content">
  404. <div class="text-span text-span-w">
  405. {{range $m ,$n := $.datasetList}}
  406. {{if eq $k $m}}
  407. {{range $f ,$g := $n}}
  408. <a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
  409. {{end}}
  410. {{end}}
  411. {{end}}
  412. </div>
  413. </td>
  414. </tr>
  415. <tr class="ti-no-ng-animate">
  416. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  417. {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}}
  418. </td>
  419. <td class="ti-text-form-content">
  420. <div class="text-span text-span-w" title="{{.Parameters}}">
  421. {{.Parameters}}
  422. </div>
  423. </td>
  424. </tr>
  425. </tr>
  426. <tr class="ti-no-ng-animate">
  427. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  428. {{$.i18n.Tr "repo.modelarts.train_job.description"}}
  429. </td>
  430. <td class="ti-text-form-content">
  431. <div class="text-span text-span-w"
  432. title="{{.Cloudbrain.Description}}">
  433. {{.Cloudbrain.Description}}
  434. </div>
  435. </td>
  436. </tr>
  437. </tbody>
  438. </table>
  439. </div>
  440. </div>
  441. </div>
  442. </div>
  443. </div>
  444. <div class="ui tab" data-tab="second{{$k}}">
  445. <div>
  446. <a id="{{.VersionName}}-log-down"
  447. class='{{if and (.CanModify) (eq .Status "KILLED" "FAILED" "START_FAILED" "STOPPED" "COMPLETED") }}ti-download-file{{else}}disabled{{end}}'
  448. href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/download_log_file?version_name={{.VersionName}}">
  449. <i class="ri-download-cloud-2-line"></i>
  450. <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
  451. </a>
  452. </div>
  453. <div
  454. style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
  455. <span>
  456. <a title="滚动到顶部" style="position: absolute; right: -32px;cursor: pointer;"
  457. class="log_top" data-version="{{.VersionName}}"><i class="icon-to-top"></i></a>
  458. </span>
  459. <span class="log-info">
  460. <a title="滚动到底部" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
  461. class="log_bottom" data-version="{{.VersionName}}"><i
  462. class="icon-to-bottom"></i></a>
  463. </span>
  464. <div class="ui message message{{.VersionName}}" style="display: none;">
  465. <div id="header"></div>
  466. </div>
  467. <div class="ui attached log log-scroll" id="log{{.VersionName}}" data-version="{{.VersionName}}"
  468. style="height: 300px !important; overflow: auto;">
  469. <div class="ui inverted active dimmer">
  470. <div class="ui loader"></div>
  471. </div>
  472. <input type="hidden" name="end_line" value>
  473. <input type="hidden" name="start_line" value>
  474. <pre id="log_file{{.VersionName}}"></pre>
  475. </div>
  476. </div>
  477. </div>
  478. <div class="ui tab" data-tab="four{{$k}}" style="position: relative;">
  479. <i class="ri-refresh-line metric_chart"
  480. style="position: absolute;right: 25%;color:#3291f8;z-index:99;cursor: pointer;"
  481. data-version="{{.VersionName}}"></i>
  482. <div id="metric-{{.VersionName}}" style="height: 260px;width: 870px;">
  483. </div>
  484. </div>
  485. <div class="ui tab" data-tab="third{{$k}}">
  486. <input type="hidden" name="model{{.VersionName}}" value="-1">
  487. <input type="hidden" name="modelback{{.VersionName}}" value="-1">
  488. <div class='ui breadcrumb model_file_bread' id='file_breadcrumb{{.VersionName}}'>
  489. <div class="active section">{{.VersionName}}</div>
  490. <div class="divider"> / </div>
  491. </div>
  492. <div id="dir_list{{.VersionName}}" style="max-height: 500px;overflow:auto;">
  493. </div>
  494. </div>
  495. </div>
  496. </div>
  497. </div>
  498. {{end}} {{template "base/paginate" .}}
  499. </div>
  500. <!-- 确认模态框 -->
  501. <div id="deletemodel">
  502. <div class="ui basic modal">
  503. <div class="ui icon header">
  504. <i class="trash icon"></i> {{.i18n.Tr "cloudbrain.delete_task"}}
  505. </div>
  506. <div class="content">
  507. <p>{{.i18n.Tr "cloudbrain.task_delete_confirm"}}</p>
  508. </div>
  509. <div class="actions">
  510. <div class="ui red basic inverted cancel button">
  511. <i class="remove icon"></i> {{.i18n.Tr "cloudbrain.operate_cancel"}}
  512. </div>
  513. <div class="ui green basic inverted ok button">
  514. <i class="checkmark icon"></i> {{.i18n.Tr "cloudbrain.operate_confirm"}}
  515. </div>
  516. </div>
  517. </div>
  518. </div>
  519. <!--
  520. <div id="menuContent" class="menuContent" style="display:none; position: absolute;z-index:9999">
  521. <ul id="treeDemo" class="ztree" style="margin-top:0; width: 83%; height: 100%;"></ul>
  522. </div> -->
  523. <!-- 创建模型 -->
  524. <div id="newmodel">
  525. <div class="ui modal second">
  526. <div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);">
  527. <h4 id="model_header">导入新模型</h4>
  528. </div>
  529. <div class="content content-padding">
  530. <form id="formId" method="POST" class="ui form">
  531. <div class="ui error message">
  532. </div>
  533. {{$.CsrfTokenHtml}}
  534. <input type="hidden" name="trainTaskCreate" value="true">
  535. <div class="two inline fields ">
  536. <div class="required ten wide field">
  537. <label style="margin-left: -23px;">选择训练任务</label>
  538. <input type="hidden" class="width83" id="JobId" name="JobId" readonly required>
  539. <input class="width83" id="JobName" readonly required>
  540. </div>
  541. <div class="required six widde field">
  542. <label>版本</label>
  543. <input class="width70" id="VersionName" name="VersionName" readonly required>
  544. </div>
  545. </div>
  546. <div class="required inline field" id="modelname">
  547. <label>模型名称</label>
  548. <input style="width: 45%;" id="name" name="Name" required maxlength="25"
  549. onkeyup="this.value=this.value.replace(/[, ]/g,'')">
  550. </div>
  551. <div class="required inline field" id="verionname">
  552. <label>模型版本</label>
  553. <input style="width: 45%;" id="version" name="Version" value="" readonly required maxlength="255">
  554. </div>
  555. <div class="unite min_title inline field required">
  556. <label>模型框架</label>
  557. <input type="hidden" id="Engine" name="Engine" required>
  558. <input style="width: 45%;" id="Engine_name" name="Engine_name" readonly required maxlength="255">
  559. </div>
  560. <div class="unite min_title inline fields required">
  561. <div class="field required">
  562. <label for="modelSelectedFile">模型文件</label>
  563. </div>
  564. <div class="thirteen wide field" style="position:relative">
  565. <input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" >
  566. <div id="menuContent" class="menuContent" style="display:none;">
  567. <ul id="treeDemo" class="ztree"></ul>
  568. </div>
  569. </div>
  570. </div>
  571. <div class="inline field">
  572. <label>模型标签</label>
  573. <input style="width: 83%;margin-left: 7px;" id="label" name="Label" maxlength="255"
  574. placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'>
  575. </div>
  576. <div class="inline field">
  577. <label for="description">模型描述</label>
  578. <textarea style="width: 83%;margin-left: 7px;" id="Description" name="Description" rows="3"
  579. maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}'
  580. onchange="this.value=this.value.substring(0, 255)"
  581. onkeydown="this.value=this.value.substring(0, 255)"
  582. onkeyup="this.value=this.value.substring(0, 256)"></textarea>
  583. </div>
  584. <div class="inline field" style="margin-left: 75px;">
  585. <button onclick="createModel()" type="button" class="ui create_train_job green button"
  586. style="position: absolute;">
  587. {{.i18n.Tr "repo.model.manage.sava_model"}}
  588. </button>
  589. </div>
  590. </form>
  591. <div class="actions" style="display: inline-block;margin-left: 180px;">
  592. <button class="ui button cancel">{{.i18n.Tr "repo.cloudbrain.cancel"}}</button>
  593. </div>
  594. </div>
  595. </div>
  596. </div>
  597. </div>
  598. {{template "base/footer" .}}
  599. <script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script>
  600. <script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js"></script>
  601. <script>
  602. var setting = {
  603. check: {
  604. enable: true,
  605. chkboxType: {"Y":"ps", "N":"ps"}
  606. },
  607. view: {
  608. dblClickExpand: false
  609. },
  610. callback: {
  611. beforeClick: beforeClick,
  612. onCheck: onCheck
  613. }
  614. };
  615. function beforeClick(treeId, treeNode) {
  616. var zTree = $.fn.zTree.getZTreeObj("treeDemo");
  617. zTree.checkNode(treeNode, !treeNode.checked, null, true);
  618. return false;
  619. }
  620. function onCheck(e, treeId, treeNode) {
  621. var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
  622. nodes = zTree.getCheckedNodes(true),
  623. v = "";
  624. for (var i=0, l=nodes.length; i<l; i++) {
  625. if(nodes[i].isParent){
  626. continue;
  627. }
  628. var pathNodes = nodes[i].getPath();
  629. var path ="";
  630. for(var j=0;j<pathNodes.length;j++){
  631. if(j ==0){
  632. path += pathNodes[j].name;
  633. }else{
  634. path += "/" + pathNodes[j].name;
  635. }
  636. }
  637. v += path + ";";
  638. }
  639. if (v.length > 0 ) v = v.substring(0, v.length-1);
  640. var cityObj = $("#modelSelectedFile");
  641. cityObj.attr("value", v);
  642. }
  643. function showMenu() {
  644. var cityObj = $("#modelSelectedFile");
  645. var cityOffset = $("#modelSelectedFile").offset();
  646. //$("#menuContent").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");
  647. $("#menuContent").slideDown("fast");
  648. $("body").bind("mousedown", onBodyDown);
  649. }
  650. function hideMenu() {
  651. $("#menuContent").fadeOut("fast");
  652. $("body").unbind("mousedown", onBodyDown);
  653. }
  654. function onBodyDown(event) {
  655. if (!(event.target.id == "menuBtn" || event.target.id == "modelSelectedFile" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
  656. hideMenu();
  657. }
  658. }
  659. let dirKey="isOnlyDir--:&";
  660. function loadSelectedModelFile(trainJob){
  661. console.log("trainJob=" + trainJob);
  662. $('#choice_file').dropdown('clear')
  663. $("#model-file").empty()
  664. if(trainJob ==null || trainJob ==""){
  665. console.log("trainJob is null");
  666. }else{
  667. $.get(`/${userName}/${repoPath}/modelmanage/query_train_model?jobName=${trainJob.JobName}&type=1&VersionName=${trainJob.VersionName}`, (data) => {
  668. const n_length = data.length
  669. let file_html=''
  670. let firstFileName =''
  671. var zNodes=[];
  672. var nodesMap={};
  673. for (let i=0;i<n_length;i++){
  674. var parentNodeMap = nodesMap;
  675. var fileSplits = data[i].FileName.split("/");
  676. for(let j=0;j < fileSplits.length;j++){
  677. if(fileSplits[j] == ""){
  678. break;
  679. }
  680. if(parentNodeMap[fileSplits[j]] == null){
  681. parentNodeMap[fileSplits[j]] = {};
  682. }
  683. parentNodeMap = parentNodeMap[fileSplits[j]];
  684. }
  685. }
  686. for (let i=0;i<n_length;i++){
  687. var parentNodeMap = nodesMap;
  688. var fileSplits = data[i].FileName.split("/");
  689. for(let j=0;j < fileSplits.length;j++){
  690. if(fileSplits[j] == ""){
  691. if(data[i].FileName[data[i].FileName.length -1] =="/"){
  692. if(Object.keys(parentNodeMap).length ==0){
  693. parentNodeMap[dirKey]="true";
  694. }
  695. }
  696. break;
  697. }
  698. parentNodeMap = parentNodeMap[fileSplits[j]];
  699. }
  700. }
  701. convertToNode(zNodes,nodesMap);
  702. $.fn.zTree.init($("#treeDemo"), setting, zNodes);
  703. })
  704. }
  705. }
  706. function convertToNode(nodeList,nodesMap){
  707. var keyList = Object.keys(nodesMap);
  708. keyList.sort(function(a,b){
  709. return a-b;
  710. });
  711. var isFirst = true;
  712. for(var i=0; i<keyList.length;i++){
  713. var node = {};
  714. node["name"] = keyList[i];
  715. nodeList.push(node);
  716. if(nodesMap[keyList[i]] != null && Object.keys(nodesMap[keyList[i]]).length >0){
  717. if(nodesMap[keyList[i]][dirKey] != null){
  718. node["open"] = false;
  719. node["isParent"] = true;
  720. }else{
  721. node["children"]=[];
  722. if(isFirst){
  723. node["open"] = true;
  724. isFirst= false;
  725. }
  726. convertToNode(node["children"],nodesMap[keyList[i]]);
  727. }
  728. }
  729. }
  730. }
  731. $('.menu .item').tab()
  732. $(document).ready(function () {
  733. $('.ui.accordion').accordion({ selector: { trigger: '.icon' } });
  734. });
  735. $(document).ready(function () {
  736. $('.secondary.menu .item').tab();
  737. });
  738. let userName
  739. let repoPath
  740. let jobID
  741. let downlaodFlag = {{ $.canDownload }}
  742. $(document).ready(function () {
  743. let url = window.location.href;
  744. let urlArr = url.split('/')
  745. userName = urlArr.slice(-5)[0]
  746. repoPath = urlArr.slice(-4)[0]
  747. jobID = urlArr.slice(-1)[0]
  748. })
  749. function stopBubbling(e) {
  750. e = window.event || e;
  751. if (e.stopPropagation) {
  752. e.stopPropagation(); //阻止事件 冒泡传播
  753. } else {
  754. e.cancelBubble = true; //ie兼容
  755. }
  756. }
  757. function showcreate(obj) {
  758. $('.ui.modal.second')
  759. .modal({
  760. centered: false,
  761. onShow: function () {
  762. $('input[name="Version"]').addClass('model_disabled')
  763. // $('input[name="JobId"]').text(obj.JobName)
  764. $('#JobName').val(obj.DisplayJobName).addClass('model_disabled')
  765. $('input[name="JobId"]').val(obj.JobID)
  766. $('input[name="VersionName"]').val(obj.VersionName).addClass('model_disabled')
  767. if(obj.EngineID ==122 || obj.EngineID ==35 || obj.EngineID ==-1){
  768. $('input[name="Engine_name"]').val("MindSpore").addClass('model_disabled');
  769. $('input[name="Engine"]').val(2);
  770. }
  771. if(obj.EngineID ==121){
  772. $('input[name="Engine_name"]').val("TensorFlow").addClass('model_disabled');
  773. $('input[name="Engine"]').val(1);
  774. }
  775. $('.ui.dimmer').css({ "background-color": "rgb(136, 136, 136,0.7)" })
  776. createModelName();
  777. loadSelectedModelFile(obj);
  778. },
  779. onHide: function () {
  780. var cityObj = $("#modelSelectedFile");
  781. cityObj.attr("value", "");
  782. document.getElementById("formId").reset();
  783. $('.ui.dimmer').css({ "background-color": "" })
  784. $('.ui.error.message').text()
  785. $('.ui.error.message').css('display', 'none')
  786. }
  787. })
  788. .modal('show')
  789. }
  790. function createModel() {
  791. let url_href = `/${userName}/${repoPath}/modelmanage/create_new_model`
  792. let data = $("#formId").serialize()
  793. $("#mask").css({ "display": "block", "z-index": "9999" })
  794. $.ajax({
  795. url: url_href,
  796. type: 'POST',
  797. data: data,
  798. success: function (res) {
  799. $('input[name="Engine_name"]').val("");
  800. $('input[name="Engine"]').val("");
  801. location.href = `/${userName}/${repoPath}/modelmanage/show_model`
  802. $('.ui.modal.second').modal('hide')
  803. },
  804. error: function (xhr) {
  805. // 隐藏 loading
  806. // 只有请求不正常(状态码不为200)才会执行
  807. $('.ui.error.message').text(xhr.responseText)
  808. $('.ui.error.message').css('display', 'block')
  809. },
  810. complete: function (xhr) {
  811. $("#mask").css({ "display": "none", "z-index": "1" })
  812. }
  813. })
  814. }
  815. function createModelName() {
  816. let repoName = location.pathname.split('/')[2]
  817. let modelName = repoName + '_model_' + Math.random().toString(36).substr(2, 4)
  818. $('#name').val(modelName)
  819. $('#version').val("0.0.1")
  820. }
  821. function deleteVersion(version_name) {
  822. stopBubbling(arguments.callee.caller.arguments[0])
  823. let flag = 1;
  824. $('.ui.basic.modal').modal({
  825. onDeny: function () {
  826. flag = false
  827. },
  828. onApprove: function () {
  829. $.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/del_version`, { version_name: version_name }, (data) => {
  830. if (data.VersionListCount === 0) {
  831. location.href = `/${userName}/${repoPath}/modelarts/train-job`
  832. } else {
  833. $('#accordion' + version_name).remove()
  834. }
  835. }).fail(function (err) {
  836. console.log(err);
  837. });
  838. flag = true
  839. },
  840. onHidden: function () {
  841. if (flag == false) {
  842. $('.alert').html('您已取消操作').removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut();
  843. }
  844. }
  845. })
  846. .modal('show')
  847. }
  848. </script>