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