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 24 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. {{template "base/head" .}}
  2. <!-- 弹窗 -->
  3. <div id="mask">
  4. <div id="loadingPage">
  5. <div class="rect1"></div>
  6. <div class="rect2"></div>
  7. <div class="rect3"></div>
  8. <div class="rect4"></div>
  9. <div class="rect5"></div>
  10. </div>
  11. </div>
  12. <!-- 提示框 -->
  13. <div class="alert"></div>
  14. <div class="explore users">
  15. <div class="cloudbrain_debug" style="display: none;" data-debug="{{$.i18n.Tr "repo.debug"}}" data-debug-again="{{$.i18n.Tr "repo.debug_again"}}"></div>
  16. {{template "admin/cloudbrain/search_dashboard" .}}
  17. <div class="ui container" style="width: 80%;">
  18. {{template "base/alert" .}}
  19. <div class="ui grid" >
  20. <div class="row" >
  21. <div class="ui sixteen wide column">
  22. <!-- 任务展示 -->
  23. <div class="dataset list">
  24. <!-- 表头 -->
  25. <div class="ui grid stackable" style="background: #f0f0f0;;">
  26. <div class="row">
  27. <div class="three wide column nowrap" style="width:15%">
  28. <span style="margin:0 6px">{{$.i18n.Tr "repo.cloudbrain_task"}}</span>
  29. </div>
  30. <div class="two wide column text center nowrap" style="width: 11% !important;">
  31. <span>{{$.i18n.Tr "repo.modelarts.status"}}</span>
  32. </div>
  33. <div class="one wide column text center nowrap" style="width:10%">
  34. <span style="margin:0 6px">{{$.i18n.Tr "repo.cloudbrain_task_type"}}</span>
  35. </div>
  36. <div class="two wide column text center nowrap" style="width: 11% !important;">
  37. <span>{{$.i18n.Tr "repo.modelarts.createtime"}}</span>
  38. </div>
  39. <div class="one wide column text center nowrap" style="width:8.5% !important;">
  40. <span>{{$.i18n.Tr "repo.cloudbrain_status_runtime"}}</span>
  41. </div>
  42. <div class="one wide column text center nowrap" style="width:8.5% !important;">
  43. <span>{{$.i18n.Tr "repo.modelarts.computing_resources"}}</span>
  44. </div>
  45. <div class="two wide column text center nowrap" style="width: 14.5%!important;">
  46. <span>{{$.i18n.Tr "repository"}}</span>
  47. </div>
  48. <div class="three wide column text center nowrap" style="width: 21.5%!important;">
  49. <span>{{$.i18n.Tr "repo.cloudbrain_operate"}}</span>
  50. </div>
  51. </div>
  52. </div>
  53. {{range .Tasks}}
  54. {{if .Repo}}
  55. <div class="ui grid stackable item">
  56. <div class="row">
  57. <!-- 任务名 -->
  58. {{$JobID := '0'}}
  59. {{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK"}}
  60. {{$JobID = .Cloudbrain.ID}}
  61. {{else}}
  62. {{$JobID = .JobID}}
  63. {{end}}
  64. <!-- {{$JobID}} -->
  65. <div class="three wide column nowrap" style="width:15%">
  66. {{if or (eq .JobType "DEBUG") (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}}
  67. <a class="title" href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain/{{$JobID}}{{else}}/modelarts/notebook/{{$JobID}}{{end}}" title="{{.DisplayJobName}}" style="font-size: 14px;">
  68. <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  69. </a>
  70. {{else if eq .JobType "INFERENCE"}}
  71. <a class="title" href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/modelarts/inference-job/{{$JobID}}" title="{{.DisplayJobName}}" style="font-size: 14px;">
  72. <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  73. </a>
  74. {{else if eq .JobType "TRAIN"}}
  75. <a class="title" href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/{{if eq .ComputeResource "NPU"}}modelarts{{else}}cloudbrain{{end}}/train-job/{{$JobID}}" title="{{.DisplayJobName}}" style="font-size: 14px;">
  76. <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  77. </a>
  78. {{else if eq .JobType "BENCHMARK"}}
  79. <a class="title" href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/cloudbrain/benchmark/{{$JobID}}" title="{{.DisplayJobName}}" style="font-size: 14px;">
  80. <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  81. </a>
  82. {{end}}
  83. </div>
  84. <!-- 任务状态 -->
  85. <div class="two wide column text center nowrap" style="padding-left: 2.2rem !important; width: 11% !important;">
  86. <span class="job-status" id="{{$JobID}}" 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"}}{{if eq .ComputeResource "NPU"}}/modelarts/train-job{{else}}/cloudbrain/train-job{{end}}{{else if eq .JobType "BENCHMARK"}}/cloudbrain{{end}}' data-jobid="{{$JobID}}" data-version="{{.VersionName}}">
  87. <span><i id="{{$JobID}}-icon" style="vertical-align: middle;" class="{{.Status}}"></i><span id="{{$JobID}}-text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
  88. </span>
  89. </div>
  90. <!-- 任务类型 -->
  91. {{$JobType := $.i18n.Tr (printf "cloudbrain.%s" .JobType)}}
  92. <div class="one wide column text center nowrap" style="width:10%">
  93. <span style="font-size: 12px;" title="{{$JobType}}">{{$JobType}}</span>
  94. </div>
  95. <!-- 任务创建时间 -->
  96. <div class="two wide column text center nowrap" style="width: 11% !important;">
  97. <span style="font-size: 12px;" class="">{{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}</span>
  98. </div>
  99. <!-- 任务运行时间 -->
  100. <div class="one wide column text center nowrap" style="width:8.5% !important;">
  101. <span style="font-size: 12px;" id="duration-{{$JobID}}">{{if .TrainJobDuration}}{{.TrainJobDuration}}{{else}}--{{end}}</span>
  102. </div>
  103. <!-- 计算资源 -->
  104. <div class="one wide column text center nowrap" style="width:8.5% !important;">
  105. <span style="font-size: 12px;">{{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}</span>
  106. </div>
  107. <!-- 项目 -->
  108. <div class="two wide column text center nowrap" style="width: 14.5%!important;">
  109. <a href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}" title="{{.Repo.OwnerName}}/{{.Repo.Alias}}">{{.Repo.OwnerName}}/{{.Repo.Alias}}</a>
  110. </div>
  111. <div class="three wide column text center nowrap" style="width: 21.5%!important;">
  112. {{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE"}}
  113. <div class="ui compact buttons">
  114. <form id="debugAgainForm-{{$JobID}}">
  115. {{$.CsrfTokenHtml}}
  116. {{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}}
  117. <a style="margin: 0 1rem;" id="ai-debug-{{$JobID}}" class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}}disabled {{else}}blue {{end}}button' data-jobid="{{$JobID}}" data-repopath='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{$JobID}}/'>
  118. {{$.i18n.Tr "repo.debug"}}
  119. </a>
  120. {{else}}
  121. <a id="ai-debug-{{$JobID}}" class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}} disabled {{else}}blue {{end}}button' data-jobid="{{$JobID}}" data-repopath='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{$JobID}}/'>
  122. {{$.i18n.Tr "repo.debug_again"}}
  123. </a>
  124. {{end}}
  125. </form>
  126. </div>
  127. {{end}}
  128. <!-- 停止任务 -->
  129. <div class="ui compact buttons">
  130. {{if eq .JobType "DEBUG" "BENCHMARK" "SNN4IMAGENET" "BRAINSCORE"}}
  131. <form id="stopForm-{{$JobID}}" style="margin-left:-1px;">
  132. {{$.CsrfTokenHtml}}
  133. <a style="padding: 0.5rem 1rem;" id="ai-stop-{{$JobID}}" class='ui basic ai_stop {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED" "SUCCEEDED" "STOPPED" "STOPPING" "CREATE_FAILED"}}disabled {{else}} blue {{end}}button' 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' data-jobid="{{$JobID}}">
  134. {{$.i18n.Tr "repo.stop"}}
  135. </a>
  136. </form>
  137. {{else}}
  138. <a style="padding: 0.5rem 1rem;" id="ai-stop-{{$JobID}}" class='ui basic ai_stop_version {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED" "STOPPED" "SUCCEEDED" "CREATE_FAILED"}}disabled {{else}} blue {{end}}button' data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}/{{if eq .JobType "INFERENCE"}}modelarts/inference-job{{else if eq .JobType "TRAIN"}}{{if eq .ComputeResource "NPU"}}modelarts/train-job{{else}}cloudbrain/train-job{{end}}{{end}}' data-jobid="{{$JobID}}" data-version="{{.VersionName}}" >
  139. {{$.i18n.Tr "repo.stop"}}
  140. </a>
  141. {{end}}
  142. </div>
  143. <!-- 删除任务 -->
  144. <form class="ui compact buttons" id="delForm-{{$JobID}}" 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 .ComputeResource "NPU"}}/modelarts/train-job{{else}}/cloudbrain/train-job{{end}}{{end}}/{{$JobID}}/del?ishomepage=true' method="post">
  145. {{$.CsrfTokenHtml}}
  146. <a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{$JobID}}" data-repopath="{{.Repo.OwnerName}}/{{.Repo.Name}}/modelarts/inference-job/{{$JobID}}/del_version?ishomepage=true" data-version="" class="ui basic ai_delete blue button" style="border-radius: .28571429rem;">
  147. {{$.i18n.Tr "repo.delete"}}
  148. </a>
  149. </form>
  150. </div>
  151. </div>
  152. </div>
  153. {{else}}
  154. {{$JobID := '0'}}
  155. {{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK"}}
  156. {{$JobID = .Cloudbrain.ID}}
  157. {{else}}
  158. {{$JobID = .JobID}}
  159. {{end}}
  160. <div class="ui grid stackable item">
  161. <div class="row">
  162. <!-- 任务名 -->
  163. <div class="three wide column nowrap" style="width:15%">
  164. {{if eq .JobType "DEBUG"}}
  165. <a class="title" href="" title="{{.DisplayJobName}}" style="font-size: 14px;">
  166. <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  167. </a>
  168. {{else if eq .JobType "INFERENCE"}}
  169. <a class="title" href="" title="{{.DisplayJobName}}" style="font-size: 14px;">
  170. <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  171. </a>
  172. {{else if eq .JobType "TRAIN"}}
  173. <a class="title" href="" title="{{.DisplayJobName}}" style="font-size: 14px;">
  174. <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  175. </a>
  176. {{else if eq .JobType "BENCHMARK"}}
  177. <a class="title" href="" title="{{.DisplayJobName}}" style="font-size: 14px;">
  178. <span class="fitted" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
  179. </a>
  180. {{end}}
  181. </div>
  182. <!-- 任务状态 -->
  183. <div class="two wide column text center nowrap" style="padding-left: 2.2rem !important; width: 11% !important;">
  184. <span class="job-status" id="{{$JobID}}" data-jobid="{{$JobID}}" data-version="{{.VersionName}}">
  185. <span><i id="{{$JobID}}-icon" style="vertical-align: middle;" class="{{.Status}}"></i><span id="{{$JobID}}-text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
  186. </span>
  187. </div>
  188. <!-- 任务类型 -->
  189. {{$JobType := $.i18n.Tr (printf "cloudbrain.%s" .JobType)}}
  190. <div class="one wide column text center nowrap" style="width:10%">
  191. <span style="font-size: 12px;" title="{{$JobType}}">{{$JobType}}</span>
  192. </div>
  193. <!-- 任务创建时间 -->
  194. <div class="two wide column text center nowrap" style="width: 11% !important;">
  195. <span style="font-size: 12px;" class="">{{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}</span>
  196. </div>
  197. <!-- 任务运行时间 -->
  198. <div class="one wide column text center nowrap" style="width:8.5% !important;">
  199. <span style="font-size: 12px;" id="duration-{{$JobID}}">{{if .TrainJobDuration}}{{.TrainJobDuration}}{{else}}--{{end}}</span>
  200. </div>
  201. <!-- 计算资源 -->
  202. <div class="one wide column text center nowrap" style="width:8.5% !important;">
  203. <span style="font-size: 12px;">{{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}</span>
  204. </div>
  205. <!-- 创建者 -->
  206. <!-- 项目 -->
  207. <div class="two wide column text center nowrap" style="width: 14.5%!important;">
  208. <a href="" title="">--</a>
  209. </div>
  210. <div class="three wide column text center nowrap" style="width: 21.5%!important;">
  211. {{if eq .JobType "DEBUG"}}
  212. <div class="ui compact buttons">
  213. <form id="debugAgainForm-{{$JobID}}">
  214. {{$.CsrfTokenHtml}}
  215. {{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}}
  216. <a style="margin: 0 1rem;" id="ai-debug-{{$JobID}}" class='ui basic disabled button' >
  217. {{$.i18n.Tr "repo.debug"}}
  218. </a>
  219. {{else}}
  220. <a id="ai-debug-{{$JobID}}" class='ui basic disabled button' >
  221. {{$.i18n.Tr "repo.debug_again"}}
  222. </a>
  223. {{end}}
  224. </form>
  225. </div>
  226. {{end}}
  227. <!-- 停止任务 -->
  228. <div class="ui compact buttons">
  229. <a style="padding: 0.5rem 1rem;" id="ai-stop-{{$JobID}}" class="ui basic disabled button" data-jobid="{{$JobID}}" data-version="{{.VersionName}}" >
  230. {{$.i18n.Tr "repo.stop"}}
  231. </a>
  232. </div>
  233. <!-- 删除任务 -->
  234. <form class="ui compact buttons" id="delForm-{{$JobID}}" action='' method="post">
  235. {{$.CsrfTokenHtml}}
  236. <a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{$JobID}}" class="ui basic disabled button" style="border-radius: .28571429rem;">
  237. {{$.i18n.Tr "repo.delete"}}
  238. </a>
  239. </form>
  240. </div>
  241. </div>
  242. </div>
  243. {{end}}
  244. {{end}}
  245. <div id="app" style="margin-top: 2rem;">
  246. <div class="center">
  247. <el-pagination
  248. background
  249. @current-change="handleCurrentChange"
  250. :current-page="page"
  251. :page-sizes="[10]"
  252. :page-size="10"
  253. layout="total, sizes, prev, pager, next, jumper"
  254. :total="{{.Page.Paginater.Total}}">
  255. </el-pagination>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. <!-- 确认模态框 -->
  264. <div id="deletemodel">
  265. <div class="ui basic modal">
  266. <div class="ui icon header">
  267. <i class="trash icon"></i> {{.i18n.Tr "cloudbrain.delete_task"}}
  268. </div>
  269. <div class="content">
  270. <p>{{.i18n.Tr "cloudbrain.task_delete_confirm"}}</p>
  271. </div>
  272. <div class="actions">
  273. <div class="ui red basic inverted cancel button">
  274. <i class="remove icon"></i> {{.i18n.Tr "cloudbrain.operate_cancel"}}
  275. </div>
  276. <div class="ui green basic inverted ok button">
  277. <i class="checkmark icon"></i> {{.i18n.Tr "cloudbrain.operate_confirm"}}
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. </div>
  283. {{template "base/footer" .}}
  284. <script>
  285. function getParams(){
  286. const params = new URLSearchParams(window.location.search)
  287. params.get('jobType')
  288. let jobType
  289. if(!params.get('jobType')){
  290. jobType = '{{.i18n.Tr "admin.cloudbrain.all_task_types"}}'
  291. }else{
  292. if(params.get('jobType') === 'DEBUG'){
  293. jobType = '{{$.i18n.Tr (printf "cloudbrain.DEBUG")}}'
  294. }else if(params.get('jobType') === 'TRAIN'){
  295. jobType = '{{$.i18n.Tr (printf "cloudbrain.TRAIN")}}'
  296. }
  297. else if(params.get('jobType') === 'INFERENCE'){
  298. jobType = '{{$.i18n.Tr (printf "cloudbrain.INFERENCE")}}'
  299. }
  300. else if(params.get('jobType') === 'SNN4IMAGENET'){
  301. jobType = '{{$.i18n.Tr (printf "cloudbrain.SNN4IMAGENET")}}'
  302. }else if(params.get('jobType') === 'BENCHMARK'){
  303. jobType = '{{$.i18n.Tr (printf "cloudbrain.BENCHMARK")}}'
  304. }
  305. else{
  306. jobType = '{{$.i18n.Tr (printf "cloudbrain.BRAINSCORE")}}'
  307. }
  308. }
  309. let listType = !params.get('listType')? '{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}' : params.get('listType')
  310. let jobStatus = !params.get('jobStatus')? '{{.i18n.Tr "admin.cloudbrain.all_status"}}' : params.get('jobStatus').toUpperCase()
  311. const dropdownValueArray = [jobType,listType,jobStatus]
  312. $('#adminCloud .default.text ').each(function(index,e){
  313. $(e).text(dropdownValueArray[index])
  314. })
  315. }
  316. getParams()
  317. </script>