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 19 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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 {
  88. color: #0366d6;
  89. }
  90. .heart-stroke {
  91. stroke: #FA8C16;
  92. stroke-width: 2;
  93. fill: #fff
  94. }
  95. .stars_active {
  96. fill: #FA8C16 !important;
  97. stroke: #FA8C16 !important
  98. }
  99. .diy-popper {
  100. max-width: 400px;
  101. }
  102. .ascending {
  103. width: 0;
  104. height: 0;
  105. border: 5px solid transparent;
  106. border-bottom-color: #c0c4cc;
  107. }
  108. .descending {
  109. width: 0;
  110. height: 0;
  111. border: 5px solid transparent;
  112. border-top-color: #c0c4cc;
  113. }
  114. </style>
  115. <div class="repository">
  116. {{template "repo/header" .}}
  117. {{if .dataset}}
  118. <div id="dataset-range-value" data-num-stars="{{.dataset.NumStars}}" data-star-active="{{$.IsStaringDataset}}"
  119. style="display: none;">
  120. {{range .Attachments}}
  121. <div class="item" data-private="{{.IsPrivate}}" data-decompress-state="{{.DecompressState}}"></div>
  122. {{end}}
  123. </div>
  124. <div id="dataset-base">
  125. <div class="ui container">
  126. <div class="ui mobile reversed stackable grid">
  127. <div class="row">
  128. <div class="column thirteen wide">
  129. <h2 class="nowrap">{{.dataset.Title}}</h2>
  130. </div>
  131. <div class="column three wide right aligned">
  132. <span style="display: flex;align-items: center;justify-content: flex-end;height: 36px;">
  133. {{if $.IsSigned}}
  134. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;padding: 0 10px;"
  135. @click="postStar({{.dataset.ID}},'{{.Link}}')">
  136. <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke"
  137. :class='{stars_active:star_active}'>
  138. <path
  139. 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">
  140. </path>
  141. </svg>
  142. </div>
  143. <span style="line-height: 1;">${num_stars}</span>
  144. {{else}}
  145. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;padding: 0 10px;">
  146. <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke"
  147. :class='{stars_active:star_active}'>
  148. <path
  149. 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">
  150. </path>
  151. </svg>
  152. </div>
  153. <span style="line-height: 1;">${num_stars}</span>
  154. {{end}}
  155. <a style="margin-left:30px;" href="{{.RepoLink}}/datasets/edit/{{.dataset.ID}}"
  156. class="ui primary basic mini {{if not $.CanWrite}} disabled {{end}} button">{{.i18n.Tr "repo.modelarts.modify"}}</a>
  157. </span>
  158. </div>
  159. {{if or (.dataset.Category) (.dataset.Task) (.dataset.License)}}
  160. <div class="column thirteen wide">
  161. {{if .dataset.Category}}
  162. {{$category := .dataset.Category}}
  163. <a class="ui repo-topic label topic"
  164. 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>
  165. {{end}}
  166. {{if .dataset.Task}}
  167. {{$task := .dataset.Task}}
  168. <a class="ui repo-topic label topic"
  169. 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>
  170. {{end}}
  171. {{if .dataset.License}}
  172. <a class="ui repo-topic label topic"
  173. href="{{AppSubUrl}}/explore/datasets?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{.dataset.License}}">{{.dataset.License}}</a>
  174. {{end}}
  175. </div>
  176. {{end}}
  177. </div>
  178. {{if .dataset.Description}}
  179. <div class="row" style="padding-top: 0;">
  180. <div class=" wrapper">
  181. <input id="exp1" class="exp" type="checkbox">
  182. <div class="text">
  183. <label class="btn" for="exp1"></label>
  184. {{.dataset.Description}}
  185. </div>
  186. </div>
  187. </div>
  188. {{end}}
  189. <div class="row">
  190. <div class="column ten wide"></div>
  191. <div class="column six wide right aligned">
  192. <el-select v-model="datasetType" style="width: 40%;" size="small" @change="changeDatasetType">
  193. <i slot="prefix" style="display: inline-block;color: #101010;"
  194. class="el-input__icon ri-archive-drawer-line"></i>
  195. <el-option label="{{$.i18n.Tr "repo.gpu_type_all"}}" value="-1"></el-option>
  196. <el-option label="CPU/GPU" value="0"></el-option>
  197. <el-option label="NPU" value="1"></el-option>
  198. </el-select>
  199. <el-button icon="el-icon-upload" {{if not $.CanWrite}} disabled {{end}} type="primary" size="small"
  200. @click="gotoUpload('{{.RepoLink}}',{{.dataset.ID}})">{{$.i18n.Tr "dataset.dataset_upload"}}</el-button>
  201. </div>
  202. </div>
  203. <div class="row">
  204. <div class="ui sixteen wide column dataset">
  205. <div class="ui grid stackable" style="background: #f0f0f0;;">
  206. <div class="row">
  207. <!-- 数据集名称 -->
  208. <div class="four wide column name_sort" @click="sortAble('name')"
  209. style="width: 24% !important;cursor: pointer;">
  210. {{$.i18n.Tr "dataset.dataset_file_name"}}
  211. <span class="caret-wrapper">
  212. <i class='ascending sort-caret-up {{if eq .SortType "nameAsc"}} active-up-sort {{end}}'
  213. @click.stop="sortIcon('name','up')"></i>
  214. <i class='descending sort-caret-down {{if eq .SortType "nameDesc"}} active-down-sort {{end}}'
  215. @click.stop="sortIcon('name','down')"></i>
  216. </span>
  217. </div>
  218. <div class="one wide column text center size_sort" @click="sortAble('size')"
  219. style="width: 7.25% !important;cursor: pointer;">
  220. {{$.i18n.Tr "repo.model.manage.size"}}
  221. <span class="caret-wrapper">
  222. <i class='ascending sort-caret-up {{if eq .SortType "sizeAsc"}} active-up-sort {{end}}'
  223. @click.stop="sortIcon('size','up')"></i>
  224. <i class='descending sort-caret-down {{if eq .SortType "sizeDesc"}} active-down-sort {{end}}'
  225. @click.stop="sortIcon('size','down')"></i>
  226. </span>
  227. </div>
  228. <div class="two wide column text center">
  229. {{$.i18n.Tr "dataset.dataset_available_clusters"}}
  230. </div>
  231. <div class="one wide column text center">
  232. {{$.i18n.Tr "repo.modelarts.status"}}
  233. </div>
  234. <div class="one wide column text center">
  235. {{$.i18n.Tr "repo.cloudbrain_creator"}}
  236. </div>
  237. <div class="three wide column text center" @click="sortAble('time')" style="cursor: pointer;">
  238. {{$.i18n.Tr "dataset.dataset_upload_time"}}
  239. <span class="caret-wrapper">
  240. <i class='ascending sort-caret-up {{if eq .SortType "timeAsc"}} active-up-sort {{end}}'
  241. @click.stop="sortIcon('time','up')"></i>
  242. <i class='descending sort-caret-down {{if eq .SortType "timeDesc"}} active-down-sort {{end}}'
  243. @click.stop="sortIcon('time','down')"></i>
  244. </span>
  245. </div>
  246. <div class="four wide column text center">
  247. {{$.i18n.Tr "repo.cloudbrain_operate"}}
  248. </div>
  249. </div>
  250. </div>
  251. {{range $k, $v :=.Attachments}}
  252. <div class="ui grid stackable item" id="{{.UUID}}">
  253. <div class="row">
  254. <!-- 数据集名称 -->
  255. <div class="four wide column" style="width: 24% !important;display: flex;align-items: center;">
  256. <el-tooltip class="item" effect="dark" placement="top" popper-class="diy-popper">
  257. <div slot="content"><span class="wrap">
  258. {{$.i18n.Tr "dataset.unzip_status"}}:{{if eq .DecompressState 1}}{{$.i18n.Tr "dataset.unzip_successed"}}{{else if eq .DecompressState 0}}{{$.i18n.Tr "dataset.unzip_stared"}}{{else}}{{$.i18n.Tr "dataset.unzip_failed"}}{{end}}
  259. &nbsp;&nbsp;<i class="ri-download-line"></i>{{$.i18n.Tr "dataset.download"}}:{{.DownloadCount}}
  260. {{if .Description}}&nbsp;&nbsp;{{$.i18n.Tr "dataset.description"}}:{{.Description}}{{end}}</span>
  261. </div>
  262. <div style="border: none;display: flex;align-items: center;max-width: 100%;">
  263. {{.DecompressState}}
  264. {{if eq .DecompressState 1}}
  265. <i class="ri-folder-open-line" style="color: #5bb973;"
  266. title='{{$.i18n.Tr "dataset.unzip_successed"}}'></i>
  267. {{else if eq .DecompressState 0}}
  268. <i class="ri-folder-chart-2-line" style="color: #888888;"
  269. title='{{$.i18n.Tr "dataset.unzip_stared"}}'></i>
  270. {{else}}
  271. <i class="ri-folder-forbid-line" style="color: #101010;"
  272. title='{{$.i18n.Tr "dataset.unzip_failed"}}'></i>
  273. {{end}}
  274. <a class="dataset_title title" href="{{.DownloadURL}}" title="{{.Name}}">
  275. {{.Name}}
  276. </a>
  277. <i class="ri-lock-2-line" style="color: #fa8c16;" v-if="privates[{{$k}}]"></i>
  278. </div>
  279. </el-tooltip>
  280. </div>
  281. <div class="one wide column text center" style="width: 7.25% !important;">
  282. {{.Size | FileSize}}
  283. </div>
  284. <div class="two wide column text center">
  285. {{.Type | AttachmentResourceType}}
  286. </div>
  287. <div class="one wide column text center">
  288. {{$x:=.IsPrivate | AttachmentStatus}}
  289. <span style="color: #fa8c16;" v-if="privates[{{$k}}]">{{$.i18n.Tr "home.show_private"}}</span>
  290. <span style="color: #13c28d;"
  291. v-else="privates[{{$k}}]">{{$.i18n.Tr "org.settings.visibility.public"}}</span>
  292. </div>
  293. <div class="one wide column text center">
  294. {{if .Uploader.Name}}
  295. <a href="{{AppSubUrl}}/{{.Uploader.Name}}" title="{{.Uploader.Name}}"><img class="ui avatar image"
  296. src="{{AppSubUrl}}/user/avatar/{{.Uploader.Name}}/-1"></a>
  297. {{else}}
  298. <a title="Ghost"><img class="ui avatar image" src="{{AppSubUrl}}/user/avatar/Ghost/-1"></a>
  299. {{end}}
  300. </div>
  301. <div class="three wide column text center">
  302. {{.CreatedUnix | TimeSinceUnix1}}
  303. </div>
  304. <div class="four wide column text right">
  305. <!-- <el-button type="text">下载</el-button>
  306. <el-button type="text">预览</el-button>
  307. <el-button type="text">标注</el-button>
  308. <el-button type="text">
  309. <el-popover
  310. placement="right"
  311. width="400"
  312. trigger="click">
  313. <span>asdasd</span>
  314. <el-button slot="reference" type="text"><i class="ri-more-line"></i></el-button>
  315. </el-popover>
  316. </el-button> -->
  317. <div class="ui compact buttons">
  318. <a class="ui basic blue button" href="{{.DownloadURL}}">{{$.i18n.Tr "dataset.download"}}</a>
  319. {{if eq .DecompressState 1}}
  320. <a class="ui basic blue button" href="datasets/dirs/{{.UUID}}?type={{$.Type}}"
  321. data-tooltip='{{$.i18n.Tr "dataset.directory"}}'>{{$.i18n.Tr "preview"}}</a>
  322. {{end}}
  323. {{if and (.CanDel) (not $.Repository.IsPrivate)}}
  324. <span class="ui basic blue button" style="color: #13c28d !important;"
  325. @click="setPrivate('{{.UUID}}',false,{{$k}})"
  326. v-if="privates[{{$k}}]">{{$.i18n.Tr "dataset.set_public"}}</span>
  327. <span class="ui basic blue button" style="color: #fa8c16 !important;"
  328. @click="setPrivate('{{.UUID}}',true,{{$k}})"
  329. v-else="privates[{{$k}}]">{{$.i18n.Tr "dataset.set_private"}}</span>
  330. {{end}}
  331. <!-- {{if $.CanRead}}
  332. <a class="ui basic blue button" href="datasets/label/{{.UUID}}?type={{$.Type}}" data-tooltip='{{$.i18n.Tr "dataset.create_label_task"}}'>标注</a>
  333. {{else}}
  334. <a class="ui basic disabled button">标注</a>
  335. {{end}} -->
  336. <a class="ui basic blue button">
  337. <el-dropdown size="medium">
  338. <span class="el-dropdown-link">
  339. {{$.i18n.Tr "repo.more"}}<i class="el-icon-arrow-down el-icon--right"></i>
  340. </span>
  341. <el-dropdown-menu slot="dropdown">
  342. <el-dropdown-item @click.native="copyUrl('{{.DownloadURL}}')">{{$.i18n.Tr "dataset.copy_url"}}
  343. </el-dropdown-item>
  344. <!-- <el-dropdown-item class="clipboard" data-clipboard-text="{{.Md5}}" data-clipboard-action="copy">{{$.i18n.Tr "dataset.copy_md5"}}</el-dropdown-item>-->
  345. {{if and ($.CanWrite) (eq .DecompressState 1) }}
  346. <el-dropdown-item @click.native="gotoAnnotate('{{$.RepoLink}}','{{.UUID}}',{{.Type}})">
  347. {{$.i18n.Tr "dataset.annotation"}}</el-dropdown-item>
  348. {{end}}
  349. {{if .CanDel}}
  350. <el-dropdown-item @click.native="gotoDatasetEidt('{{$.RepoLink}}',{{.ID}})">
  351. {{$.i18n.Tr "dataset.modify_description"}}</el-dropdown-item>
  352. <el-dropdown-item style="color: red;" @click.native="delDataset('{{.UUID}}')">
  353. {{$.i18n.Tr "dataset.delete"}}</el-dropdown-item>
  354. {{end}}
  355. </el-dropdown-menu>
  356. </el-dropdown>
  357. </a>
  358. </div>
  359. </div>
  360. </div>
  361. </div>
  362. {{end}}
  363. </div>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. <div id="app" style="margin-top: 2rem;">
  369. <div class="center">
  370. <el-pagination background @current-change="handleCurrentChange" :current-page="page" :page-sizes="[10]"
  371. :page-size="10" layout="total, sizes, prev, pager, next, jumper" :total="{{.Page.Paginater.Total}}">
  372. </el-pagination>
  373. </div>
  374. </div>
  375. {{else}}
  376. <div class="ui placeholder segment bgtask-none">
  377. <div class="ui icon header bgtask-header-pic"></div>
  378. <div class="bgtask-content-header">{{.i18n.Tr "dataset.dataset_no_create"}}</div>
  379. {{if $.CanWrite}}
  380. <a class="ui green button" href="{{.RepoLink}}/datasets/create">{{.i18n.Tr "dataset.create_new_dataset"}}</a>
  381. {{end}}
  382. <div class="bgtask-content">
  383. <div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_explain"}}</div>
  384. <div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_instructions_for_use"}}<a
  385. href="https://git.openi.org.cn/zeizei/OpenI_Learning">{{.i18n.Tr "dataset.dataset_camp_course"}}</a></div>
  386. </div>
  387. </div>
  388. {{end}}
  389. </div>
  390. <div class="ui small basic delete modal" id="data-dataset-delete-modal">
  391. <div class="ui icon header">
  392. <i class="trash icon"></i>
  393. {{.i18n.Tr "dataset.attachment.delete"}}
  394. </div>
  395. <div class="content">
  396. <p>{{.i18n.Tr "dataset.attachment.delete_desc" | Str2html}}</p>
  397. </div>
  398. {{template "base/delete_modal_actions" .}}
  399. </div>
  400. {{template "base/footer" .}}