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.

cloudbrains.tmpl 36 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
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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. {{template "base/head" .}}
  2. <!-- 提示框 -->
  3. <div class="alert"></div>
  4. <script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
  5. <div class="explore users">
  6. <div class="cloudbrain_debug" style="display: none;" data-debug="{{$.i18n.Tr "repo.debug"}}"
  7. data-debug-again="{{$.i18n.Tr "repo.debug_again"}}" data-debug-task="{{$.i18n.Tr "cloudbrain.DEBUG"}}"
  8. data-train-task="{{$.i18n.Tr "cloudbrain.TRAIN"}}" data-inference-task="{{$.i18n.Tr "cloudbrain.INFERENCE"}}"
  9. data-benchmark-task="{{$.i18n.Tr "cloudbrain.BENCHMARK"}}"
  10. data-all-cluster="{{.i18n.Tr "cloudbrain.all_resource_cluster"}}"
  11. data-all-aiCenter="{{.i18n.Tr "cloudbrain.all_ai_center"}}"
  12. data-cluster-c2net="{{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}"
  13. data-cluster-openi="{{.i18n.Tr "cloudbrain.resource_cluster_openi"}}"
  14. data-all-task="{{.i18n.Tr "admin.cloudbrain.all_task_types"}}"
  15. data-all-compute="{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}"
  16. data-all-status="{{.i18n.Tr "admin.cloudbrain.all_status"}}"></div>
  17. {{template "admin/cloudbrain/search_dashboard" .}}
  18. <div class="ui container" style="width:90%;overflow-x:auto;overflow-y:hidden">
  19. {{template "base/alert" .}}
  20. <div class="ui grid" style="min-width:1700px;">
  21. <div class="row">
  22. <div class="ui sixteen wide column" style="margin-bottom:15px;">
  23. <!-- 任务展示 -->
  24. <div class="dataset list">
  25. <!-- 表头 -->
  26. <div class="ui grid stackable" style="background: #f0f0f0;;">
  27. <div class="row">
  28. <div class="three wide column nowrap" style="width:12%!important">
  29. <span>{{$.i18n.Tr "repo.cloudbrain_task"}}</span>
  30. </div>
  31. <!-- 集群 -->
  32. <div class="one wide column text center nowrap" style="width:8% !important;">
  33. <span>{{$.i18n.Tr "repo.modelarts.cluster"}}</span>
  34. </div>
  35. <div class="two wide column text center nowrap" style="width: 8% !important;">
  36. <span>{{$.i18n.Tr "repo.modelarts.status"}}</span>
  37. </div>
  38. <div class="one wide column text center nowrap" style="width:8% !important">
  39. <span>{{$.i18n.Tr "repo.cloudbrain_task_type"}}</span>
  40. </div>
  41. <div class="two wide column text center nowrap" style="width: 8% !important;">
  42. <span>{{$.i18n.Tr "repo.modelarts.createtime"}}</span>
  43. </div>
  44. <div class="one wide column text center nowrap" style="width:6% !important;">
  45. <span>{{$.i18n.Tr "repo.cloudbrain_status_runtime"}}</span>
  46. </div>
  47. <div class="one wide column text center nowrap" style="width:6% !important;">
  48. <span>{{$.i18n.Tr "repo.modelarts.computing_resources"}}</span>
  49. </div>
  50. <!-- 智算中心 -->
  51. <div class="one wide column text center nowrap" style="width:8% !important;">
  52. <span>{{$.i18n.Tr "repo.modelarts.ai_center"}}</span>
  53. </div>
  54. <!-- XPU类型 -->
  55. <div class="one wide column text center nowrap" style="width:10% !important;">
  56. <span>{{$.i18n.Tr "repo.modelarts.card_type"}}</span>
  57. </div>
  58. <div class="two wide column text center nowrap" style="width: 11%!important;">
  59. <span>{{$.i18n.Tr "repository"}}</span>
  60. </div>
  61. <div class="three wide column text center nowrap" style="width: 15%!important;">
  62. <span>{{$.i18n.Tr "repo.cloudbrain_operate"}}</span>
  63. </div>
  64. </div>
  65. </div>
  66. {{range .Tasks}}
  67. {{if .Repo}}
  68. <div class="ui grid stackable item">
  69. <div class="row">
  70. <!-- 任务名 -->
  71. {{$JobID := '0'}}
  72. {{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK" "MODELSAFETY"}}
  73. {{$JobID = .Cloudbrain.ID}}
  74. {{else}}
  75. {{$JobID = .JobID}}
  76. {{end}}
  77. <!-- {{$JobID}} -->
  78. <div class="three wide column nowrap" style="width:12% !important">
  79. {{if eq .JobType "DEBUG"}}
  80. <a class="title"
  81. href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain/{{$JobID}}{{else}}/modelarts/notebook/{{$JobID}}{{end}}"
  82. title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
  83. <span class="fitted"
  84. style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  85. </a>
  86. {{else if (eq .JobType "SNN4IMAGENET" "BRAINSCORE")}}
  87. <a class="title"
  88. href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/cloudbrain/benchmark/{{$JobID}}"
  89. title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
  90. <span class="fitted"
  91. style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  92. </a>
  93. {{else if eq .JobType "INFERENCE"}}
  94. <a class="title"
  95. href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/{{if eq .Cloudbrain.Type 1}}modelarts{{else if eq .Cloudbrain.Type 0}}cloudbrain{{end}}/inference-job/{{$JobID}}"
  96. title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
  97. <span class="fitted"
  98. style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  99. </a>
  100. {{else if eq .JobType "TRAIN"}}
  101. <a class="title"
  102. href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/{{if eq .Cloudbrain.Type 1}}modelarts{{else if eq .Cloudbrain.Type 0}}cloudbrain{{else if eq .Cloudbrain.Type 2}}grampus{{end}}/train-job/{{$JobID}}"
  103. title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
  104. <span class="fitted"
  105. style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  106. </a>
  107. {{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}
  108. <a class="title"
  109. href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/cloudbrain/benchmark/{{$JobID}}"
  110. title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
  111. <span class="fitted"
  112. style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  113. </a>
  114. {{end}}
  115. </div>
  116. <!-- 集群 -->
  117. <div class="one wide column text center nowrap" style="width:8% !important;">
  118. <span style="font-size: 12px;" class="cluster_{{.DisplayJobName}}_{{$JobID}}">{{if .Cluster}}{{.Cluster}}{{else}}--{{end}}</span>
  119. </div>
  120. <!-- 任务状态 -->
  121. <div class="two wide column text center nowrap"
  122. style="width: 8% !important;">
  123. <span class="job-status" id="{{$JobID}}"
  124. data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts{{end}}/inference-job{{else if eq .JobType "TRAIN"}}{{if eq .ComputeResource "NPU"}}/modelarts/train-job{{else}}/cloudbrain/train-job{{end}}{{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}/cloudbrain{{end}}'
  125. data-jobid="{{$JobID}}" data-version="{{.VersionName}}"
  126. data-bootfile="{{.BootFile}}">
  127. <span><i id="{{$JobID}}-icon" style="vertical-align: middle;"
  128. class="{{.Status}}"></i><span id="{{$JobID}}-text"
  129. style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
  130. </span>
  131. </div>
  132. <!-- 任务类型 -->
  133. {{$JobType := $.i18n.Tr (printf "cloudbrain.%s" .JobType)}}
  134. <div class="one wide column text center nowrap" style="width:8% !important">
  135. <span style="font-size: 12px;" title="{{.JobType}}">{{$JobType}}</span>
  136. </div>
  137. <!-- 任务创建时间 -->
  138. <div class="two wide column text center nowrap" style="width: 8% !important;">
  139. <span style="font-size: 12px;"
  140. class="">{{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}</span>
  141. </div>
  142. <!-- 任务运行时间 -->
  143. <div class="one wide column text center nowrap" style="width:6% !important;">
  144. <span style="font-size: 12px;"
  145. id="duration-{{$JobID}}">{{if .TrainJobDuration}}{{.TrainJobDuration}}{{else}}--{{end}}</span>
  146. </div>
  147. <!-- 计算资源 -->
  148. <div class="one wide column text center nowrap" style="width:6% !important;">
  149. <span
  150. style="font-size: 12px;">{{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}</span>
  151. </div>
  152. <!-- 智算中心 -->
  153. <div class="one wide column text center nowrap" style="width:8% !important;">
  154. <span style="font-size: 12px;" class="aicenter_{{.DisplayJobName}}_{{$JobID}}" title="{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span>
  155. </div>
  156. <!-- XPU类型 -->
  157. <div class="one wide column text center nowrap" style="width:10% !important;">
  158. <span style="font-size: 12px;" title="" class="card_type_{{.DisplayJobName}}_{{$JobID}}"></span>
  159. </div>
  160. <script>
  161. (function(){
  162. var spec = {{.Spec}} || {};
  163. var cardType = getListValueWithKey(ACC_CARD_TYPE, spec.AccCardType) || '--';
  164. var spanEl = document.querySelector('.card_type_{{.DisplayJobName}}_{{$JobID}}');
  165. spanEl.setAttribute('title', cardType);
  166. spanEl.innerText = cardType;
  167. var cluster = {{.Cluster}} || '--';
  168. var clusterName = document.querySelector('.cloudbrain_debug').dataset['cluster' + cluster[0] + cluster.toLocaleLowerCase().slice(1)] || '--';
  169. spanEl = document.querySelector('.cluster_{{.DisplayJobName}}_{{$JobID}}');
  170. spanEl.setAttribute('title', cluster);
  171. spanEl.innerText = clusterName;
  172. // var aiCenter = spec.AiCenterName || '--';
  173. // spanEl = document.querySelector('.aicenter_{{.DisplayJobName}}_{{$JobID}}');
  174. // spanEl.setAttribute('title', aiCenter);
  175. // spanEl.innerText = aiCenter;
  176. })();
  177. </script>
  178. <!-- 项目 -->
  179. <div class="two wide column text center nowrap" style="width: 11%!important;">
  180. <a href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}"
  181. title="{{.Repo.OwnerName}}/{{.Repo.Alias}}">{{.Repo.OwnerName}}/{{.Repo.Alias}}</a>
  182. </div>
  183. <div class="three wide column text center nowrap" style="width: 15%!important;">
  184. {{if eq .JobType "DEBUG"}}
  185. <div class="ui compact buttons">
  186. <form id="debugAgainForm-{{$JobID}}">
  187. {{$.CsrfTokenHtml}}
  188. {{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}}
  189. <a style="margin: 0 1rem;" id="ai-debug-{{$JobID}}"
  190. class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}}disabled {{else}}blue {{end}}button'
  191. data-jobid="{{$JobID}}"
  192. data-repopath='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{$JobID}}/'>
  193. {{$.i18n.Tr "repo.debug"}}
  194. </a>
  195. {{else}}
  196. {{if not .BootFile}}
  197. <a id="ai-debug-{{$JobID}}"
  198. class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}} disabled {{else}}blue {{end}}button'
  199. data-jobid="{{$JobID}}"
  200. data-repopath='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{$JobID}}/'>
  201. {{$.i18n.Tr "repo.debug_again"}}
  202. </a>
  203. {{end}}
  204. {{end}}
  205. </form>
  206. </div>
  207. {{end}}
  208. <!-- 停止任务 -->
  209. <div class="ui compact buttons">
  210. {{if eq .JobType "MODELSAFETY"}}
  211. <form id="stopForm-{{$JobID}}" style="margin-left:-1px;">
  212. {{$.CsrfTokenHtml}}
  213. <a style="padding: 0.5rem 1rem;" id="ai-stop-{{$JobID}}"
  214. class='ui basic ai_stop {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED" "SUCCEEDED" "STOPPED" "STOPPING" "CREATE_FAILED"}}disabled {{else}} blue {{end}}button'
  215. data-repopath='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/modelsafety/{{$JobID}}/stop'
  216. data-jobid="{{$JobID}}">
  217. {{$.i18n.Tr "repo.stop"}}
  218. </a>
  219. </form>
  220. {{else}}
  221. {{if eq .JobType "DEBUG" "BENCHMARK" "SNN4IMAGENET" "BRAINSCORE"}}
  222. <form id="stopForm-{{$JobID}}" style="margin-left:-1px;">
  223. {{$.CsrfTokenHtml}}
  224. <a style="padding: 0.5rem 1rem;" id="ai-stop-{{$JobID}}"
  225. class='ui basic ai_stop {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED" "SUCCEEDED" "STOPPED" "STOPPING" "CREATE_FAILED"}}disabled {{else}} blue {{end}}button'
  226. data-repopath='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else if eq .JobType "BENCHMARK" }}/cloudbrain/benchmark{{else if eq .ComputeResource "NPU" }}/modelarts/notebook{{end}}/{{$JobID}}/stop'
  227. data-jobid="{{$JobID}}" data-bootfile="{{.BootFile}}">
  228. {{$.i18n.Tr "repo.stop"}}
  229. </a>
  230. </form>
  231. {{else}}
  232. <a style="padding: 0.5rem 1rem;" id="ai-stop-{{$JobID}}"
  233. class='ui basic ai_stop_version {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED" "STOPPED" "SUCCEEDED" "CREATE_FAILED"}}disabled {{else}} blue {{end}}button'
  234. data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}/{{if eq .JobType "INFERENCE"}}{{if eq .Cloudbrain.Type 1}}modelarts/inference-job{{else}}cloudbrain/train-job{{end}}{{else if eq .JobType "TRAIN"}}{{if eq .Cloudbrain.Type 1}}modelarts/train-job{{else if eq .Cloudbrain.Type 0}}cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}grampus/train-job{{end}}{{end}}'
  235. data-jobid="{{$JobID}}" data-version="{{.VersionName}}" data-bootfile="{{.BootFile}}">
  236. {{$.i18n.Tr "repo.stop"}}
  237. </a>
  238. {{end}}
  239. {{end}}
  240. </div>
  241. {{if eq .JobType "BENCHMARK"}}
  242. <div class="ui compact buttons">
  243. <a class="ui basic button {{if $.IsSigned}} blue{{else}} disabled{{end}}"
  244. href="{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}/rate" target="_blank">
  245. {{$.i18n.Tr "repo.score"}}
  246. </a>
  247. </div>
  248. {{end}}
  249. <!-- 修改任务 -->
  250. {{if eq .JobType "TRAIN"}}
  251. <div class="ui compact buttons __btn_edit__">
  252. <a style="padding: 0.5rem 1rem;" class="ui basic blue button" href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job/{{.JobID}}{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job/{{.JobID}}{{else if eq .Cloudbrain.Type 2}}/grampus/train-job/{{.JobID}}{{end}}/create_version{{if .VersionName}}?version_name={{.VersionName}}{{end}}">
  253. {{$.i18n.Tr "repo.modelarts.modify"}}
  254. </a>
  255. </div>
  256. {{end}}
  257. <!-- 删除任务 -->
  258. {{if eq .JobType "MODELSAFETY"}}
  259. <form class="ui compact buttons" id="delForm-{{$JobID}}"
  260. action='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/modelsafety/{{$JobID}}/del?ishomepage=true'
  261. method="post">
  262. {{$.CsrfTokenHtml}}
  263. <a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{$JobID}}"
  264. class="ui basic ai_delete blue button"
  265. style="border-radius: .28571429rem;">
  266. {{$.i18n.Tr "repo.delete"}}
  267. </a>
  268. </form>
  269. {{else}}
  270. <form class="ui compact buttons" id="delForm-{{$JobID}}"
  271. action='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "BENCHMARK"}}/cloudbrain/benchmark{{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}}/cloudbrain{{else if eq .JobType "DEBUG"}}{{if eq .ComputeResource "NPU"}}/modelarts/notebook{{else}}/cloudbrain{{end}}{{else if eq .JobType "TRAIN"}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{end}}{{end}}/{{$JobID}}/del?ishomepage=true'
  272. method="post">
  273. {{$.CsrfTokenHtml}}
  274. <a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{$JobID}}"
  275. data-repopath="{{.Repo.OwnerName}}/{{.Repo.Name}}/modelarts/inference-job/{{$JobID}}/del_version?ishomepage=true"
  276. data-version="" class="ui basic ai_delete blue button"
  277. style="border-radius: .28571429rem;">
  278. {{$.i18n.Tr "repo.delete"}}
  279. </a>
  280. </form>
  281. {{end}}
  282. </div>
  283. </div>
  284. </div>
  285. {{else}}
  286. {{$JobID := '0'}}
  287. {{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK"}}
  288. {{$JobID = .Cloudbrain.ID}}
  289. {{else}}
  290. {{$JobID = .JobID}}
  291. {{end}}
  292. <div class="ui grid stackable item">
  293. <div class="row">
  294. <!-- 任务名 -->
  295. <div class="three wide column nowrap" style="width:12% !important">
  296. {{if eq .JobType "DEBUG"}}
  297. <a class="title" href="" title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
  298. <span class="fitted"
  299. style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  300. </a>
  301. {{else if eq .JobType "INFERENCE"}}
  302. <a class="title" href="" title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
  303. <span class="fitted"
  304. style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  305. </a>
  306. {{else if eq .JobType "TRAIN"}}
  307. <a class="title" href="" title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
  308. <span class="fitted"
  309. style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  310. </a>
  311. {{else if eq .JobType "BENCHMARK"}}
  312. <a class="title" href="" title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
  313. <span class="fitted"
  314. style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  315. </a>
  316. {{end}}
  317. </div>
  318. <!-- 集群 -->
  319. <div class="one wide column text center nowrap" style="width:8% !important;">
  320. <span
  321. style="font-size: 12px;">{{if .Cluster}}{{.Cluster}}{{else}}--{{end}}</span>
  322. </div>
  323. <!-- 任务状态 -->
  324. <div class="two wide column text center nowrap"
  325. style="padding-left: 2.2rem !important; width: 8% !important;">
  326. <span class="job-status" id="{{$JobID}}" data-jobid="{{$JobID}}"
  327. data-version="{{.VersionName}}">
  328. <span><i id="{{$JobID}}-icon" style="vertical-align: middle;"
  329. class="{{.Status}}"></i><span id="{{$JobID}}-text"
  330. style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
  331. </span>
  332. </div>
  333. <!-- 任务类型 -->
  334. {{$JobType := $.i18n.Tr (printf "cloudbrain.%s" .JobType)}}
  335. <div class="one wide column text center nowrap" style="width:8%">
  336. <span style="font-size: 12px;" title="{{.JobType}}">{{$JobType}}</span>
  337. </div>
  338. <!-- 任务创建时间 -->
  339. <div class="two wide column text center nowrap" style="width: 8% !important;">
  340. <span style="font-size: 12px;"
  341. class="">{{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}</span>
  342. </div>
  343. <!-- 任务运行时间 -->
  344. <div class="one wide column text center nowrap" style="width:6% !important;">
  345. <span style="font-size: 12px;"
  346. id="duration-{{$JobID}}">{{if .TrainJobDuration}}{{.TrainJobDuration}}{{else}}--{{end}}</span>
  347. </div>
  348. <!-- 计算资源 -->
  349. <div class="one wide column text center nowrap" style="width:6% !important;">
  350. <span
  351. style="font-size: 12px;">{{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}</span>
  352. </div>
  353. <!-- 智算中心 -->
  354. <div class="one wide column text center nowrap" style="width:8% !important;">
  355. <span
  356. style="font-size: 12px;">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span>
  357. </div>
  358. <!-- XPU类型 -->
  359. <div class="one wide column text center nowrap" style="width:10% !important;">
  360. <span style="font-size: 12px;" title="{{.CardType}}">
  361. {{if .CardType}}{{.CardType}}{{else}}--{{end}}
  362. </span>
  363. </div>
  364. <!-- 项目 -->
  365. <div class="two wide column text center nowrap" style="width: 11%!important;">
  366. <a href="" title="">--</a>
  367. </div>
  368. <div class="three wide column text center nowrap" style="width: 15%!important;">
  369. {{if eq .JobType "DEBUG"}}
  370. <div class="ui compact buttons">
  371. <form id="debugAgainForm-{{$JobID}}">
  372. {{$.CsrfTokenHtml}}
  373. {{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}}
  374. <a style="margin: 0 1rem;" id="ai-debug-{{$JobID}}"
  375. class='ui basic disabled button'>
  376. {{$.i18n.Tr "repo.debug"}}
  377. </a>
  378. {{else}}
  379. <a id="ai-debug-{{$JobID}}" class='ui basic disabled button'>
  380. {{$.i18n.Tr "repo.debug_again"}}
  381. </a>
  382. {{end}}
  383. </form>
  384. </div>
  385. {{end}}
  386. <!-- 停止任务 -->
  387. <div class="ui compact buttons">
  388. <a style="padding: 0.5rem 1rem;" id="ai-stop-{{$JobID}}"
  389. class="ui basic disabled button" data-jobid="{{$JobID}}"
  390. data-version="{{.VersionName}}">
  391. {{$.i18n.Tr "repo.stop"}}
  392. </a>
  393. </div>
  394. <!-- 删除任务 -->
  395. <form class="ui compact buttons" id="delForm-{{$JobID}}" action='' method="post">
  396. {{$.CsrfTokenHtml}}
  397. <a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{$JobID}}"
  398. class="ui basic disabled button" style="border-radius: .28571429rem;">
  399. {{$.i18n.Tr "repo.delete"}}
  400. </a>
  401. </form>
  402. </div>
  403. </div>
  404. </div>
  405. {{end}}
  406. {{end}}
  407. </div>
  408. </div>
  409. </div>
  410. </div>
  411. </div>
  412. <div id="app" style="margin-top: 2rem;margin-bottom: 2rem;">
  413. <div class="center">
  414. <el-pagination background @current-change="handleCurrentChange" :current-page="page"
  415. :page-sizes="[10]" :page-size="10" layout="total, sizes, prev, pager, next, jumper"
  416. :total="{{.Page.Paginater.Total}}">
  417. </el-pagination>
  418. </div>
  419. </div>
  420. <!-- 确认模态框 -->
  421. <div id="deletemodel">
  422. <div class="ui basic modal">
  423. <div class="ui icon header">
  424. <i class="trash icon"></i> {{.i18n.Tr "cloudbrain.delete_task"}}
  425. </div>
  426. <div class="content">
  427. <p>{{.i18n.Tr "cloudbrain.task_delete_confirm"}}</p>
  428. </div>
  429. <div class="actions">
  430. <div class="ui red basic inverted cancel button">
  431. <i class="remove icon"></i> {{.i18n.Tr "cloudbrain.operate_cancel"}}
  432. </div>
  433. <div class="ui green basic inverted ok button">
  434. <i class="checkmark icon"></i> {{.i18n.Tr "cloudbrain.operate_confirm"}}
  435. </div>
  436. </div>
  437. </div>
  438. </div>
  439. <div class="ui modal debug-again-alert">
  440. <div class="ui message" style="background-color: rgba(242, 113, 28, 0.05);border: 1px solid rgba(242, 113, 28, 1);border-radius: 5px;">
  441. <div style="display: flex;align-items: center;">
  442. <i class="ri-information-line" style="font-size: 35px;color: rgba(242, 113, 28, 1);;"></i>
  443. <div style="text-align: left;margin-left: 1rem;">
  444. <div style="font-weight: 600;line-height: 2;">{{.i18n.Tr "repo.cloudbrain.morethanonejob1" | Safe }}</div>
  445. <div style="color:#939393">{{.i18n.Tr "repo.cloudbrain.morethanonejob2" | Safe}}</div>
  446. </div>
  447. </div>
  448. </div>
  449. </div>
  450. </div>
  451. <script>
  452. document.addEventListener('DOMContentLoaded', function() {
  453. var editbtns = $('.__btn_edit__');
  454. var curHref = window.location.href;
  455. for (var i = 0, iLen = editbtns.length; i < iLen; i++) {
  456. var buttonEl = editbtns.eq(i).find('a');
  457. var oHref = buttonEl.attr('href');
  458. var hasSearch = oHref.split('?').length > 1;
  459. buttonEl.attr('href', oHref + (hasSearch ? '&' : '?') + 'backurl=' + encodeURIComponent(curHref));
  460. }
  461. });
  462. </script>
  463. {{template "base/footer" .}}