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