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 45 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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932
  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. .info_text {
  108. padding-bottom: 20px;
  109. padding-right: 20px;
  110. font-size: 12px;
  111. }
  112. .ac-grid-col .text-span {
  113. width: 450px;
  114. overflow: hidden;
  115. text-overflow: ellipsis;
  116. white-space: nowrap;
  117. }
  118. .redo-color {
  119. color: #3291F8;
  120. }
  121. .ti-action-menu-item:not(:last-child) {
  122. margin-right: 10px;
  123. padding-right: 11px;
  124. text-decoration: none !important;
  125. color: #526ecc;
  126. cursor: pointer;
  127. display: inline-block;
  128. -moz-user-select: none;
  129. -webkit-user-select: none;
  130. -ms-user-select: none;
  131. -khtml-user-select: none;
  132. user-select: none;
  133. position: relative;
  134. }
  135. .ti-action-menu-item:not(:last-child):after {
  136. content: "";
  137. display: inline-block;
  138. position: absolute;
  139. height: 12px;
  140. right: 0;
  141. top: 50%;
  142. -webkit-transform: translateY(-6px);
  143. -ms-transform: translateY(-6px);
  144. -o-transform: translateY(-6px);
  145. transform: translateY(-6px);
  146. border-right: 1px solid #dfe1e6;
  147. }
  148. .text-width80 {
  149. width: 100px;
  150. line-height: 30px;
  151. }
  152. .border-according {
  153. border: 1px solid #dfe1e6;
  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. <div id="mask">
  184. <div id="loadingPage">
  185. <div class="rect1"></div>
  186. <div class="rect2"></div>
  187. <div class="rect3"></div>
  188. <div class="rect4"></div>
  189. <div class="rect5"></div>
  190. </div>
  191. </div>
  192. <div class="repository">
  193. {{template "repo/header" .}}
  194. <div class="ui container">
  195. <h4 class="ui header" id="vertical-segment">
  196. <div class="ui breadcrumb">
  197. <a class="section" href="{{.RepoLink}}/debugjob?debugListType=all">
  198. {{.i18n.Tr "repo.cloudbrain"}}
  199. </a>
  200. <div class="divider"> / </div>
  201. <a class="section" href="{{$.RepoLink}}/modelarts/train-job">
  202. {{$.i18n.Tr "repo.modelarts.train_job"}}
  203. </a>
  204. <div class="divider"> / </div>
  205. <div class="active section">{{.displayJobName}}</div>
  206. </div>
  207. </h4>
  208. {{range $k ,$v := .version_list_task}}
  209. <div class="ui accordion border-according" id="accordion{{.VersionName}}"
  210. data-repopath="{{$.RepoRelPath}}/cloudbrain" data-jobid="{{.ID}}" data-version="{{.VersionName}}">
  211. <input type="hidden" id="jobId_input" name="jobId_input" value="{{.JobID}}">
  212. <div class="{{if eq $k 0}}active{{end}} title padding0">
  213. <div class="according-panel-heading">
  214. <div class="accordion-panel-title">
  215. <i class="dropdown icon"></i>
  216. <span class="accordion-panel-title-content">
  217. <span>
  218. <div style="float: right;">
  219. {{if and ($.canDownload) (ne .Status "WAITING") ($.Permission.CanWrite $.UnitTypeModelManage) }}
  220. <a class="ti-action-menu-item" id="{{.VersionName}}-create-model"
  221. onclick="showcreate({DisplayJobName:{{.DisplayJobName}},JobName:{{.JobName}},JobID:{{.JobID}},VersionName:{{.VersionName}}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a>
  222. {{else}}
  223. <a class="ti-action-menu-item disabled" id="{{.VersionName}}-create-model">{{$.i18n.Tr "repo.modelarts.create_model"}}</a>
  224. {{end}}
  225. </div>
  226. <div class="ac-display-inblock title_text acc-margin-bottom">
  227. <span class="cti-mgRight-sm">{{TimeSinceUnix1 .CreatedUnix}}</span>
  228. <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}:
  229. <span id="{{.VersionName}}-status-span"><i id="icon"
  230. style="vertical-align: middle;" class="{{.Status}}"></i><span id="text"
  231. style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
  232. </span>
  233. <span
  234. class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span>
  235. <span class="cti-mgRight-sm uc-accordionTitle-black"
  236. id="{{.VersionName}}-duration-span">{{$.duration}}</span>
  237. <span class="refresh-status" data-tooltip="刷新" style="cursor: pointer;" data-inverted="" data-version="{{.VersionName}}"><i
  238. class="redo icon redo-color"></i></span>
  239. </div>
  240. </span>
  241. </span>
  242. </div>
  243. </div>
  244. </div>
  245. <div class="{{if eq $k 0}}active{{end}} content">
  246. <div class="content-pad">
  247. <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);">
  248. <a class="active item"
  249. data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
  250. <a class="item log_bottom" data-tab="third{{$k}}"
  251. data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a>
  252. <a class="item load-model-file" data-tab="four{{$k}}" data-gpu-flag="true" data-download-flag="{{$.canDownload}}" data-path="{{$.RepoLink}}/cloudbrain/train-job/{{.JobID}}/model_list" data-version="{{.VersionName}}" data-parents="" data-filename="" data-init="init" >{{$.i18n.Tr "repo.model_download"}}</a>
  253. </div>
  254. <div class="ui tab active" data-tab="first{{$k}}">
  255. <div style="padding-top: 10px;">
  256. <div class="tab_2_content">
  257. <div class="ac-grid ac-grid-col2">
  258. <div class="ac-grid-col">
  259. <table class="ti-form">
  260. <tbody class="ti-text-form">
  261. <tr class="ti-no-ng-animate">
  262. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  263. {{$.i18n.Tr "repo.cloudbrain_task"}}
  264. </td>
  265. <td class="ti-text-form-content">
  266. <div class="text-span text-span-w">
  267. {{.DisplayJobName}}
  268. </div>
  269. </td>
  270. </tr>
  271. <tr class="ti-no-ng-animate">
  272. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  273. {{$.i18n.Tr "repo.modelarts.status"}}
  274. </td>
  275. <td class="ti-text-form-content">
  276. <div class="text-span text-span-w" id="{{.VersionName}}-status">
  277. {{.Status}}
  278. </div>
  279. </td>
  280. </tr>
  281. <tr class="ti-no-ng-animate">
  282. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  283. {{$.i18n.Tr "repo.modelarts.train_job.start_time"}}
  284. </td>
  285. <td class="ti-text-form-content">
  286. <div class="text-span text-span-w">
  287. <span style="font-size: 12px;" id="{{.VersionName}}-startTime">
  288. {{if not (eq .StartTime 0)}}
  289. {{TimeSinceUnix1 .StartTime}}
  290. {{else}}
  291. --
  292. {{end}}
  293. </span>
  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.train_job.dura_time"}}
  300. </td>
  301. <td class="ti-text-form-content">
  302. <div class="text-span text-span-w"
  303. id="{{.VersionName}}-duration">
  304. {{$.duration}}
  305. </div>
  306. </td>
  307. </tr>
  308. <tr class="ti-no-ng-animate">
  309. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  310. {{$.i18n.Tr "repo.modelarts.model_name"}}
  311. </td>
  312. <td class="ti-text-form-content">
  313. <div class="text-span text-span-w">{{if .ModelName}}{{.ModelName}}{{else}}--{{end}}</div>
  314. </td>
  315. </tr>
  316. <tr class="ti-no-ng-animate">
  317. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  318. {{$.i18n.Tr "repo.modelconvert.modelversion"}}
  319. </td>
  320. <td class="ti-text-form-content">
  321. <div class="text-span text-span-w">{{if .ModelVersion}}{{.ModelVersion}}{{else}}--{{end}}</div>
  322. </td>
  323. </tr>
  324. <tr class="ti-no-ng-animate">
  325. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  326. {{$.i18n.Tr "repo.modelarts.infer_job_model_file"}}
  327. </td>
  328. <td class="ti-text-form-content">
  329. <div class="text-span text-span-w">{{if .CkptName}}{{.CkptName}}{{else}}--{{end}}</div>
  330. </td>
  331. </tr>
  332. </tbody>
  333. </table>
  334. </div>
  335. <div class="ac-grid-col">
  336. <table class="ti-form">
  337. <tbody class="ti-text-form">
  338. <tr class="ti-no-ng-animate">
  339. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  340. {{$.i18n.Tr "cloudbrain.mirror"}}
  341. </td>
  342. <td class="ti-text-form-content">
  343. <div class="text-span text-span-w" id="{{.VersionName}}-mirror">
  344. <span class="ui poping up clipboard" data-position="top center" id="clipboard-btn" style="cursor:pointer"
  345. data-clipboard-text="{{.Image}}"
  346. data-success="{{$.i18n.Tr "repo.copy_link_success"}}"
  347. data-error="{{$.i18n.Tr "repo.copy_link_error"}}"
  348. data-content="{{$.i18n.Tr "repo.copy_link"}}"
  349. data-variation="inverted tiny"
  350. >
  351. <span title="{{.Image}}">{{.Image}}</span>
  352. </span>
  353. </div>
  354. </td>
  355. </tr>
  356. <tr class="ti-no-ng-animate">
  357. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  358. {{$.i18n.Tr "repo.modelarts.code_version"}}
  359. </td>
  360. <td class="ti-text-form-content">
  361. <div class="text-span text-span-w">
  362. {{.BranchName}}
  363. <span style="margin-left:1rem" class="ui label">{{SubStr .CommitID 0 10}}</span>
  364. </div>
  365. </td>
  366. </tr>
  367. <tr class="ti-no-ng-animate">
  368. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  369. {{$.i18n.Tr "repo.modelarts.train_job.start_file"}}
  370. </td>
  371. <td class="ti-text-form-content">
  372. <div class="text-span text-span-w">
  373. {{.BootFile}}
  374. </div>
  375. </td>
  376. </tr>
  377. <tr class="ti-no-ng-animate">
  378. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  379. {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}}
  380. </td>
  381. <td class="ti-text-form-content">
  382. <div class="text-span text-span-w" title="{{.Parameters}}">
  383. {{if .Parameters}}{{.Parameters}}{{else}}--{{end}}
  384. </div>
  385. </td>
  386. </tr>
  387. <tr class="ti-no-ng-animate">
  388. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  389. {{$.i18n.Tr "repo.modelarts.train_job.resource_type"}}
  390. </td>
  391. <td class="ti-text-form-content resorce_type">
  392. <div class="text-span text-span-w"></div>
  393. </td>
  394. </tr>
  395. <tr class="ti-no-ng-animate">
  396. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  397. {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
  398. </td>
  399. <td class="ti-text-form-content spec">
  400. <div class="text-span text-span-w"></div>
  401. </td>
  402. </tr>
  403. <tr class="ti-no-ng-animate">
  404. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  405. {{$.i18n.Tr "repo.modelarts.train_job.description"}}
  406. </td>
  407. <td class="ti-text-form-content">
  408. <div class="text-span text-span-w" title="{{.Description}}">
  409. {{if .Description}}{{.Description}}{{else}}--{{end}}
  410. </div>
  411. </td>
  412. </tr>
  413. </tbody>
  414. </table>
  415. </div>
  416. </div>
  417. <div style="clear:both">
  418. <table style="border:none" class="ui fixed small stackable table">
  419. <thead>
  420. <tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
  421. </tr></thead>
  422. <tbody>
  423. {{range $m ,$n := $.datasetDownload}}
  424. <tr>
  425. <td style="word-wrap: break-word;word-break: break-all;">
  426. {{if eq .IsDelete true}}
  427. {{.DatasetName}}({{$.i18n.Tr "dataset.file_deleted"}})
  428. {{else}}
  429. <a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a>
  430. {{end}}
  431. </td>
  432. </tr>
  433. {{end}}
  434. </tbody>
  435. </table>
  436. </div>
  437. </div>
  438. </div>
  439. </div>
  440. <div class="ui tab" data-tab="third{{$k}}">
  441. <div class="file-info">
  442. <a id="{{.VersionName}}-log-down"
  443. class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}} file-info'
  444. href="/api/v1/repos/{{$.RepoRelPath}}/cloudbrain/{{.ID}}/download_log_file">
  445. <i class="ri-download-cloud-2-line"></i>
  446. <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
  447. </a>
  448. <div class="file-info full-log-dialog" data-version="{{.VersionName}}" data-log="{{$.i18n.Tr "repo.modelarts.log_file"}}"
  449. data-exit="{{$.i18n.Tr "repo.modelarts.exit_full_screen"}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;"
  450. data-log-down="{{$.i18n.Tr "repo.modelarts.download_log"}}" data-href="/api/v1/repos/{{$.RepoRelPath}}/cloudbrain/{{.ID}}/download_log_file"
  451. data-scroll-top="{{$.i18n.Tr "repo.log_scroll_start"}}" data-scroll-bottom="{{$.i18n.Tr "repo.log_scroll_end"}}">
  452. <i class="ri-aspect-ratio-line"></i>
  453. <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.fullscreen_log_file"}}</span>
  454. </div>
  455. </div>
  456. <div style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
  457. <span>
  458. <a title="{{$.i18n.Tr "repo.log_scroll_start"}}" style="position: absolute; right: -32px;cursor: pointer;"
  459. class="log_top" data-version="{{.VersionName}}"><i class="icon-to-top"></i></a>
  460. </span>
  461. <span class="log-info-{{.VersionName}}">
  462. <a title="{{$.i18n.Tr "repo.log_scroll_end"}}" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
  463. class="log_bottom" data-version="{{.VersionName}}"><i
  464. class="icon-to-bottom"></i></a>
  465. </span>
  466. <div class="ui message message{{.VersionName}}" style="display: none;">
  467. <div id="header"></div>
  468. </div>
  469. <div class="ui attached log log-scroll" id="log{{.VersionName}}" data-version="{{.VersionName}}"
  470. style="height: 300px !important; overflow: auto;">
  471. <div class="ui inverted active dimmer">
  472. <div class="ui loader"></div>
  473. </div>
  474. <input type="hidden" name="end_line" value>
  475. <input type="hidden" name="end_line-max" value>
  476. <input type="hidden" name="start_line-max" value>
  477. <input type="hidden" name="start_line-max-copy" value>
  478. <input type="hidden" name="start_line" value>
  479. <input type="hidden" name="init_log" value>
  480. <pre id="log_file{{.VersionName}}"></pre>
  481. </div>
  482. </div>
  483. </div>
  484. <div class="ui tab" data-tab="four{{$k}}">
  485. <input type="hidden" name="model{{.VersionName}}" value="-1">
  486. <input type="hidden" name="modelback{{.VersionName}}" value="-1">
  487. <div class='ui breadcrumb model_file_bread' id='file_breadcrumb{{.VersionName}}'>
  488. <div class="active section">result</div>
  489. <div class="divider"> / </div>
  490. </div>
  491. <div id="dir_list{{.VersionName}}">
  492. </div>
  493. <div style="display:flex;align-items: center;justify-content: end;color: #f2711c;">
  494. <i class="ri-error-warning-line" style="margin-right:0.5rem;"></i>
  495. <span>{{$.i18n.Tr "repo.file_limit_100"}}</span>
  496. </div>
  497. </div>
  498. </div>
  499. </div>
  500. </div>
  501. {{template "custom/max_log" .}}
  502. {{end}} {{template "base/paginate" .}}
  503. </div>
  504. <!-- 确认模态框 -->
  505. <div id="deletemodel">
  506. <div class="ui basic modal">
  507. <div class="ui icon header">
  508. <i class="trash icon"></i> 删除任务
  509. </div>
  510. <div class="content">
  511. <p>你确认删除该任务么?此任务一旦删除不可恢复。</p>
  512. </div>
  513. <div class="actions">
  514. <div class="ui red basic inverted cancel button">
  515. <i class="remove icon"></i> 取消操作
  516. </div>
  517. <div class="ui green basic inverted ok button">
  518. <i class="checkmark icon"></i> 确定操作
  519. </div>
  520. </div>
  521. </div>
  522. </div>
  523. <!--
  524. <div id="menuContent" class="menuContent" style="display:none; position: absolute;z-index:9999">
  525. <ul id="treeDemo" class="ztree" style="margin-top:0; width: 83%; height: 100%;"></ul>
  526. </div> -->
  527. <!-- 创建模型 -->
  528. <div id="newmodel">
  529. <div class="ui modal second">
  530. <div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);">
  531. <h4 id="model_header">{{.i18n.Tr "repo.model.manage.import_new_model"}}</h4>
  532. </div>
  533. <div class="content content-padding">
  534. <form id="formId" method="POST" class="ui form">
  535. <div class="ui error message">
  536. </div>
  537. {{$.CsrfTokenHtml}}
  538. <input type="hidden" name="trainTaskCreate" value="true">
  539. <div class="required inline field">
  540. <label>{{.i18n.Tr "repo.modelarts.train_job"}}</label>
  541. <input type="hidden" class="width83" id="jobId" name="jobId" readonly required>
  542. <input type="hidden" id="versionName" name="versionName" value="V0001">
  543. <input style="width: 45%;" id="JobName" readonly required>
  544. </div>
  545. <div class="required inline field" id="modelname">
  546. <label>{{.i18n.Tr "repo.model.manage.model_name"}}</label>
  547. <input style="width: 45%;" id="name" name="name" required maxlength="25"
  548. onkeyup="this.value=this.value.replace(/[, ]/g,'')">
  549. </div>
  550. <div class="required inline field" id="verionname">
  551. <label>{{.i18n.Tr "repo.modelconvert.modelversion"}}</label>
  552. <input style="width: 45%;" id="version" name="version" value="" readonly required maxlength="255">
  553. </div>
  554. <div class="unite min_title inline field required">
  555. <label>{{.i18n.Tr "repo.model.manage.engine"}}</label>
  556. <div class="ui dropdown selection search width70" id="choice_Engine">
  557. <input type="hidden" id="engine" name="engine" required>
  558. <div class="default text">{{.i18n.Tr "repo.model.manage.select.engine"}}</div>
  559. <i class="dropdown icon"></i>
  560. <div class="menu" id="job-Engine">
  561. <option class="active item" data-value="0">PyTorch</option>
  562. <option class="item" data-value="1">TensorFlow</option>
  563. <option class="item" data-value="4">PaddlePaddle</option>
  564. <option class="item" data-value="5">OneFlow</option>
  565. <option class="item" data-value="6">MXNet</option>
  566. <option class="item" data-value="3">Other</option>
  567. </div>
  568. </div>
  569. </div>
  570. <div class="unite min_title inline fields required">
  571. <div class="field required">
  572. <label for="modelSelectedFile">{{.i18n.Tr "repo.model.manage.modelfile"}}</label>
  573. </div>
  574. <div class="thirteen wide field" style="position:relative">
  575. <input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile">
  576. <div id="menuContent" class="menuContent" style="display:none;">
  577. <ul id="treeDemo" class="ztree"></ul>
  578. </div>
  579. </div>
  580. </div>
  581. <div class="inline field">
  582. <label>{{.i18n.Tr "repo.model.manage.modellabel"}}</label>
  583. <input style="width: 83%;margin-left: 7px;" id="label" name="label" maxlength="255"
  584. placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'>
  585. </div>
  586. <div class="inline fields">
  587. <label>{{.i18n.Tr "repo.model.manage.modelaccess"}}&nbsp;&nbsp;&nbsp;</label>
  588. <div class="field">
  589. <div class="ui radio checkbox">
  590. <input type="radio" name="isPrivate" checked="checked" value="false">
  591. <label>{{.i18n.Tr "repo.model.manage.modelaccess.public"}}</label>
  592. </div>
  593. </div>
  594. <div class="field">
  595. <div class="ui radio checkbox">
  596. <input type="radio" name="isPrivate" value="true">
  597. <label>{{.i18n.Tr "repo.model.manage.modelaccess.private"}}</label>
  598. </div>
  599. </div>
  600. </div>
  601. <div class="inline field">
  602. <label for="description">{{.i18n.Tr "repo.model.manage.modeldesc"}}</label>
  603. <textarea style="width: 83%;margin-left: 7px;" id="description" name="description" rows="3"
  604. maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}'
  605. onchange="this.value=this.value.substring(0, 255)"
  606. onkeydown="this.value=this.value.substring(0, 255)"
  607. onkeyup="this.value=this.value.substring(0, 256)"></textarea>
  608. </div>
  609. <div class="inline field" style="margin-left: 75px;">
  610. <button onclick="createModel()" type="button" class="ui create_train_job green button"
  611. style="position: absolute;">
  612. {{.i18n.Tr "repo.model.manage.sava_model"}}
  613. </button>
  614. </div>
  615. </form>
  616. <div class="actions" style="display: inline-block;margin-left: 180px;">
  617. <button class="ui button cancel">{{.i18n.Tr "repo.cloudbrain.cancel"}}</button>
  618. </div>
  619. </div>
  620. </div>
  621. </div>
  622. </div>
  623. {{template "base/footer" .}}
  624. <script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script>
  625. <script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js"></script>
  626. <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
  627. <script>
  628. var userName;
  629. var repoPath;
  630. $(document).ready(function(){
  631. var url = window.location.href;
  632. var urlArr = url.split('/')
  633. userName = urlArr.slice(-5)[0]
  634. repoPath = urlArr.slice(-4)[0]
  635. });
  636. var setting = {
  637. check: {
  638. enable: true,
  639. chkboxType: {"Y":"ps", "N":"ps"}
  640. },
  641. view: {
  642. dblClickExpand: false
  643. },
  644. callback: {
  645. beforeClick: beforeClick,
  646. onCheck: onCheck
  647. }
  648. };
  649. function beforeClick(treeId, treeNode) {
  650. var zTree = $.fn.zTree.getZTreeObj("treeDemo");
  651. zTree.checkNode(treeNode, !treeNode.checked, null, true);
  652. return false;
  653. }
  654. function onCheck(e, treeId, treeNode) {
  655. var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
  656. nodes = zTree.getCheckedNodes(true),
  657. v = "";
  658. for (var i=0, l=nodes.length; i<l; i++) {
  659. if(nodes[i].isParent){
  660. continue;
  661. }
  662. var pathNodes = nodes[i].getPath();
  663. var path ="";
  664. for(var j=0;j<pathNodes.length;j++){
  665. if(j ==0){
  666. path += pathNodes[j].name;
  667. }else{
  668. path += "/" + pathNodes[j].name;
  669. }
  670. }
  671. v += path + ";";
  672. }
  673. if (v.length > 0 ) v = v.substring(0, v.length-1);
  674. var cityObj = $("#modelSelectedFile");
  675. cityObj.attr("value", v);
  676. }
  677. function showMenu() {
  678. var cityObj = $("#modelSelectedFile");
  679. var cityOffset = $("#modelSelectedFile").offset();
  680. //$("#menuContent").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");
  681. $("#menuContent").slideDown("fast");
  682. $("body").bind("mousedown", onBodyDown);
  683. }
  684. function hideMenu() {
  685. $("#menuContent").fadeOut("fast");
  686. $("body").unbind("mousedown", onBodyDown);
  687. }
  688. function onBodyDown(event) {
  689. if (!(event.target.id == "menuBtn" || event.target.id == "modelSelectedFile" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
  690. hideMenu();
  691. }
  692. }
  693. let dirKey="isOnlyDir--:&";
  694. function loadSelectedModelFile(trainJob){
  695. console.log("trainJob=" + trainJob);
  696. $('#choice_file').dropdown('clear')
  697. $("#model-file").empty()
  698. if(trainJob ==null || trainJob ==""){
  699. console.log("trainJob is null");
  700. }else{
  701. $.get(`/${userName}/${repoPath}/modelmanage/query_train_model?jobName=${trainJob.JobName}&type=0&VersionName=${trainJob.VersionName}`, (data) => {
  702. const n_length = data.length
  703. let file_html=''
  704. let firstFileName =''
  705. var zNodes=[];
  706. var nodesMap={};
  707. for (let i=0;i<n_length;i++){
  708. var parentNodeMap = nodesMap;
  709. var fileSplits = data[i].FileName.split("/");
  710. for(let j=0;j < fileSplits.length;j++){
  711. if(fileSplits[j] == ""){
  712. break;
  713. }
  714. if(parentNodeMap[fileSplits[j]] == null){
  715. parentNodeMap[fileSplits[j]] = {};
  716. }
  717. parentNodeMap = parentNodeMap[fileSplits[j]];
  718. }
  719. }
  720. for (let i=0;i<n_length;i++){
  721. var parentNodeMap = nodesMap;
  722. var fileSplits = data[i].FileName.split("/");
  723. for(let j=0;j < fileSplits.length;j++){
  724. if(fileSplits[j] == ""){
  725. if(data[i].FileName[data[i].FileName.length -1] =="/"){
  726. if(Object.keys(parentNodeMap).length ==0){
  727. parentNodeMap[dirKey]="true";
  728. }
  729. }
  730. break;
  731. }
  732. parentNodeMap = parentNodeMap[fileSplits[j]];
  733. }
  734. }
  735. convertToNode(zNodes,nodesMap);
  736. $.fn.zTree.init($("#treeDemo"), setting, zNodes);
  737. })
  738. }
  739. }
  740. function convertToNode(nodeList,nodesMap){
  741. var keyList = Object.keys(nodesMap);
  742. keyList.sort(function(a,b){
  743. return a-b;
  744. });
  745. var isFirst = true;
  746. for(var i=0; i<keyList.length;i++){
  747. var node = {};
  748. node["name"] = keyList[i];
  749. nodeList.push(node);
  750. if(nodesMap[keyList[i]] != null && Object.keys(nodesMap[keyList[i]]).length >0){
  751. if(nodesMap[keyList[i]][dirKey] != null){
  752. node["open"] = false;
  753. node["isParent"] = true;
  754. }else{
  755. node["children"]=[];
  756. if(isFirst){
  757. node["open"] = true;
  758. isFirst= false;
  759. }
  760. convertToNode(node["children"],nodesMap[keyList[i]]);
  761. }
  762. }
  763. }
  764. }
  765. function showcreate(obj) {
  766. $('.ui.modal.second')
  767. .modal({
  768. centered: false,
  769. onShow: function () {
  770. $('input[name="version"]').addClass('model_disabled')
  771. $('#JobName').val(obj.DisplayJobName).addClass('model_disabled')
  772. $('input[name="jobId"]').val(obj.JobID)
  773. $('input[name="versionName"]').val("V0001")
  774. $('#choice_Engine .default.text').text("PyTorch");
  775. $('#choice_Engine input[name="engine"]').val(0)
  776. $('#choice_Engine .default.text').css({ "color": "rgb(0, 0, 0,0.87)" })
  777. $('.ui.dimmer').css({ "background-color": "rgb(136, 136, 136,0.7)" })
  778. createModelName();
  779. loadSelectedModelFile(obj);
  780. },
  781. onHide: function () {
  782. $('.ui.dimmer').css({ "background-color": "" })
  783. $('.ui.error.message').text()
  784. $('.ui.error.message').css('display', 'none')
  785. }
  786. })
  787. .modal('show')
  788. }
  789. function createModel() {
  790. if(!$('input#modelSelectedFile').val()){
  791. $('input#modelSelectedFile').parent().addClass('error')
  792. return
  793. }
  794. let url_href = `/${userName}/${repoPath}/modelmanage/create_new_model`
  795. let data = $("#formId").serialize()
  796. var radio = document.getElementsByName("isPrivate");
  797. if(radio == null || radio.length == 0){
  798. data +="&isPrivate=true";
  799. }
  800. $("#mask").css({ "display": "block", "z-index": "9999" })
  801. $.ajax({
  802. url: url_href,
  803. type: 'POST',
  804. data: data,
  805. success: function (res) {
  806. $('input[name="engine_name"]').val("");
  807. $('input[name="engine"]').val("");
  808. $('input[name="jobId"]').val("");
  809. $('input[name="label"]').val("");
  810. $('input[name="description"]').val("");
  811. var cityObj = $("#modelSelectedFile");
  812. cityObj.attr("value", "");
  813. document.getElementById("formId").reset();
  814. location.href = `/${userName}/${repoPath}/modelmanage/show_model`
  815. $('.ui.modal.second').modal('hide')
  816. },
  817. error: function (xhr) {
  818. // 隐藏 loading
  819. // 只有请求不正常(状态码不为200)才会执行
  820. $('.ui.error.message').text(xhr.responseText)
  821. $('.ui.error.message').css('display', 'block')
  822. },
  823. complete: function (xhr) {
  824. $("#mask").css({ "display": "none", "z-index": "1" })
  825. }
  826. })
  827. }
  828. function createModelName() {
  829. let repoName = location.pathname.split('/')[2]
  830. let modelName = repoName + '_model_' + Math.random().toString(36).substr(2, 4)
  831. $('#name').val(modelName)
  832. $('#version').val("0.0.1")
  833. }
  834. $('.menu .item').tab()
  835. $(document).ready(function () {
  836. $('.ui.accordion').accordion({ selector: { trigger: '.icon' } });
  837. });
  838. $(document).ready(function () {
  839. $('.secondary.menu .item').tab();
  840. });
  841. ;(function() {
  842. var SPEC = {{ .Spec }};
  843. var showPoint = false;
  844. var specStr = window.renderSpecStr(SPEC, showPoint, {
  845. gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}},
  846. free: {{$.i18n.Tr "cloudbrain.free"}},
  847. point_hr: {{$.i18n.Tr "cloudbrain.point_hr"}},
  848. memory: {{$.i18n.Tr "cloudbrain.memory"}},
  849. shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}},
  850. });
  851. $('td.ti-text-form-content.spec div').text(specStr);
  852. SPEC && $('td.ti-text-form-content.resorce_type div').text(getListValueWithKey(ACC_CARD_TYPE, SPEC.AccCardType));
  853. })();
  854. </script>