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

3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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: 360px;
  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. .ti-text-form-label {
  85. padding-bottom: 20px;
  86. padding-right: 20px;
  87. color: #8a8e99;
  88. font-size: 12px;
  89. white-space: nowrap !important;
  90. width: 80px;
  91. line-height: 30px;
  92. }
  93. .ti-text-form-content{
  94. line-height: 30px;
  95. padding-bottom: 20px;
  96. }
  97. .ti-form>tbody>tr>td {
  98. vertical-align: top;
  99. white-space: normal;
  100. }
  101. td, th {
  102. padding: 0;
  103. }
  104. .ac-grid-col .text-span {
  105. width: 450px;
  106. overflow: hidden;
  107. text-overflow: ellipsis;
  108. white-space: nowrap;
  109. }
  110. .redo-color{
  111. color: #3291F8;
  112. }
  113. .ti-action-menu-item:not(:last-child){
  114. margin-right: 10px;
  115. padding-right: 11px;
  116. text-decoration: none!important;
  117. color: #526ecc;
  118. cursor: pointer;
  119. display: inline-block;
  120. -moz-user-select: none;
  121. -webkit-user-select: none;
  122. -ms-user-select: none;
  123. -khtml-user-select: none;
  124. user-select: none;
  125. position: relative;
  126. }
  127. .ti-action-menu-item:not(:last-child):after {
  128. content: "";
  129. display: inline-block;
  130. position: absolute;
  131. height: 12px;
  132. right: 0;
  133. top: 50%;
  134. -webkit-transform: translateY(-6px);
  135. -ms-transform: translateY(-6px);
  136. -o-transform: translateY(-6px);
  137. transform: translateY(-6px);
  138. border-right: 1px solid #dfe1e6;
  139. }
  140. .text-width80{
  141. width: 100px;
  142. line-height: 30px;
  143. }
  144. .border-according{
  145. border: 1px solid #dfe1e6;
  146. }
  147. .disabled {
  148. cursor: default;
  149. pointer-events: none;
  150. color: rgba(0,0,0,.6) !important;
  151. opacity: .45 !important;
  152. }
  153. .pad20{
  154. border:0px !important;
  155. }
  156. .model_file_bread{
  157. margin-bottom: -0.5rem !important;
  158. padding-left: 1rem;
  159. padding-top: 0.5rem ;
  160. }
  161. </style>
  162. <div id="mask">
  163. <div id="loadingPage">
  164. <div class="rect1"></div>
  165. <div class="rect2"></div>
  166. <div class="rect3"></div>
  167. <div class="rect4"></div>
  168. <div class="rect5"></div>
  169. </div>
  170. </div>
  171. <div class="repository">
  172. {{template "repo/header" .}}
  173. <div class="ui container">
  174. <h4 class="ui header" id="vertical-segment">
  175. <div class="ui breadcrumb">
  176. <a class="section" href="{{.RepoLink}}/debugjob?debugListType=all">
  177. {{.i18n.Tr "repo.cloudbrain"}}
  178. </a>
  179. <div class="divider"> / </div>
  180. <a class="section" href="{{$.RepoLink}}/cloudbrain/benchmark">
  181. {{$.i18n.Tr "repo.modelarts.evaluate_job"}}
  182. </a>
  183. <div class="divider"> / </div>
  184. <div class="active section">{{.jobName}}</div>
  185. </div>
  186. </h4>
  187. {{range $k ,$v := .version_list_task}}
  188. <div class="ui accordion border-according" id="accordion{{.VersionName}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}" data-version="{{.VersionName}}">
  189. <div class="{{if eq $k 0}}active{{end}} title padding0">
  190. <div class="according-panel-heading">
  191. <div class="accordion-panel-title">
  192. <i class="dropdown icon"></i>
  193. <span class="accordion-panel-title-content">
  194. <span>
  195. <div class="ac-display-inblock title_text acc-margin-bottom">
  196. <span class="cti-mgRight-sm">{{TimeSinceUnix1 .CreatedUnix}}</span>
  197. <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}:
  198. <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>
  199. </span>
  200. <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span>
  201. <span class="cti-mgRight-sm uc-accordionTitle-black" id="{{.VersionName}}-duration-span">{{$.duration}}</span>
  202. </div>
  203. </span>
  204. </span>
  205. </div>
  206. </div>
  207. </div>
  208. <div class="{{if eq $k 0}}active{{end}} content">
  209. <div class="content-pad">
  210. <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);">
  211. <a class="active item" data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
  212. <a class="item" data-tab="second{{$k}}" onclick="loadLog({{.VersionName}})">{{$.i18n.Tr "repo.modelarts.log"}}</a>
  213. </div>
  214. <div class="ui tab active" data-tab="first{{$k}}">
  215. <div style="padding-top: 10px;">
  216. <div class="tab_2_content">
  217. <div class="ac-grid ac-grid-col2">
  218. <div class="ac-grid-col">
  219. <table class="ti-form">
  220. <tbody class="ti-text-form">
  221. <tr class="ti-no-ng-animate">
  222. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  223. {{$.i18n.Tr "repo.cloudbrain_task"}}
  224. </td>
  225. <td class="ti-text-form-content">
  226. <div class="text-span text-span-w">
  227. {{.JobName}}
  228. </div>
  229. </td>
  230. </tr>
  231. <tr class="ti-no-ng-animate">
  232. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  233. {{$.i18n.Tr "repo.modelarts.status"}}
  234. </td>
  235. <td class="ti-text-form-content">
  236. <div class="text-span text-span-w" id="{{.VersionName}}-status">
  237. {{.Status}}
  238. </div>
  239. </td>
  240. </tr>
  241. <tr class="ti-no-ng-animate">
  242. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  243. {{$.i18n.Tr "repo.modelarts.train_job.start_time"}}
  244. </td>
  245. <td class="ti-text-form-content">
  246. <div class="text-span text-span-w">
  247. <span style="font-size: 12px;" class="">{{TimeSinceUnix1 .CreatedUnix}}</span>
  248. </div>
  249. </td>
  250. </tr>
  251. <tr class="ti-no-ng-animate">
  252. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  253. {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}
  254. </td>
  255. <td class="ti-text-form-content">
  256. <div class="text-span text-span-w" id="{{.VersionName}}-duration">
  257. {{$.duration}}
  258. </div>
  259. </td>
  260. </tr>
  261. <tr class="ti-no-ng-animate">
  262. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  263. 镜像
  264. </td>
  265. <td class="ti-text-form-content">
  266. <div class="text-span text-span-w" id="{{.VersionName}}-mirror">
  267. {{.Image}}
  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. 类型
  274. </td>
  275. <td class="ti-text-form-content">
  276. <div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName">
  277. {{$.BenchmarkTypeName}}
  278. </div>
  279. </td>
  280. </tr>
  281. </tbody>
  282. </table>
  283. </div>
  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. 训练程序
  290. </td>
  291. <td class="ti-text-form-content">
  292. <div class="text-span text-span-w">
  293. train.py
  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. 测试程序
  300. </td>
  301. <td class="ti-text-form-content">
  302. <div class="text-span text-span-w">
  303. test.py
  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.train_job.description"}}
  310. </td>
  311. <td class="ti-text-form-content">
  312. <div class="text-span text-span-w" title="{{.Description}}">
  313. {{.Description}}
  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.standard"}}
  320. </td>
  321. <td class="ti-text-form-content">
  322. <div class="text-span text-span-w">
  323. {{$.resource_spec}}
  324. </div>
  325. </td>
  326. </tr>
  327. <tr class="ti-no-ng-animate">
  328. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  329. 创建者
  330. </td>
  331. <td class="ti-text-form-content">
  332. <div class="text-span text-span-w" id="{{.VersionName}}-mirror">
  333. {{.User.Name}}
  334. </div>
  335. </td>
  336. </tr>
  337. <tr class="ti-no-ng-animate">
  338. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  339. 子类型
  340. </td>
  341. <td class="ti-text-form-content">
  342. <div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkChildTypeName">
  343. {{$.BenchmarkChildTypeName}}
  344. </div>
  345. </td>
  346. </tr>
  347. </tbody>
  348. </table>
  349. </div>
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. <div class="ui tab" data-tab="second{{$k}}">
  355. <div>
  356. <div class="ui message message{{.VersionName}}" style="display: none;">
  357. <div id="header"></div>
  358. </div>
  359. <div class="ui attached log" id="log{{.VersionName}}" style="height: 300px !important; overflow: auto;">
  360. <input type="hidden" name="end_line" value>
  361. <input type="hidden" name="start_line" value>
  362. <pre id="log_file{{.VersionName}}"></pre>
  363. </div>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. </div>
  369. {{end}} {{template "base/paginate" .}}
  370. </div>
  371. <!-- 确认模态框 -->
  372. <div id="deletemodel">
  373. <div class="ui basic modal">
  374. <div class="ui icon header">
  375. <i class="trash icon"></i> 删除任务
  376. </div>
  377. <div class="content">
  378. <p>你确认删除该任务么?此任务一旦删除不可恢复。</p>
  379. </div>
  380. <div class="actions">
  381. <div class="ui red basic inverted cancel button">
  382. <i class="remove icon"></i> 取消操作
  383. </div>
  384. <div class="ui green basic inverted ok button">
  385. <i class="checkmark icon"></i> 确定操作
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. </div>
  391. {{template "base/footer" .}}
  392. <script>
  393. $('.menu .item').tab()
  394. $(document).ready(function(){
  395. $('.ui.accordion').accordion({selector:{trigger:'.icon'}});
  396. });
  397. $(document).ready(function(){
  398. $('.secondary.menu .item').tab();
  399. });
  400. let userName
  401. let repoPath
  402. let jobID
  403. $(document).ready(function(){
  404. let url = window.location.href;
  405. let urlArr = url.split('/')
  406. userName = urlArr.slice(-5)[0]
  407. repoPath = urlArr.slice(-4)[0]
  408. jobID = urlArr.slice(-1)[0]
  409. })
  410. function loadLog(version_name){
  411. document.getElementById("mask").style.display = "block"
  412. $.get(`/api/v1/repos/${userName}/${repoPath}/cloudbrain/${jobID}/log?version_name=${version_name}&lines=50&order=asc`, (data) => {
  413. $('input[name=end_line]').val(data.EndLine)
  414. $('input[name=start_line]').val(data.StartLine)
  415. $(`#log_file${version_name}`).text(data.Content)
  416. document.getElementById("mask").style.display = "none"
  417. }).fail(function(err) {
  418. console.log(err);
  419. document.getElementById("mask").style.display = "none"
  420. });
  421. }
  422. </script>