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

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  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: 600px;
  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,
  82. .ti-form>tbody>tr {
  83. vertical-align: inherit;
  84. }
  85. .ti-text-form-label {
  86. padding-bottom: 20px;
  87. padding-right: 20px;
  88. color: #8a8e99;
  89. font-size: 12px;
  90. white-space: nowrap !important;
  91. width: 80px;
  92. line-height: 30px;
  93. }
  94. .ti-text-form-content {
  95. line-height: 30px;
  96. padding-bottom: 20px;
  97. }
  98. .ti-form>tbody>tr>td {
  99. vertical-align: top;
  100. white-space: normal;
  101. }
  102. td,
  103. th {
  104. padding: 0;
  105. }
  106. .ac-grid-col .text-span {
  107. width: 450px;
  108. overflow: hidden;
  109. text-overflow: ellipsis;
  110. white-space: nowrap;
  111. }
  112. .redo-color {
  113. color: #3291F8;
  114. }
  115. .ti-action-menu-item:not(:last-child) {
  116. margin-right: 10px;
  117. padding-right: 11px;
  118. text-decoration: none !important;
  119. color: #526ecc;
  120. cursor: pointer;
  121. display: inline-block;
  122. -moz-user-select: none;
  123. -webkit-user-select: none;
  124. -ms-user-select: none;
  125. -khtml-user-select: none;
  126. user-select: none;
  127. position: relative;
  128. }
  129. .ti-action-menu-item:not(:last-child):after {
  130. content: "";
  131. display: inline-block;
  132. position: absolute;
  133. height: 12px;
  134. right: 0;
  135. top: 50%;
  136. -webkit-transform: translateY(-6px);
  137. -ms-transform: translateY(-6px);
  138. -o-transform: translateY(-6px);
  139. transform: translateY(-6px);
  140. border-right: 1px solid #dfe1e6;
  141. }
  142. .text-width80 {
  143. width: 100px;
  144. line-height: 30px;
  145. }
  146. .border-according {
  147. border: 1px solid #dfe1e6;
  148. }
  149. .disabled {
  150. cursor: default;
  151. pointer-events: none;
  152. color: rgba(0, 0, 0, .6) !important;
  153. opacity: .45 !important;
  154. }
  155. .pad20 {
  156. border: 0px !important;
  157. }
  158. .model_file_bread {
  159. margin-bottom: -0.5rem !important;
  160. padding-left: 1rem;
  161. padding-top: 0.5rem;
  162. }
  163. </style>
  164. <div id="mask">
  165. <div id="loadingPage">
  166. <div class="rect1"></div>
  167. <div class="rect2"></div>
  168. <div class="rect3"></div>
  169. <div class="rect4"></div>
  170. <div class="rect5"></div>
  171. </div>
  172. </div>
  173. <div class="repository">
  174. {{template "repo/header" .}}
  175. <div class="ui container">
  176. <h4 class="ui header" id="vertical-segment">
  177. <div class="ui breadcrumb">
  178. <a class="section" href="{{.RepoLink}}/debugjob?debugListType=all">
  179. {{$.i18n.Tr "repo.cloudbrain"}}
  180. </a>
  181. <div class="divider"> / </div>
  182. <a class="section" href="{{$.RepoLink}}/cloudbrain/benchmark">
  183. {{$.i18n.Tr "repo.modelarts.evaluate_job"}}
  184. </a>
  185. <div class="divider"> / </div>
  186. <div class="active section" vfield="DisplayJobName"></div>
  187. </div>
  188. </h4>
  189. <div class="ui accordion border-according" id="accordion" data-repopath="{{$.RepoRelPath}}/modelsafety" data-jobid="" vdatajobid="ID" data-version="">
  190. <input type="hidden" id="jobId_input" name="jobId_input" value="" vvalue="JobID">
  191. <div class="active title padding0">
  192. <div class="according-panel-heading">
  193. <div class="accordion-panel-title">
  194. <i class="dropdown icon"></i>
  195. <span class="accordion-panel-title-content">
  196. <span>
  197. <div class="ac-display-inblock title_text acc-margin-bottom">
  198. <span class="cti-mgRight-sm">
  199. <span vtime="CreatedUnix"></span>
  200. </span>
  201. <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}:
  202. <span id="-status-span">
  203. <i id="icon" style="vertical-align: middle;" class="{{.Status}}" vclass="Status"></i>
  204. <span id="text" style="margin-left: 0.4em;font-size: 12px;" vfield="Status"></span>
  205. </span>
  206. </span>
  207. <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span>
  208. <span class="cti-mgRight-sm uc-accordionTitle-black" id="-duration-span" vfield="TrainJobDuration"></span>
  209. </div>
  210. </span>
  211. </span>
  212. </div>
  213. </div>
  214. </div>
  215. <div class="active content">
  216. <div class="content-pad">
  217. <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);">
  218. <a class="active item" data-tab="first0">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
  219. <a class="item log_bottom" data-tab="second0" data-version="">{{$.i18n.Tr "repo.modelarts.log"}}</a>
  220. <a class="item" data-tab="third0" data-version="">{{.i18n.Tr "modelsafety.evaluation_result"}}</a>
  221. </div>
  222. <div class="ui tab active" data-tab="first0">
  223. <div style="padding-top: 10px;">
  224. <div class="tab_2_content">
  225. <div class="ac-grid ac-grid-col2">
  226. <div class="ac-grid-col">
  227. <table class="ti-form">
  228. <tbody class="ti-text-form">
  229. <tr class="ti-no-ng-animate">
  230. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  231. {{$.i18n.Tr "repo.cloudbrain_task"}}
  232. </td>
  233. <td class="ti-text-form-content">
  234. <div class="text-span text-span-w" vfield="DisplayJobName"></div>
  235. </td>
  236. </tr>
  237. <tr class="ti-no-ng-animate">
  238. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  239. {{$.i18n.Tr "repo.modelarts.status"}}
  240. </td>
  241. <td class="ti-text-form-content">
  242. <div class="text-span text-span-w" id="-status" vfield="Status"></div>
  243. </td>
  244. </tr>
  245. <tr class="ti-no-ng-animate">
  246. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  247. {{$.i18n.Tr "repo.modelarts.createtime"}}
  248. </td>
  249. <td class="ti-text-form-content">
  250. <div class="text-span text-span-w">
  251. <span style="font-size: 12px;" class="v-field" vtime="CreatedUnix"></span>
  252. </div>
  253. </td>
  254. </tr>
  255. <tr class="ti-no-ng-animate">
  256. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  257. {{$.i18n.Tr "repo.cloudbrain.time.starttime"}}
  258. </td>
  259. <td class="ti-text-form-content">
  260. <div class="text-span text-span-w v-field" vtime="StartTime" id="-startTime"></div>
  261. </td>
  262. </tr>
  263. <tr class="ti-no-ng-animate">
  264. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  265. {{$.i18n.Tr "repo.cloudbrain.time.endtime"}}
  266. </td>
  267. <td class="ti-text-form-content">
  268. <div class="text-span text-span-w v-field" vtime="EndTime" id="-EndTime"></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.train_job.dura_time"}}
  274. </td>
  275. <td class="ti-text-form-content">
  276. <div class="text-span text-span-w" vfield="TrainJobDuration" id="-duration"></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" vimagetitle="Image">
  281. <span style="display:none;">{{$.i18n.Tr "cloudbrain.mirror"}}</span>
  282. <span style="display:none;">{{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}}</span>
  283. </td>
  284. <td class="ti-text-form-content">
  285. <div class="text-span text-span-w" id="-mirror">
  286. <span class="ui poping up clipboard" data-position="top center" id="clipboard-btn" style="cursor:pointer"
  287. data-clipboard-text="{{.Image}}"
  288. data-success="{{$.i18n.Tr "repo.copied"}}"
  289. data-error="{{$.i18n.Tr "repo.copied_error"}}"
  290. data-content="{{$.i18n.Tr "repo.copy"}}"
  291. data-variation="inverted tiny"
  292. vdataclipboardtext="Image"
  293. >
  294. <span vtitle="Image" vimage="Image" ></span></span>
  295. </div>
  296. </td>
  297. </tr>
  298. <tr class="ti-no-ng-animate">
  299. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  300. {{$.i18n.Tr "repo.cloudbrain.benchmark.evaluate_scenes"}}
  301. </td>
  302. <td class="ti-text-form-content">
  303. <div class="text-span text-span-w" vfield="BenchmarkType"></div>
  304. </td>
  305. </tr>
  306. <tr class="ti-no-ng-animate">
  307. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  308. {{$.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}}
  309. </td>
  310. <td class="ti-text-form-content">
  311. <div class="text-span text-span-w" vfield="BenchmarkTypeName"></div>
  312. </td>
  313. </tr>
  314. <tr class="ti-no-ng-animate">
  315. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  316. {{.i18n.Tr "modelsafety.base_data_set"}}
  317. </td>
  318. <td class="ti-text-form-content">
  319. <div class="text-span text-span-w" vdataset0="DatasetName"></div>
  320. </td>
  321. </tr>
  322. <tr class="ti-no-ng-animate">
  323. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  324. {{.i18n.Tr "modelsafety.combat_data_set"}}
  325. </td>
  326. <td class="ti-text-form-content">
  327. <div class="text-span text-span-w" vdataset1="DatasetName"></div>
  328. </td>
  329. </tr>
  330. <tr class="ti-no-ng-animate">
  331. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  332. {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}}
  333. </td>
  334. <td class="ti-text-form-content">
  335. <div class="text-span text-span-w" vtitle="Parameters" vfield="Parameters"></div>
  336. </td>
  337. </tr>
  338. </tbody>
  339. </table>
  340. </div>
  341. <div class="ac-grid-col">
  342. <table class="ti-form">
  343. <tbody class="ti-text-form">
  344. <tr class="ti-no-ng-animate">
  345. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  346. {{$.i18n.Tr "repo.modelarts.code_version"}}
  347. </td>
  348. <td class="ti-text-form-content">
  349. <div class="text-span text-span-w" vfield="BranchName"></div>
  350. </td>
  351. </tr>
  352. <tr class="ti-no-ng-animate">
  353. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  354. {{$.i18n.Tr "repo.modelarts.train_job.description"}}
  355. </td>
  356. <td class="ti-text-form-content">
  357. <div class="text-span text-span-w" vtitle="Description" vfield="Description"></div>
  358. </td>
  359. </tr>
  360. <tr class="ti-no-ng-animate">
  361. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  362. <span>{{$.i18n.Tr "repo.modelarts.train_job.resource_type"}}</span>
  363. </td>
  364. <td class="ti-text-form-content resorce_type">
  365. <div class="text-span text-span-w"></div>
  366. </td>
  367. </tr>
  368. <tr class="ti-no-ng-animate">
  369. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  370. {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
  371. </td>
  372. <td class="ti-text-form-content spec">
  373. <div class="text-span text-span-w"></div>
  374. </td>
  375. </tr>
  376. <tr class="ti-no-ng-animate">
  377. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  378. {{$.i18n.Tr "repo.modelarts.model_name"}}
  379. </td>
  380. <td class="ti-text-form-content">
  381. <div class="text-span text-span-w" vfield="ModelName"></div>
  382. </td>
  383. </tr>
  384. <tr class="ti-no-ng-animate">
  385. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  386. {{$.i18n.Tr "repo.modelconvert.modelversion"}}
  387. </td>
  388. <td class="ti-text-form-content">
  389. <div class="text-span text-span-w" vfield="ModelVersion"></div>
  390. </td>
  391. </tr>
  392. <tr class="ti-no-ng-animate">
  393. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  394. {{$.i18n.Tr "repo.modelarts.infer_job_model_file"}}
  395. </td>
  396. <td class="ti-text-form-content">
  397. <div class="text-span text-span-w" vfield="CkptName"></div>
  398. </td>
  399. </tr>
  400. <tr class="ti-no-ng-animate">
  401. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  402. {{$.i18n.Tr "repo.cloudbrain_creator"}}
  403. </td>
  404. <td class="ti-text-form-content">
  405. <div class="text-span text-span-w" id="-mirror" vuser="User.Name"></div>
  406. </td>
  407. </tr>
  408. <tr class="ti-no-ng-animate">
  409. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  410. {{$.i18n.Tr "repo.modelarts.train_job.start_file"}}
  411. </td>
  412. <td class="ti-text-form-content">
  413. <div class="text-span text-span-w" vfield="BootFile"></div>
  414. </td>
  415. </tr>
  416. <tr class="ti-no-ng-animate">
  417. <td class="ti-no-ng-animate ti-text-form-label text-width80">
  418. {{.i18n.Tr "modelsafety.evaluation_indicators"}}
  419. </td>
  420. <td class="ti-text-form-content">
  421. <div class="text-span text-span-w" vfield="LabelName"></div>
  422. </td>
  423. </tr>
  424. </tbody>
  425. </table>
  426. </div>
  427. </div>
  428. </div>
  429. </div>
  430. </div>
  431. <div class="ui tab" data-tab="second0">
  432. <div>
  433. <a id="-log-down"
  434. class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}}'
  435. href="/api/v1/repos/{{$.RepoRelPath}}">
  436. <i class="ri-download-cloud-2-line"></i>
  437. <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
  438. </a>
  439. </div>
  440. <div
  441. style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
  442. <span>
  443. <a title="滚动到顶部" style="position: absolute; right: -32px;cursor: pointer;"
  444. class="log_top" data-version=""><i class="icon-to-top"></i></a>
  445. </span>
  446. <span class="log-info-">
  447. <a title="滚动到底部" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
  448. class="log_bottom" data-version=""><i
  449. class="icon-to-bottom"></i></a>
  450. </span>
  451. <div class="ui message message" style="display: none;">
  452. <div id="header"></div>
  453. </div>
  454. <div class="ui attached log log-scroll" id="log" data-version=""
  455. style="height: 300px !important; overflow: auto;">
  456. <div class="ui inverted active dimmer">
  457. <div class="ui loader"></div>
  458. </div>
  459. <input type="hidden" name="end_line" value>
  460. <input type="hidden" name="start_line" value>
  461. <pre id="log_file"></pre>
  462. </div>
  463. </div>
  464. </div>
  465. <div class="ui tab" data-tab="third0">
  466. <style>
  467. .__res_item {
  468. margin-bottom: 20px;
  469. }
  470. .__res_title {
  471. height: 50px;
  472. display: flex;
  473. align-items: center;
  474. margin-bottom: 10px;
  475. }
  476. .__res_title_icon {
  477. height: 48px;
  478. width: 48px;
  479. margin-right: 8px;
  480. }
  481. .bNIWIE.fill:not([stroke]) {
  482. fill: rgb(105, 192, 255);
  483. }
  484. .bNIWIE.fill:not([fill]) {
  485. fill: rgb(105, 192, 255);
  486. }
  487. .__res_title_txt {
  488. font-family: SourceHanSansSC;
  489. font-size: 14px;
  490. font-style: normal;
  491. line-height: 20px;
  492. text-decoration: none;
  493. }
  494. .__res_title_txt1 {
  495. font-weight: 700;
  496. color: rgb(3, 102, 214);
  497. }
  498. .__res_title_txt2 {
  499. font-weight: 300;
  500. color: rgba(136,136,136,1);
  501. }
  502. .__res_table_container {
  503. overflow-x: auto;
  504. }
  505. .__res_table_container table {
  506. border-bottom-left-radius: 0 !important;
  507. border-bottom-right-radius: 0 !important;
  508. }
  509. .__res_table_container th, .__res_table_container td {
  510. text-align: center !important;
  511. }
  512. .__res_chart_container {
  513. height:280px;
  514. border: 1px solid rgba(34,36,38,.1);
  515. margin-top: -1px;
  516. border-bottom-left-radius: .28571429rem;
  517. border-bottom-right-radius: .28571429rem;
  518. }
  519. .__res_no_data {
  520. height: 200px;
  521. display: flex;
  522. justify-content: center;
  523. align-items: center;
  524. }
  525. </style>
  526. <div style="display:none;">
  527. {{template "repo/modelsafety/indicators_descr".}}
  528. </div>
  529. <div class="__res_container">
  530. <div class="__res_no_data">{{.i18n.Tr "modelsafety.no_data"}}</div>
  531. </div>
  532. </div>
  533. </div>
  534. </div>
  535. </div>
  536. {{template "base/paginate" .}}
  537. </div>
  538. <!-- 确认模态框 -->
  539. <div id="deletemodel">
  540. <div class="ui basic modal">
  541. <div class="ui icon header">
  542. <i class="trash icon"></i> {{$.i18n.Tr "cloudbrain.delete_task"}}
  543. </div>
  544. <div class="content">
  545. <p>{{$.i18n.Tr "cloudbrain.task_delete_confirm"}}</p>
  546. </div>
  547. <div class="actions">
  548. <div class="ui red basic inverted cancel button">
  549. <i class="remove icon"></i> {{$.i18n.Tr "cloudbrain.operate_cancel"}}
  550. </div>
  551. <div class="ui green basic inverted ok button">
  552. <i class="checkmark icon"></i> {{$.i18n.Tr "cloudbrain.operate_confirm"}}
  553. </div>
  554. </div>
  555. </div>
  556. </div>
  557. </div>
  558. {{template "base/footer" .}}
  559. <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
  560. <script>
  561. ;(function() {
  562. function paddingZeros(str, len) {
  563. str = str.toString();
  564. if (str.length < len) {
  565. str = new Array(len - str.length).fill('0').join('') + str;
  566. }
  567. return str;
  568. }
  569. function timeFormat(date) {
  570. return `${date.getFullYear()}-${paddingZeros(date.getMonth() + 1, 2)}-${paddingZeros(date.getDate(), 2)} ${paddingZeros(date.getHours(), 2)}:${paddingZeros(date.getMinutes(), 2)}:${paddingZeros(date.getSeconds(), 2)}`;
  571. }
  572. function initTable(tableEl, data) {
  573. tableEl.empty();
  574. tableEl.append(`
  575. <table class="ui celled table">
  576. <thead>
  577. <tr class="tr-head"><th style="width:100px;">${data.indicator}</th></tr>
  578. </thead>
  579. <tbody>
  580. <tr class="tr-untargetted"><td>{{.i18n.Tr "modelsafety.untargetted"}}</td></tr>
  581. <tr class="tr-targetted"><td>{{.i18n.Tr "modelsafety.targetted"}}</td></tr>
  582. </tbody>
  583. </table>`);
  584. var trHead = tableEl.find('tr.tr-head');
  585. var trUntargetted = tableEl.find('tr.tr-untargetted');
  586. var trTargetted = tableEl.find('tr.tr-targetted');
  587. for (var i = 0, iLen = data.params.length; i < iLen; i++) {
  588. var params = data.params;
  589. var untargetted = data.untargetted;
  590. var targetted = data.targetted;
  591. trHead.append(`<th>param(${params[i]})</th>`);
  592. trUntargetted.append(`<td>${untargetted[i]}</td>`);
  593. trTargetted.append(`<td>${targetted[i]}</td>`);
  594. }
  595. }
  596. function initChart(chartEl, data) {
  597. var chartHandle = chartEl.data('chart');
  598. chartHandle && chartHandle.dispose();
  599. chartHandle && window.removeEventListener('resize', chartHandle.resize);
  600. chartHandle = echarts.init(chartEl[0]);
  601. chartEl.data('chart', chartHandle);
  602. var option = {
  603. tooltip: {
  604. trigger: 'axis'
  605. },
  606. color: ['rgb(80, 135, 236)', 'rgb(104, 187, 196)'],
  607. legend: {
  608. data: ['{{.i18n.Tr "modelsafety.untargetted"}}', '{{.i18n.Tr "modelsafety.targetted"}}'],
  609. top: '15',
  610. },
  611. grid: {
  612. top: '50',
  613. left: '20',
  614. right: '20',
  615. bottom: '20',
  616. containLabel: true
  617. },
  618. xAxis: {
  619. type: 'category',
  620. data: data.params.map(function(item){ return `param(${item})`}),
  621. },
  622. yAxis: {
  623. type: 'value'
  624. },
  625. series: [
  626. {
  627. name: '{{.i18n.Tr "modelsafety.untargetted"}}',
  628. type: 'line',
  629. stack: 'Total',
  630. data: data.untargetted || [],
  631. },
  632. {
  633. name: '{{.i18n.Tr "modelsafety.targetted"}}',
  634. type: 'line',
  635. stack: 'Total',
  636. data: data.targetted || [],
  637. }
  638. ]
  639. };
  640. chartHandle.setOption(option);
  641. window.addEventListener('resize', chartHandle.resize);
  642. }
  643. function initResItems(list) {
  644. var resContainer = $('.__res_container');
  645. resContainer.empty();
  646. for (var i = 0, iLen = list.length; i < iLen; i++) {
  647. var item = list[i], indicator = item.indicator;
  648. var descr = $(`[indicator="${indicator}"]`).text();
  649. var resItemContainer = $(`<div class="__res_item">
  650. <div class="__res_title">
  651. <div class="__res_title_icon">
  652. <svg xmlns="http://www.w3.org/2000/svg" class="styles__StyledSVGIconPathComponent-sc-16fsqc8-0 bNIWIE svg-icon-path-icon fill" viewBox="0 0 32 32" width="48" height="48"><defs data-reactroot=""></defs><g><path d="M8.155 26.783c-3.342-2.449-5.488-6.36-5.488-10.771 0-0.004 0-0.008 0-0.012v0.001c0-7.364 5.969-13.333 13.333-13.333s13.333 5.969 13.333 13.333c0 0.003 0 0.007 0 0.011 0 4.412-2.146 8.323-5.451 10.745l-0.037 0.026-1.353-2.319c2.549-1.969 4.175-5.026 4.175-8.464 0-5.891-4.776-10.667-10.667-10.667s-10.667 4.776-10.667 10.667c0 3.437 1.626 6.494 4.15 8.445l0.025 0.018-1.353 2.319zM10.867 22.136c-1.758-1.477-2.867-3.677-2.867-6.136 0-4.418 3.582-8 8-8s8 3.582 8 8c0 2.459-1.109 4.658-2.854 6.126l-0.012 0.010-1.373-2.355c0.972-0.966 1.573-2.304 1.573-3.782 0-2.946-2.388-5.333-5.333-5.333s-5.333 2.388-5.333 5.333c0 1.478 0.601 2.816 1.573 3.782l0 0-1.373 2.355zM14.667 17.333h2.667v12h-2.667v-12z"></path></g></svg>
  653. </div>
  654. <div class="__res_title_txt">
  655. <div class="__res_title_txt1">${indicator}-${item.name}</div>
  656. <div class="__res_title_txt2">${descr}</div>
  657. </div>
  658. </div>
  659. <div class="__res_table_container"></div>
  660. <div class="__res_chart_container"></div>
  661. </div>`);
  662. resContainer.append(resItemContainer);
  663. initTable(resItemContainer.find('.__res_table_container'), item);
  664. initChart(resItemContainer.find('.__res_chart_container'), item);
  665. }
  666. };
  667. function initResTab(data) {
  668. var name = data.name;
  669. var params = data.params;
  670. var indicators = Object.keys(data.targetted);
  671. var list = [];
  672. for (var i = 0, iLen = indicators.length; i < iLen; i++) {
  673. var indicator = indicators[i];
  674. var obj = {
  675. name: name,
  676. params: params.flat(),
  677. indicator: indicator,
  678. targetted: data.targetted[indicator]['targets'],
  679. untargetted: data.untargetted[indicator],
  680. };
  681. list.push(obj);
  682. }
  683. initResItems(list);
  684. }
  685. var resultData;
  686. function initData() {
  687. $.ajax({
  688. url: window.location.href.replace('/show', ''),
  689. type: "get",
  690. data: {},
  691. contentType: "application/json; charset=utf-8",
  692. success(res) {
  693. for (var key in res) {
  694. $(`[vfield="${key}"]`).text(res[key]);
  695. $(`[vclass="${key}"]`).addClass(res[key]);
  696. $(`[vtime="${key}"]`).text(res[key] ? timeFormat(new Date(res[key] * 1000)) : '--');
  697. $(`[vtitle="${key}"]`).attr('title', res[key]);
  698. $(`[vdataset0="${key}"]`).text(res[key] ? res[key].toString().split(';')[0] : '');
  699. $(`[vdataset1="${key}"]`).text(res[key] ? res[key].toString().split(';')[1] : '');
  700. $(`[vvalue="${key}"]`).val(res[key]);
  701. $(`[vdatajobid="${key}"]`).attr('data-jobid', res[key]);
  702. }
  703. var imageName = res['Image'] || res['EngineName'];
  704. $(`[vimagetitle="Image"] span`).hide();
  705. if (res.Type === 0) {
  706. imageName = res['Image'];
  707. $(`[vimagetitle="Image"] span`).eq(0).show();
  708. } else {
  709. imageName = res['EngineName'];
  710. $(`[vimagetitle="Image"] span`).eq(1).show();
  711. }
  712. $(`[vdataclipboardtext="Image"]`).attr('data-clipboard-text', imageName);
  713. $(`[vimage="Image"]`).text(imageName);
  714. $(`[vtitle="Image"]`).attr('title', imageName);
  715. $(`[vuser="User.Name"]`).text(res['User'] && res['User']['Name']);
  716. if (res.Spec) {
  717. var SPEC = res.Spec;
  718. var showPoint = false;
  719. var specStr = window.renderSpecStr(SPEC, showPoint, {
  720. gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}},
  721. free: {{$.i18n.Tr "cloudbrain.free"}},
  722. point_hr: {{$.i18n.Tr "cloudbrain.point_hr"}},
  723. memory: {{$.i18n.Tr "cloudbrain.memory"}},
  724. shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}},
  725. });
  726. $('td.ti-text-form-content.spec div').text(specStr);
  727. SPEC && $('td.ti-text-form-content.resorce_type div').text(getListValueWithKey(ACC_CARD_TYPE, SPEC.AccCardType));
  728. }
  729. if (res.ResultJson) {
  730. resultData = JSON.parse(res.ResultJson);
  731. }
  732. },
  733. error(err) {
  734. console.log(err);
  735. },
  736. });
  737. }
  738. initData();
  739. $(document).ready(function () {
  740. $('.ui.accordion').accordion({ selector: { trigger: '.icon' } });
  741. });
  742. $('.pointing.secondary.menu .item').tab({
  743. onVisible: function(tabPath) {
  744. if (tabPath === 'first0') {
  745. initData();
  746. }
  747. if (tabPath === 'third0') {
  748. resultData && initResTab(resultData);
  749. }
  750. },
  751. });
  752. })();
  753. </script>