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

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