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.

index.tmpl 18 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. {{template "base/head" .}}
  2. <style>
  3. .selectcloudbrain .active.item{
  4. color: #0087f5 !important;
  5. border: 1px solid #0087f5;
  6. margin: -1px;
  7. background: #FFF !important;
  8. }
  9. .dataset_title{
  10. font-size: 14px;
  11. max-width: 80%;
  12. display: inline-block !important;
  13. margin-left: 6px !important;
  14. padding-right: 0 !important;
  15. }
  16. .wrapper {
  17. display: flex;
  18. overflow: hidden;
  19. padding: 0 1rem;
  20. }
  21. .exp{
  22. display: none;
  23. }
  24. .exp:checked+.text{
  25. max-height: none;
  26. }
  27. .exp:checked+.text::after{
  28. visibility: hidden;
  29. }
  30. .exp:checked+.text .btn::before{
  31. visibility: hidden;
  32. }
  33. .exp:checked+.text .btn::after{
  34. content:'{{$.i18n.Tr "org.fold"}}'
  35. }
  36. .wrapper>.text {
  37. font-family: SourceHanSansSC-regular;
  38. font-size: 14px;
  39. color: #101010;
  40. overflow: hidden;
  41. text-overflow: ellipsis;
  42. text-align: justify;
  43. position: relative;
  44. line-height: 1.5;
  45. max-height: 3em;
  46. transition: .3s max-height;
  47. word-wrap: break-word;
  48. word-break: break-all;
  49. }
  50. .wrapper>.text::before {
  51. content: '';
  52. height: calc(100% - 20px);
  53. float: right;
  54. }
  55. .wrapper>.text::after {
  56. content: '';
  57. width: 999vw;
  58. height: 999vw;
  59. position: absolute;
  60. box-shadow: inset calc(100px - 999vw) calc(30px - 999vw) 0 0 #fff;
  61. margin-left: -100px;
  62. }
  63. .btn{
  64. position: relative;
  65. float: right;
  66. clear: both;
  67. margin-left: 20px;
  68. font-size: 14px;
  69. padding: 0 8px;
  70. background: #3F51B5;
  71. line-height: 20px;
  72. border-radius: 4px;
  73. color: #fff;
  74. cursor: pointer;
  75. /* margin-top: -30px; */
  76. }
  77. .btn::after{
  78. content:'{{$.i18n.Tr "org.unfold"}}'
  79. }
  80. .btn::before{
  81. content: '...';
  82. position: absolute;
  83. left: -5px;
  84. color: #333;
  85. transform: translateX(-100%)
  86. }
  87. .el-button--text{color:#0366d6 ;}
  88. .heart-stroke{
  89. stroke: #666;
  90. stroke-width: 2;
  91. fill: #fff
  92. }
  93. .stars_active{
  94. fill: #FA8C16 !important;
  95. stroke:#FA8C16 !important
  96. }
  97. .diy-popper{
  98. max-width: 400px;
  99. }
  100. </style>
  101. <div class="repository">
  102. {{template "repo/header" .}}
  103. {{if .dataset}}
  104. <div id="dataset-range-value" data-num-stars="{{.dataset.NumStars}}" data-star-active="{{$.IsStaringDataset}}" style="display: none;">
  105. {{range .Attachments}}
  106. <div class="item" data-private="{{.IsPrivate}}" data-decompress-state="{{.DecompressState}}"></div>
  107. {{end}}
  108. </div>
  109. <div id="dataset-base">
  110. <div class="ui container">
  111. <div class="ui mobile reversed stackable grid">
  112. <div class="row">
  113. <div class="column thirteen wide"><h2>{{.dataset.Title}}</h2></div>
  114. <div class="column three wide right aligned">
  115. <span style="display: flex;align-items: center;justify-content: flex-end;height: 36px;">
  116. {{if $.IsSigned}}
  117. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;padding: 0 10px;" @click="postStar({{.dataset.ID}},'{{.Link}}')">
  118. <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke" :class='{stars_active:star_active}'><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg>
  119. </div>
  120. <span style="line-height: 1;">${num_stars}</span>
  121. {{else}}
  122. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;padding: 0 10px;">
  123. <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke" :class='{stars_active:star_active}'><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg>
  124. </div>
  125. <span style="line-height: 1;">${num_stars}</span>
  126. {{end}}
  127. <a style="margin-left:30px;" href="{{.RepoLink}}/datasets/edit/{{.dataset.ID}}" class="ui primary basic mini {{if not $.CanWrite}} disabled {{end}} button">{{.i18n.Tr "repo.modelarts.modify"}}</a>
  128. </span>
  129. </div>
  130. {{if or (.dataset.Category) (.dataset.Task) (.dataset.License)}}
  131. <div class="column thirteen wide">
  132. {{if .dataset.Category}}
  133. {{$category := .dataset.Category}}
  134. <a class="ui repo-topic label topic" href="{{AppSubUrl}}/explore/datasets?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{.dataset.Category}}&task={{$.Task}}&license={{$.License}}">{{$.i18n.Tr (printf "dataset.category.%s" $category)}}</a>
  135. {{end}}
  136. {{if .dataset.Task}}
  137. {{$task := .dataset.Task}}
  138. <a class="ui repo-topic label topic" href="{{AppSubUrl}}/explore/datasets?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{.dataset.Task}}&license={{$.License}}">{{$.i18n.Tr (printf "dataset.task.%s" $task)}}</a>
  139. {{end}}
  140. {{if .dataset.License}}
  141. <a class="ui repo-topic label topic" href="{{AppSubUrl}}/explore/datasets?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{.dataset.License}}">{{.dataset.License}}</a>
  142. {{end}}
  143. </div>
  144. {{end}}
  145. </div>
  146. {{if .dataset.Description}}
  147. <div class="row" style="padding-top: 0;">
  148. <div class=" wrapper">
  149. <input id="exp1" class="exp" type="checkbox">
  150. <div class="text">
  151. <label class="btn" for="exp1"></label>
  152. {{.dataset.Description}}
  153. </div>
  154. </div>
  155. </div>
  156. {{end}}
  157. <div class="row">
  158. <div class="column ten wide"></div>
  159. <div class="column six wide right aligned">
  160. <el-select v-model="datasetType" style="width: 40%;" size="small" @change="changeDatasetType">
  161. <i slot="prefix" style="display: inline-block;color: #101010;" class="el-input__icon ri-archive-drawer-line"></i>
  162. <el-option label="{{$.i18n.Tr "repo.gpu_type_all"}}" value="-1"></el-option>
  163. <el-option label="CPU/GPU" value="0"></el-option>
  164. <el-option label="NPU" value="1"></el-option>
  165. </el-select>
  166. <el-button icon="el-icon-upload" {{if not $.CanWrite}} disabled {{end}} type="primary" size="small" @click="gotoUpload('{{.RepoLink}}',{{.dataset.ID}})">{{$.i18n.Tr "dataset.dataset_upload"}}</el-button>
  167. </div>
  168. </div>
  169. <div class="row">
  170. <div class="ui sixteen wide column dataset">
  171. <div class="ui grid stackable" style="background: #f0f0f0;;">
  172. <div class="row">
  173. <!-- 数据集名称 -->
  174. <div class="four wide column" style="width: 24% !important;">
  175. <span style="margin:0 6px">{{$.i18n.Tr "dataset.dataset_file_name"}}</span>
  176. </div>
  177. <div class="one wide column text center" style="width: 7.25% !important;">
  178. {{$.i18n.Tr "repo.model.manage.size"}}
  179. </div>
  180. <div class="two wide column text center">
  181. {{$.i18n.Tr "dataset.dataset_available_clusters"}}
  182. </div>
  183. <div class="one wide column text center">
  184. {{$.i18n.Tr "repo.modelarts.status"}}
  185. </div>
  186. <div class="one wide column text center">
  187. {{$.i18n.Tr "repo.cloudbrain_creator"}}
  188. </div>
  189. <div class="three wide column text center">
  190. {{$.i18n.Tr "dataset.dataset_upload_time"}}
  191. </div>
  192. <div class="four wide column text center">
  193. {{$.i18n.Tr "repo.cloudbrain_operate"}}
  194. </div>
  195. </div>
  196. </div>
  197. {{range $k, $v :=.Attachments}}
  198. <div class="ui grid stackable item" id="{{.FileChunk.UUID}}">
  199. <div class="row">
  200. <!-- 数据集名称 -->
  201. <div class="four wide column" style="width: 24% !important;display: flex;align-items: center;">
  202. {{if .Description}}
  203. <el-tooltip class="item" effect="dark" placement="top" popper-class="diy-popper">
  204. <div slot="content" >{{.Description}}</br><span><i class="ri-download-line"></i>{{$.i18n.Tr "dataset.download"}}:{{.DownloadCount}}</span></div>
  205. <a class="dataset_title title" href="{{.DownloadURL}}" title="{{.Name}}" style="border: none;">
  206. {{.Name}}
  207. </a>
  208. </el-tooltip>
  209. {{else}}
  210. <el-tooltip class="item" effect="dark" placement="top" popper-class="diy-popper">
  211. <div slot="content" ><span><i class="ri-download-line"></i>{{$.i18n.Tr "dataset.download"}}:{{.DownloadCount}}</span></div>
  212. <a class="dataset_title title" href="{{.DownloadURL}}" title="{{.Name}}" style="border: none;">
  213. {{.Name}}
  214. </a>
  215. </el-tooltip>
  216. {{end}}
  217. <i class="ri-lock-2-line" style="color: #fa8c16;" v-if="privates[{{$k}}]"></i>
  218. <!-- <i class="COMPLETED" v-if="zipStatus[{{$k}}]==1"></i>
  219. <i class="WAITING" v-if="zipStatus[{{$k}}]==2"></i>
  220. <i class="FAILED" v-if="zipStatus[{{$k}}]==3"></i> -->
  221. </div>
  222. <div class="one wide column text center" style="width: 7.25% !important;">
  223. {{.Size | FileSize}}
  224. </div>
  225. <div class="two wide column text center">
  226. {{.Type | AttachmentResourceType}}
  227. </div>
  228. <div class="one wide column text center">
  229. {{$x:=.IsPrivate | AttachmentStatus}}
  230. <span style="color: #fa8c16;" v-if="privates[{{$k}}]">{{$.i18n.Tr "home.show_private"}}</span>
  231. <span style="color: #13c28d;" v-else="privates[{{$k}}]">{{$.i18n.Tr "org.settings.visibility.public"}}</span>
  232. </div>
  233. <div class="one wide column text center">
  234. {{if .Uploader.Name}}
  235. <a href="{{AppSubUrl}}/{{.Uploader.Name}}" title="{{.Uploader.Name}}"><img class="ui avatar image" src="{{AppSubUrl}}/user/avatar/{{.Uploader.Name}}/-1"></a>
  236. {{else}}
  237. <a title="Ghost"><img class="ui avatar image" src="{{AppSubUrl}}/user/avatar/Ghost/-1"></a>
  238. {{end}}
  239. </div>
  240. <div class="three wide column text center">
  241. {{.CreatedUnix | TimeSinceUnix1}}
  242. </div>
  243. <div class="four wide column text right">
  244. <!-- <el-button type="text">下载</el-button>
  245. <el-button type="text">预览</el-button>
  246. <el-button type="text">标注</el-button>
  247. <el-button type="text">
  248. <el-popover
  249. placement="right"
  250. width="400"
  251. trigger="click">
  252. <span>asdasd</span>
  253. <el-button slot="reference" type="text"><i class="ri-more-line"></i></el-button>
  254. </el-popover>
  255. </el-button> -->
  256. <div class="ui compact buttons">
  257. <a class="ui basic blue button" href="{{.DownloadURL}}">{{$.i18n.Tr "dataset.download"}}</a>
  258. {{if eq .DecompressState 1}}
  259. <a class="ui basic blue button" href="datasets/dirs/{{.UUID}}?type={{$.Type}}" data-tooltip='{{$.i18n.Tr "dataset.directory"}}'>{{$.i18n.Tr "preview"}}</a>
  260. {{end}}
  261. {{if and (.CanDel) (not $.Repository.IsPrivate)}}
  262. <span class="ui basic blue button" style="color: #13c28d !important;" @click="setPrivate('{{.FileChunk.UUID}}',false,{{$k}})" v-if="privates[{{$k}}]">{{$.i18n.Tr "dataset.set_public"}}</span>
  263. <span class="ui basic blue button" style="color: #fa8c16 !important;" @click="setPrivate('{{.FileChunk.UUID}}',true,{{$k}})" v-else="privates[{{$k}}]">{{$.i18n.Tr "dataset.set_private"}}</span>
  264. {{end}}
  265. <!-- {{if $.CanRead}}
  266. <a class="ui basic blue button" href="datasets/label/{{.UUID}}?type={{$.Type}}" data-tooltip='{{$.i18n.Tr "dataset.create_label_task"}}'>标注</a>
  267. {{else}}
  268. <a class="ui basic disabled button">标注</a>
  269. {{end}} -->
  270. <a class="ui basic blue button">
  271. <el-dropdown size="medium">
  272. <span class="el-dropdown-link">
  273. {{$.i18n.Tr "repo.more"}}<i class="el-icon-arrow-down el-icon--right"></i>
  274. </span>
  275. <el-dropdown-menu slot="dropdown">
  276. <el-dropdown-item class="clipboard" data-clipboard-text="{{.DownloadURL}}" data-clipboard-action="copy">{{$.i18n.Tr "dataset.copy_url"}}</el-dropdown-item>
  277. <el-dropdown-item class="clipboard" data-clipboard-text="{{.FileChunk.Md5}}" data-clipboard-action="copy">{{$.i18n.Tr "dataset.copy_md5"}}</el-dropdown-item>
  278. {{if and ($.CanWrite) (eq .DecompressState 1) }}
  279. <el-dropdown-item @click.native="gotoAnnotate('{{$.RepoLink}}','{{.UUID}}',{{.Type}})">{{$.i18n.Tr "dataset.annotation"}}</el-dropdown-item>
  280. {{end}}
  281. {{if .CanDel}}
  282. <el-dropdown-item @click.native="gotoDatasetEidt('{{$.RepoLink}}',{{.ID}})">{{$.i18n.Tr "dataset.modify_description"}}</el-dropdown-item>
  283. <el-dropdown-item style="color: red;" @click.native="delDataset('{{.FileChunk.UUID}}')">{{$.i18n.Tr "dataset.delete"}}</el-dropdown-item>
  284. {{end}}
  285. </el-dropdown-menu>
  286. </el-dropdown>
  287. </a>
  288. </div>
  289. </div>
  290. </div>
  291. </div>
  292. {{end}}
  293. </div>
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. <div id="app" style="margin-top: 2rem;">
  299. <div class="center">
  300. <el-pagination
  301. background
  302. @current-change="handleCurrentChange"
  303. :current-page="page"
  304. :page-sizes="[10]"
  305. :page-size="10"
  306. layout="total, sizes, prev, pager, next, jumper"
  307. :total="{{.Page.Paginater.Total}}">
  308. </el-pagination>
  309. </div>
  310. </div>
  311. {{else}}
  312. <div class="ui placeholder segment bgtask-none">
  313. <div class="ui icon header bgtask-header-pic"></div>
  314. <div class="bgtask-content-header">{{.i18n.Tr "dataset.dataset_no_create"}}</div>
  315. {{if $.CanWrite}}
  316. <a class="ui green button" href="{{.RepoLink}}/datasets/create">{{.i18n.Tr "dataset.create_new_dataset"}}</a>
  317. {{end}}
  318. <div class="bgtask-content">
  319. <div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_explain"}}</div>
  320. <div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_instructions_for_use"}}<a href="https://git.openi.org.cn/zeizei/OpenI_Learning">{{.i18n.Tr "dataset.dataset_camp_course"}}</a></div>
  321. </div>
  322. </div>
  323. {{end}}
  324. </div>
  325. <div class="ui small basic delete modal" id="data-dataset-delete-modal">
  326. <div class="ui icon header">
  327. <i class="trash icon"></i>
  328. {{.i18n.Tr "dataset.attachment.delete"}}
  329. </div>
  330. <div class="content">
  331. <p>{{.i18n.Tr "dataset.attachment.delete_desc" | Str2html}}</p>
  332. </div>
  333. {{template "base/delete_modal_actions" .}}
  334. </div>
  335. {{template "base/footer" .}}