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.

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