#2566 修复若干BUG #2427 #2374 #2368 #1620

Merged
chenshihai merged 5 commits from issue-zpz-0801 into V20220801 1 year ago
  1. +2
    -2
      templates/admin/dataset/list.tmpl
  2. +8
    -5
      templates/explore/dataset_list.tmpl
  3. +9
    -1
      templates/repo/cloudbrain/benchmark/show.tmpl
  4. +9
    -1
      templates/repo/cloudbrain/inference/show.tmpl
  5. +9
    -1
      templates/repo/cloudbrain/show.tmpl
  6. +9
    -1
      templates/repo/cloudbrain/trainjob/show.tmpl
  7. +2
    -2
      templates/repo/debugjob/index.tmpl
  8. +9
    -1
      templates/repo/modelarts/notebook/show.tmpl
  9. +1
    -1
      templates/repo/modelarts/trainjob/show.tmpl
  10. +1
    -1
      templates/user/dashboard/cloudbrains.tmpl
  11. +26
    -12
      web_src/js/features/clipboard.js
  12. +27
    -21
      web_src/less/_dataset.less
  13. +1
    -0
      web_src/less/openi.less

+ 2
- 2
templates/admin/dataset/list.tmpl View File

@@ -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" .}}

+ 8
- 5
templates/explore/dataset_list.tmpl View File

@@ -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>

+ 9
- 1
templates/repo/cloudbrain/benchmark/show.tmpl View File

@@ -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>


+ 9
- 1
templates/repo/cloudbrain/inference/show.tmpl View File

@@ -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>


+ 9
- 1
templates/repo/cloudbrain/show.tmpl View File

@@ -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>


+ 9
- 1
templates/repo/cloudbrain/trainjob/show.tmpl View File

@@ -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>


+ 2
- 2
templates/repo/debugjob/index.tmpl View File

@@ -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>


+ 9
- 1
templates/repo/modelarts/notebook/show.tmpl View File

@@ -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>


+ 1
- 1
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -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"


+ 1
- 1
templates/user/dashboard/cloudbrains.tmpl View File

@@ -361,4 +361,4 @@
</div>
</div>
</div>
{{template "base/footer" .}}
{{template "base/footer" .}}

+ 26
- 12
web_src/js/features/clipboard.js View File

@@ -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")
);
});
}

+ 27
- 21
web_src/less/_dataset.less View File

@@ -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;
}
}
}

+ 1
- 0
web_src/less/openi.less View File

@@ -311,6 +311,7 @@ footer .column {
}
.FAILED,
.START_FAILED,
.DELETED,
.CREATE_FAILED {
display: inline-block;
width: 18px;


Loading…
Cancel
Save