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