| @@ -35,7 +35,7 @@ | |||
| {{range .Datasets}} | |||
| <tr> | |||
| <td>{{.ID}}</td> | |||
| <td style="display: flex;align-items: center;"><a href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Alias}}/datasets">{{.Title}}</a>{{if .Recommend}}<img src="/img/jian.svg" style="margin-left: 0.5rem;">{{end}}</td> | |||
| <td style="display: flex;align-items: center;"><a href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/datasets">{{.Title}}</a>{{if .Recommend}}<img src="/img/jian.svg" style="margin-left: 0.5rem;">{{end}}</td> | |||
| <td><i class="fa fa{{if .IsPrivate}}-check{{end}}-square-o"></i></td> | |||
| <td><span title="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</span></td> | |||
| <td>{{if .Recommend}}<span class="set_dataset" style="color: rgb(250, 140, 22);cursor: pointer;" data-url="{{$.Link}}/{{.ID}}/action/unrecommend">{{$.i18n.Tr "admin.datasets.unrecommend"}}</span>{{else}}<span class="set_dataset" style="color: rgb(19, 194, 141);cursor: pointer;" data-url="{{$.Link}}/{{.ID}}/action/recommend">{{$.i18n.Tr "admin.datasets.recommend"}}</span>{{end}}</td> | |||
| @@ -48,4 +48,4 @@ | |||
| {{template "base/paginate" .}} | |||
| </div> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| {{template "base/footer" .}} | |||
| @@ -24,9 +24,9 @@ | |||
| <div class="ui sixteen wide mobile ten wide tablet ten wide computer colum"> | |||
| {{range .Datasets}} | |||
| <div class="item"> | |||
| <div class="ui header"> | |||
| <a class="name" href="{{.Repo.Link}}/datasets"> | |||
| {{.Repo.OwnerName}} / {{.Repo.Alias}} | |||
| <div class="ui header" style="display: flex;"> | |||
| <a class="name dataset-title-a" title="{{.Title}}" href="{{.Repo.Link}}/datasets"> | |||
| {{.Title}} | |||
| </a> | |||
| <div class="ui right metas"> | |||
| {{if .Task}} | |||
| @@ -40,7 +40,7 @@ | |||
| </div> | |||
| <div class="description"> | |||
| {{if .Description}} | |||
| <p class="has-emoji">{{.Description}}</p> | |||
| <p class="has-emoji" style="word-break: break-all;">{{.Description}}</p> | |||
| {{else if .Repo.DescriptionHTML}} | |||
| <p class="has-emoji">{{.Repo.DescriptionHTML}}</p> | |||
| {{end}} | |||
| @@ -53,4 +53,7 @@ | |||
| </div> | |||
| {{end}} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <script> | |||
| console.log({{.Datasets}}) | |||
| </script> | |||
| @@ -353,7 +353,15 @@ | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.Image}} | |||
| <span class="ui poping up clipboard" title="{{.Image}}" data-position="top center" id="clipboard-btn" style="cursor:pointer" | |||
| data-clipboard-text="{{.Image}}" | |||
| data-success="{{$.i18n.Tr "repo.copy_link_success"}}" | |||
| data-error="{{$.i18n.Tr "repo.copy_link_error"}}" | |||
| data-content="{{$.i18n.Tr "repo.copy_link"}}" | |||
| data-variation="inverted tiny" | |||
| > | |||
| {{.Image}} | |||
| </span> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| @@ -381,7 +381,15 @@ | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.Image}} | |||
| <span class="ui poping up clipboard" title="{{.Image}}" data-position="top center" id="clipboard-btn" style="cursor:pointer" | |||
| data-clipboard-text="{{.Image}}" | |||
| data-success="{{$.i18n.Tr "repo.copy_link_success"}}" | |||
| data-error="{{$.i18n.Tr "repo.copy_link_error"}}" | |||
| data-content="{{$.i18n.Tr "repo.copy_link"}}" | |||
| data-variation="inverted tiny" | |||
| > | |||
| {{.Image}} | |||
| </span> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| @@ -390,7 +390,15 @@ | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.Image}} | |||
| <span class="ui poping up clipboard" title="{{.Image}}" data-position="top center" id="clipboard-btn" style="cursor:pointer" | |||
| data-clipboard-text="{{.Image}}" | |||
| data-success="{{$.i18n.Tr "repo.copy_link_success"}}" | |||
| data-error="{{$.i18n.Tr "repo.copy_link_error"}}" | |||
| data-content="{{$.i18n.Tr "repo.copy_link"}}" | |||
| data-variation="inverted tiny" | |||
| > | |||
| {{.Image}} | |||
| </span> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| @@ -384,7 +384,15 @@ | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.Image}} | |||
| <span class="ui poping up clipboard" title="{{.Image}}" data-position="top center" id="clipboard-btn" style="cursor:pointer" | |||
| data-clipboard-text="{{.Image}}" | |||
| data-success="{{$.i18n.Tr "repo.copy_link_success"}}" | |||
| data-error="{{$.i18n.Tr "repo.copy_link_error"}}" | |||
| data-content="{{$.i18n.Tr "repo.copy_link"}}" | |||
| data-variation="inverted tiny" | |||
| > | |||
| {{.Image}} | |||
| </span> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| @@ -386,7 +386,7 @@ | |||
| {{$.CsrfTokenHtml}} | |||
| {{if .CanDel}} | |||
| <a id="ai-stop-{{.Cloudbrain.ID}}" | |||
| class='ui basic ai_stop {{if eq .Status "STOPPED" "FAILED" "START_FAILED" "STOPPING" "CREATING" "STARTING" "SUCCEEDED" "CREATE_FAILED"}}disabled {{else}}blue {{end}}button' | |||
| class='ui basic ai_stop {{if eq .Status "STOPPED" "FAILED" "START_FAILED" "STOPPING" "CREATING" "STARTING" "SUCCEEDED" "CREATE_FAILED" "DELETED"}}disabled {{else}}blue {{end}}button' | |||
| data-repopath="{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/stop" | |||
| data-jobid="{{.Cloudbrain.ID}}"> | |||
| {{$.i18n.Tr "repo.stop"}} | |||
| @@ -405,7 +405,7 @@ | |||
| {{$.CsrfTokenHtml}} | |||
| {{if .CanDel}} | |||
| <a id="ai-delete-{{.Cloudbrain.ID}}" | |||
| class='ui basic ai_delete {{if eq .Status "STOPPED" "FAILED" "START_FAILED" "SUCCEEDED" "CREATE_FAILED"}}blue {{else}}disabled {{end}}button' | |||
| class='ui basic ai_delete {{if eq .Status "STOPPED" "FAILED" "START_FAILED" "SUCCEEDED" "CREATE_FAILED" "DELETED"}}blue {{else}}disabled {{end}}button' | |||
| style="border-radius: .28571429rem;"> | |||
| {{$.i18n.Tr "repo.delete"}} | |||
| </a> | |||
| @@ -357,7 +357,15 @@ | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.Image}} | |||
| <span class="ui poping up clipboard" title="{{.Image}}" data-position="top center" id="clipboard-btn" style="cursor:pointer" | |||
| data-clipboard-text="{{.Image}}" | |||
| data-success="{{$.i18n.Tr "repo.copy_link_success"}}" | |||
| data-error="{{$.i18n.Tr "repo.copy_link_error"}}" | |||
| data-content="{{$.i18n.Tr "repo.copy_link"}}" | |||
| data-variation="inverted tiny" | |||
| > | |||
| {{.Image}} | |||
| </span> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| @@ -270,7 +270,7 @@ | |||
| {{end}} | |||
| {{if .CanDel}} | |||
| <a class="ti-action-menu-item stop-show-version {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED"}}disabled {{end}}" | |||
| <a class="ti-action-menu-item stop-show-version {{if eq .Status "KILLED" "FAILED" "START_FAILED" "KILLING" "COMPLETED" "SUCCEEDED" "STOPPED"}}disabled {{end}}" | |||
| id="{{.VersionName}}-stop" | |||
| data-jobid="{{.JobID}}" | |||
| data-repopath="{{$.RepoRelPath}}/modelarts/train-job" | |||
| @@ -361,4 +361,4 @@ | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| {{template "base/footer" .}} | |||
| @@ -1,23 +1,37 @@ | |||
| export default async function initClipboard() { | |||
| const els = document.querySelectorAll('.clipboard'); | |||
| const els = document.querySelectorAll(".clipboard"); | |||
| if (!els || !els.length) return; | |||
| const { default: ClipboardJS } = await import(/* webpackChunkName: "clipboard" */'clipboard'); | |||
| const { default: ClipboardJS } = await import( | |||
| /* webpackChunkName: "clipboard" */ "clipboard" | |||
| ); | |||
| const clipboard = new ClipboardJS(els); | |||
| clipboard.on('success', (e) => { | |||
| clipboard.on("success", (e) => { | |||
| e.clearSelection(); | |||
| $(`#${e.trigger.getAttribute('id')}`).popup('destroy'); | |||
| e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-success')); | |||
| $(`#${e.trigger.getAttribute('id')}`).popup('show'); | |||
| e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-original')); | |||
| $(`#${e.trigger.getAttribute("id")}`).popup("destroy"); | |||
| e.trigger.setAttribute( | |||
| "data-content", | |||
| e.trigger.getAttribute("data-success") | |||
| ); | |||
| $(`#${e.trigger.getAttribute("id")}`).popup("show"); | |||
| e.trigger.setAttribute( | |||
| "data-content", | |||
| e.trigger.getAttribute("data-original") | |||
| ); | |||
| }); | |||
| clipboard.on('error', (e) => { | |||
| $(`#${e.trigger.getAttribute('id')}`).popup('destroy'); | |||
| e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-error')); | |||
| $(`#${e.trigger.getAttribute('id')}`).popup('show'); | |||
| e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-original')); | |||
| clipboard.on("error", (e) => { | |||
| $(`#${e.trigger.getAttribute("id")}`).popup("destroy"); | |||
| e.trigger.setAttribute( | |||
| "data-content", | |||
| e.trigger.getAttribute("data-error") | |||
| ); | |||
| $(`#${e.trigger.getAttribute("id")}`).popup("show"); | |||
| e.trigger.setAttribute( | |||
| "data-content", | |||
| e.trigger.getAttribute("data-original") | |||
| ); | |||
| }); | |||
| } | |||
| @@ -140,27 +140,26 @@ | |||
| border: 1px solid #ffffff; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| .item { | |||
| border-bottom: 1px solid rgba(34,36,38,.15); | |||
| border-bottom: 1px solid rgba(34, 36, 38, 0.15); | |||
| .ui.buttons { | |||
| .button { | |||
| box-shadow: none !important; | |||
| } | |||
| } | |||
| } | |||
| .ui.grid > .row { | |||
| align-items: center; | |||
| } | |||
| .title { | |||
| font-size: 16px; | |||
| font-weight: bold; | |||
| margin: 0 6px; | |||
| margin: 0 6px; | |||
| overflow: hidden; | |||
| padding-right: 15px; | |||
| white-space: nowrap; | |||
| @@ -195,7 +194,15 @@ | |||
| .name { | |||
| word-break: break-all; | |||
| } | |||
| .dataset-title-a { | |||
| flex: 1; | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| min-width: 0; | |||
| word-break: inherit !important; | |||
| margin-right: 3rem; | |||
| white-space: nowrap; | |||
| } | |||
| .metas { | |||
| color: #888888; | |||
| font-size: 14px; | |||
| @@ -222,7 +229,7 @@ | |||
| } | |||
| } | |||
| } | |||
| .panel_creator_reponam{ | |||
| .panel_creator_reponam { | |||
| display: inline-block; | |||
| border-radius: 4px; | |||
| padding: 4px; | |||
| @@ -231,29 +238,28 @@ | |||
| background-color: rgba(161, 220, 255, 0.2); | |||
| color: #101010; | |||
| } | |||
| .panel_dataset_name{ | |||
| .panel_dataset_name { | |||
| font-size: 15px; | |||
| color: #0366D6; | |||
| color: #0366d6; | |||
| text-align: center; | |||
| margin-left: 1rem; | |||
| } | |||
| .panel_datset_desc{ | |||
| .panel_datset_desc { | |||
| white-space: nowrap; | |||
| display: inline-block; | |||
| overflow: hidden; | |||
| width: 90%; | |||
| text-overflow: ellipsis; | |||
| } | |||
| .el-dialog__body{ | |||
| padding-top:0 | |||
| .el-dialog__body { | |||
| padding-top: 0; | |||
| } | |||
| #dataset-base{ | |||
| .active{ | |||
| color: #0087f5!important; | |||
| border: 1px solid #0087f5!important; | |||
| #dataset-base { | |||
| .active { | |||
| color: #0087f5 !important; | |||
| border: 1px solid #0087f5 !important; | |||
| /* margin: -1px!important; */ | |||
| background: #fff!important; | |||
| background: #fff !important; | |||
| } | |||
| } | |||
| } | |||
| @@ -311,6 +311,7 @@ footer .column { | |||
| } | |||
| .FAILED, | |||
| .START_FAILED, | |||
| .DELETED, | |||
| .CREATE_FAILED { | |||
| display: inline-block; | |||
| width: 18px; | |||