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 23 kB

4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. {{template "base/head" .}}
  2. <style>
  3. .according-panel-heading{
  4. box-sizing: border-box;
  5. padding: 8px 16px;
  6. color: #252b3a;
  7. background-color: #f2f5fc;
  8. line-height: 1.5;
  9. cursor: pointer;
  10. -moz-user-select: none;
  11. -webkit-user-select: none;
  12. -ms-user-select: none;
  13. -khtml-user-select: none;
  14. user-select: none;
  15. }
  16. .accordion-panel-title {
  17. margin-top: 0;
  18. margin-bottom: 0;
  19. color: #252b3a;
  20. }
  21. .accordion-panel-title-content{
  22. vertical-align: middle;
  23. display: inline-block;
  24. width: calc(100% - 32px);
  25. cursor: default;
  26. }
  27. .acc-margin-bottom {
  28. margin-bottom: 5px;
  29. }
  30. .title_text {
  31. font-size: 12px;
  32. }
  33. .ac-display-inblock {
  34. display: inline-block;
  35. }
  36. .cti-mgRight-sm {
  37. margin-right: 8px;
  38. }
  39. .ac-text-normal {
  40. font-size: 14px;
  41. color: #575d6c;
  42. }
  43. .uc-accordionTitle-black {
  44. color: #333;
  45. }
  46. .accordion-border{
  47. border:1px solid #cce2ff;
  48. }
  49. .padding0{
  50. padding: 0 !important;
  51. }
  52. .content-pad{
  53. padding: 15px 35px;
  54. }
  55. .content-margin{
  56. margin:10px 5px ;
  57. }
  58. .tab_2_content {
  59. min-height: 560px;
  60. margin-left: 10px;
  61. }
  62. .ac-grid {
  63. display: block;
  64. *zoom: 1;
  65. }
  66. .ac-grid-col {
  67. float: left;
  68. width: 100%;
  69. }
  70. .ac-grid-col2 .ac-grid-col {
  71. width: 50%;
  72. }
  73. .ti-form {
  74. text-align: left;
  75. max-width: 100%;
  76. vertical-align: middle;
  77. }
  78. .ti-form>tbody {
  79. font-size: 12px;
  80. }
  81. .ti-form>tbody, .ti-form>tbody>tr {
  82. vertical-align: inherit;
  83. }
  84. .info_text {
  85. padding-bottom: 20px;
  86. padding-right: 20px;
  87. font-size: 12px;
  88. }
  89. .ti-text-form-label {
  90. padding-bottom: 20px;
  91. padding-right: 20px;
  92. color: #8a8e99;
  93. font-size: 12px;
  94. white-space: nowrap !important;
  95. width: 80px;
  96. line-height: 30px;
  97. }
  98. .ti-text-form-content{
  99. line-height: 30px;
  100. padding-bottom: 20px;
  101. }
  102. .ti-form>tbody>tr>td {
  103. vertical-align: top;
  104. white-space: normal;
  105. }
  106. td, th {
  107. padding: 0;
  108. }
  109. .ac-grid-col .text-span {
  110. width: 450px;
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. white-space: nowrap;
  114. }
  115. .redo-color{
  116. color: #3291F8;
  117. }
  118. .ti-action-menu-item:not(:last-child){
  119. margin-right: 10px;
  120. padding-right: 11px;
  121. text-decoration: none!important;
  122. color: #526ecc;
  123. cursor: pointer;
  124. display: inline-block;
  125. -moz-user-select: none;
  126. -webkit-user-select: none;
  127. -ms-user-select: none;
  128. -khtml-user-select: none;
  129. user-select: none;
  130. position: relative;
  131. }
  132. .ti-action-menu-item:not(:last-child):after {
  133. content: "";
  134. display: inline-block;
  135. position: absolute;
  136. height: 12px;
  137. right: 0;
  138. top: 50%;
  139. -webkit-transform: translateY(-6px);
  140. -ms-transform: translateY(-6px);
  141. -o-transform: translateY(-6px);
  142. transform: translateY(-6px);
  143. border-right: 1px solid #dfe1e6;
  144. }
  145. .text-width80{
  146. width: 100px;
  147. line-height: 30px;
  148. }
  149. .border-according{
  150. border: 1px solid #dfe1e6;
  151. }
  152. .disabled {
  153. cursor: default;
  154. pointer-events: none;
  155. color: rgba(0,0,0,.6) !important;
  156. opacity: .45 !important;
  157. }
  158. .pad20{
  159. border:0px !important;
  160. }
  161. .model_file_bread{
  162. margin-bottom: -0.5rem !important;
  163. padding-left: 1rem;
  164. padding-top: 0.5rem ;
  165. }
  166. </style>
  167. <div id="mask">
  168. <div id="loadingPage">
  169. <div class="rect1"></div>
  170. <div class="rect2"></div>
  171. <div class="rect3"></div>
  172. <div class="rect4"></div>
  173. <div class="rect5"></div>
  174. </div>
  175. </div>
  176. <div class="repository">
  177. {{template "repo/header" .}}
  178. <div class="ui container">
  179. <h4 class="ui header" id="vertical-segment">
  180. <div class="ui breadcrumb">
  181. <a class="section" href="{{.RepoLink}}/debugjob?debugListType=all">
  182. {{.i18n.Tr "repo.cloudbrain"}}
  183. </a>
  184. <div class="divider"> / </div>
  185. <a class="section backTodeBug" href="{{.RepoLink}}/debugjob?debugListType={{if eq $.debugListType "NPU"}}NPU{{else if eq $.debugListType "CPU/GPU"}}CPU/GPU{{else}}all{{end}}">
  186. {{$.i18n.Tr "repo.modelarts.notebook"}}
  187. </a>
  188. <div class="divider"> / </div>
  189. <div class="active section">{{.displayJobName}}</div>
  190. </div>
  191. </h4>
  192. {{range $k ,$v := .version_list_task}}
  193. <div class="ui accordion border-according" id="accordion{{.VersionName}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}" data-version="{{.VersionName}}">
  194. <input type="hidden" id="jobId_input" name="jobId_input" value="{{.JobID}}">
  195. <div class="{{if eq $k 0}}active{{end}} title padding0">
  196. <div class="according-panel-heading">
  197. <div class="accordion-panel-title">
  198. <!--<i class="dropdown icon"></i> -->
  199. <span class="accordion-panel-title-content">
  200. <span>
  201. <div class="ac-display-inblock title_text acc-margin-bottom">
  202. <span class="cti-mgRight-sm">
  203. {{if not (eq .StartTime 0)}}
  204. <td>{{TimeSinceUnix1 .StartTime}}</td>
  205. {{else}}
  206. <td>{{TimeSinceUnix1 .CreatedUnix}}<td>
  207. {{end}}
  208. </span>
  209. <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}:
  210. <span id="{{.VersionName}}-status-span"><i id="icon" style="vertical-align: middle;" class="{{.Status}}"></i><span id="text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
  211. </span>
  212. <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span>
  213. <span class="cti-mgRight-sm uc-accordionTitle-black" id="{{.VersionName}}-duration-span">{{$.duration}}</span>
  214. </div>
  215. </span>
  216. </span>
  217. </div>
  218. </div>
  219. </div>
  220. <div class="{{if eq $k 0}}active{{end}} content">
  221. <div class="content-pad">
  222. <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);">
  223. <a class="active item" data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
  224. <a class="item" data-tab="second{{$k}}">{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a>
  225. </div>
  226. <div class="ui tab active" data-tab="first{{$k}}">
  227. <div style="padding-top: 10px;">
  228. <div class="tab_2_content">
  229. <div class="ac-grid ac-grid-col2">
  230. <div class="ac-grid-col">
  231. <table class="ti-form">
  232. <tbody class="ti-text-form">
  233. <tr class="ti-no-ng-animate">
  234. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  235. {{$.i18n.Tr "repo.cloudbrain_task"}}
  236. </td>
  237. <td class="ti-text-form-content">
  238. <div class="text-span text-span-w">
  239. {{.DisplayJobName}}
  240. </div>
  241. </td>
  242. </tr>
  243. <tr class="ti-no-ng-animate">
  244. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  245. {{$.i18n.Tr "repo.modelarts.status"}}
  246. </td>
  247. <td class="ti-text-form-content">
  248. <div class="text-span text-span-w" id="{{.VersionName}}-status">
  249. {{.Status}}
  250. </div>
  251. </td>
  252. </tr>
  253. <tr class="ti-no-ng-animate">
  254. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  255. {{$.i18n.Tr "repo.modelarts.train_job.start_time"}}
  256. </td>
  257. <td class="ti-text-form-content">
  258. <div class="text-span text-span-w">
  259. <span style="font-size: 12px;" class="">
  260. {{if not (eq .StartTime 0)}}
  261. {{TimeSinceUnix1 .StartTime}}
  262. {{else}}
  263. {{TimeSinceUnix1 .CreatedUnix}}
  264. {{end}}
  265. </span>
  266. </div>
  267. </td>
  268. </tr>
  269. <tr class="ti-no-ng-animate">
  270. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  271. {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}
  272. </td>
  273. <td class="ti-text-form-content">
  274. <div class="text-span text-span-w" id="{{.VersionName}}-duration">
  275. {{$.duration}}
  276. </div>
  277. </td>
  278. </tr>
  279. <tr class="ti-no-ng-animate">
  280. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  281. {{$.i18n.Tr "cloudbrain.mirror"}}
  282. </td>
  283. <td class="ti-text-form-content">
  284. <div class="text-span text-span-w" id="{{.VersionName}}-mirror">
  285. {{.Image}}
  286. </div>
  287. </td>
  288. </tr>
  289. <tr class="ti-no-ng-animate">
  290. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  291. {{$.i18n.Tr "cloudbrain.dataset_storage_path"}}
  292. </td>
  293. <td class="ti-text-form-content">
  294. <div class="text-span text-span-w" id="dataset_storage_path">
  295. {{$.dataset_path}}
  296. </div>
  297. </td>
  298. </tr>
  299. <tr class="ti-no-ng-animate">
  300. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  301. {{$.i18n.Tr "cloudbrain.code_storage_path"}}
  302. </td>
  303. <td class="ti-text-form-content">
  304. <div class="text-span text-span-w" id="code_storage_path">
  305. {{$.code_path}}
  306. </div>
  307. </td>
  308. </tr>
  309. </tbody>
  310. </table>
  311. </div>
  312. <div class="ac-grid-col">
  313. <table class="ti-form">
  314. <tbody class="ti-text-form">
  315. <tr class="ti-no-ng-animate">
  316. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  317. {{$.i18n.Tr "cloudbrain.gpu_type"}}
  318. </td>
  319. <td class="ti-text-form-content">
  320. <div class="text-span text-span-w">
  321. {{$.resource_type}}
  322. </div>
  323. </td>
  324. </tr>
  325. <tr class="ti-no-ng-animate">
  326. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  327. ExitCode
  328. </td>
  329. <td class="ti-text-form-content">
  330. <div class="text-span text-span-w">
  331. {{$.result.JobStatus.AppExitCode}}
  332. </div>
  333. </td>
  334. </tr>
  335. <tr class="ti-no-ng-animate">
  336. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  337. {{$.i18n.Tr "repo.cloudbrain.endtime"}}
  338. </td>
  339. <td class="ti-text-form-content">
  340. <div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName">
  341. {{if not (eq .EndTime 0)}}
  342. {{TimeSinceUnix1 .EndTime}}
  343. {{else}}
  344. --
  345. {{end}}
  346. </div>
  347. </td>
  348. </tr>
  349. <tr class="ti-no-ng-animate">
  350. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  351. {{$.i18n.Tr "repo.modelarts.train_job.dataset"}}
  352. </td>
  353. <td class="ti-text-form-content">
  354. <div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName">
  355. {{$.datasetname}}
  356. </div>
  357. </td>
  358. </tr>
  359. <tr class="ti-no-ng-animate">
  360. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  361. {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
  362. </td>
  363. <td class="ti-text-form-content">
  364. <div class="text-span text-span-w">
  365. {{$.i18n.Tr "cloudbrain.gpu_num"}}:{{$.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{$.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{$.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{$.ShareMemMiB}}
  366. </div>
  367. </td>
  368. </tr>
  369. <tr class="ti-no-ng-animate">
  370. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  371. {{$.i18n.Tr "repo.cloudbrain_creator"}}
  372. </td>
  373. <td class="ti-text-form-content">
  374. <div class="text-span text-span-w" id="{{.VersionName}}-mirror">
  375. {{.User.Name}}
  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 "cloudbrain.model_storage_path"}}
  382. </td>
  383. <td class="ti-text-form-content">
  384. <div class="text-span text-span-w" id="model_storage_path">
  385. {{$.model_path}}
  386. </div>
  387. </td>
  388. </tr>
  389. </tbody>
  390. </table>
  391. </div>
  392. </div>
  393. <div class="ac-grid ac-grid-col2">
  394. <div class="ac-grid-col">
  395. <span class="ti-text-form-label">{{$.i18n.Tr "repo.cloudbrain.exitinfo"}}</span>
  396. </div>
  397. </div>
  398. <div class="ac-grid-col">
  399. <span class="info_text">
  400. {{$.result.JobStatus.AppExitDiagnostics}}
  401. </span>
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. <div class="ui tab" data-tab="second{{$k}}">
  407. <div>
  408. <div class="ui message message{{.VersionName}}" style="display: none;">
  409. <div id="header"></div>
  410. </div>
  411. <div class="ui attached log" id="log{{.VersionName}}" style="height: 300px !important; overflow: auto;">
  412. <span class="info_text">
  413. {{$.result.JobStatus.AppExitDiagnostics}}
  414. </span>
  415. </div>
  416. </div>
  417. </div>
  418. </div>
  419. </div>
  420. </div>
  421. {{end}} {{template "base/paginate" .}}
  422. </div>
  423. <!-- 确认模态框 -->
  424. <div id="deletemodel">
  425. <div class="ui basic modal">
  426. <div class="ui icon header">
  427. <i class="trash icon"></i> {{.i18n.Tr "cloudbrain.delete_task"}}
  428. </div>
  429. <div class="content">
  430. <p>{{.i18n.Tr "cloudbrain.task_delete_confirm"}}</p>
  431. </div>
  432. <div class="actions">
  433. <div class="ui red basic inverted cancel button">
  434. <i class="remove icon"></i> {{.i18n.Tr "cloudbrain.operate_cancel"}}
  435. </div>
  436. <div class="ui green basic inverted ok button">
  437. <i class="checkmark icon"></i> {{.i18n.Tr "cloudbrain.operate_confirm"}}
  438. </div>
  439. </div>
  440. </div>
  441. </div>
  442. </div>
  443. {{template "base/footer" .}}
  444. <script>
  445. $('.menu .item').tab()
  446. $(document).ready(function(){
  447. $('.ui.accordion').accordion({selector:{trigger:'.icon'}});
  448. });
  449. $(document).ready(function(){
  450. $('.secondary.menu .item').tab();
  451. });
  452. let userName
  453. let repoPath
  454. let jobName
  455. $(document).ready(function(){
  456. let url = window.location.href;
  457. let urlArr = url.split('/')
  458. userName = urlArr.slice(-5)[0]
  459. repoPath = urlArr.slice(-4)[0]
  460. jobName = urlArr.slice(-1)[0]
  461. })
  462. function loadLog(version_name){
  463. document.getElementById("mask").style.display = "block"
  464. $.get(`/api/v1/repos/${userName}/${repoPath}/cloudbrain/${jobName}/log?version_name=${version_name}&lines=50&order=asc`, (data) => {
  465. $('input[name=end_line]').val(data.EndLine)
  466. $('input[name=start_line]').val(data.StartLine)
  467. $(`#log_file${version_name}`).text(data.Content)
  468. document.getElementById("mask").style.display = "none"
  469. }).fail(function(err) {
  470. console.log(err);
  471. document.getElementById("mask").style.display = "none"
  472. });
  473. }
  474. </script>