Browse Source

Merge pull request '优化云脑任务列表样式' (#466) from web into V20210927

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/466
tags/v1.21.9.2
lewis 4 years ago
parent
commit
4b4242f3c2
5 changed files with 71 additions and 96 deletions
  1. +1
    -1
      templates/org/create.tmpl
  2. +40
    -50
      templates/repo/cloudbrain/index.tmpl
  3. +1
    -1
      templates/repo/migrate.tmpl
  4. +27
    -41
      templates/repo/modelarts/index.tmpl
  5. +2
    -3
      web_src/less/_dataset.less

+ 1
- 1
templates/org/create.tmpl View File

@@ -1,5 +1,5 @@
{{template "base/head" .}} {{template "base/head" .}}
<div class="organization new org">
<div class="organization new org" style="margin-top: 25px;">
<div class="ui middle very relaxed page grid"> <div class="ui middle very relaxed page grid">
<div class="column"> <div class="column">
<form class="ui form" action="{{.Link}}" method="post"> <form class="ui form" action="{{.Link}}" method="post">


+ 40
- 50
templates/repo/cloudbrain/index.tmpl View File

@@ -256,74 +256,64 @@
<div class="row"> <div class="row">


<!-- 任务名 --> <!-- 任务名 -->
<div class="four wide column">
<div class="seven wide column">
<a class="title" href="{{$.Link}}/{{.JobID}}"> <a class="title" href="{{$.Link}}/{{.JobID}}">
<span class="fitted">{{svg "octicon-tasklist" 16}}</span> <span class="fitted">{{svg "octicon-tasklist" 16}}</span>
<span class="fitted">{{.JobName}}</span> <span class="fitted">{{.JobName}}</span>
</a> </a>
</div> </div>


<!--任务状态 -->
<div class="two wide column job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}">
{{.Status}}
</div>

<!-- 任务创建时间 -->
<div class="three wide column"> <div class="three wide column">
<span class="ui text center">{{svg "octicon-flame" 16}} {{TimeSinceUnix .CreatedUnix $.Lang}}</span>
<!--任务状态 -->
<span class="mini ui compact button job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}">
{{.Status}}
</span>
<!-- 任务创建时间 -->
<span class="">{{TimeSinceUnix .CreatedUnix $.Lang}}</span>
</div> </div>


<!-- 评分 -->
<div class="one wide column">
<div class="ui text center clipboard">
<a class="title" onclick="stop(this)" href="{{if and (ne .Status "WAITING") (ne .JobType "DEBUG")}}{{$.Link}}/{{.JobID}}/rate{{else}}javascript:void(0);{{end}}" style="{{if and (ne .Status "WAITING") (ne .JobType "DEBUG")}}{{else}}color:#CCCCCC{{end}}">
<span class="fitted">评分</span>
</a>
</div>
</div>
<div class="six wide column text right">
<div class="mini ui compact buttons">
{{if and (ne .Status "WAITING") (ne .JobType "DEBUG")}}
<a class="ui basic button" href="{{$.Link}}/{{.JobID}}/rate" target="_blank">
评分
</a>
{{end}}


<!-- 删除镜像 -->
<div class="one wide column">
<div class="ui text center clipboard">
<form id="delForm-{{.JobID}}" action="{{if ne .Status "STOPPED"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/del{{end}}" method="post">
<!-- 调试 -->
<a class="ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" href="{{$.Link}}/{{.JobID}}/debug" target="_blank">
调试
</a>
<form id="stopForm-{{.JobID}}" action="{{if eq .Status "STOPPED"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/stop{{end}}" method="post">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<a class="fitted" onclick="assertDelete(this)" style="{{if ne .Status "STOPPED"}}color:#CCCCCC{{end}}; font-size:16px; font-weight:bold">删除</a>
</form>
</div>
</div>

<!-- 调试 -->
<div class="one wide column">
<div class="ui text center clipboard">
<a class="title" onclick="stop(this)" href="{{if not .CanDebug}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/debug{{end}}" style="{{if not .CanDebug}}color:#CCCCCC{{end}}">
<span class="fitted">调试</span>
</a>
<a class="ui basic {{if eq .Status "STOPPED"}}disabled {{else}}blue {{end}}button" onclick="document.getElementById('stopForm-{{.JobID}}').submit();">
停止
</a>
</form>
</div> </div>
</div>
<div class="mini ui compact buttons">
<!-- 模型下载 -->
<a class="ui basic blue button" href="{{$.Link}}/{{.JobID}}/models" target="_blank">
模型下载
</a>
<!-- 接收结果 -->
<iframe src="" frameborder="0" name="iframeContent" style="display: none;"></iframe>
<a class="mini ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" value="{{.CanDebug}}">提交镜像</a>


<!-- 停止 -->
<div class="one wide column">
<div class="ui text center clipboard">
<form id="stopForm-{{.JobID}}" action="{{if eq .Status "STOPPED"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/stop{{end}}" method="post">
{{$.CsrfTokenHtml}}
<a class="fitted" onclick="document.getElementById('stopForm-{{.JobID}}').submit();" style="{{if eq .Status "STOPPED"}}color:#CCCCCC{{end}}; font-size:16px; font-weight:bold">停止</a>
</form>
</div> </div>
</div>


<!-- 模型下载 -->
<div class="two wide column">
<span class="ui text clipboard">
<a class="title" href="{{$.Link}}/{{.JobID}}/models">
<span class="fitted">模型下载</span>
<!-- 删除镜像 -->
<form class="mini ui compact buttons" id="delForm-{{.JobID}}" action="{{if ne .Status "STOPPED"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/del{{end}}" method="post">
{{$.CsrfTokenHtml}}
<a class="ui compact {{if ne .Status "STOPPED"}}disabled {{else}}red {{end}}button" onclick="assertDelete(this)">
删除
</a> </a>
</span>
</form>
</div> </div>


<!-- 接收结果 -->
<iframe src="" frameborder="0" name="iframeContent" style="display: none;"></iframe>
<a class="imageBtn" style="{{if not .CanDebug}}color:#CCCCCC;cursor:pointer;pointer-events:none;{{end}}; font-size:16px; font-weight:bold" value="{{.CanDebug}}">提交镜像</a>

<!-- 镜像列表弹窗 --> <!-- 镜像列表弹窗 -->
<div id="imageModal" class="modal" style="display: none;"> <div id="imageModal" class="modal" style="display: none;">
<div class="modal-content"> <div class="modal-content">


+ 1
- 1
templates/repo/migrate.tmpl View File

@@ -1,5 +1,5 @@
{{template "base/head" .}} {{template "base/head" .}}
<div class="repository new migrate">
<div class="repository new migrate" style="margin-top: 40px;">
<div class="ui middle very relaxed page grid"> <div class="ui middle very relaxed page grid">
<div class="column"> <div class="column">
<form class="ui form" action="{{.Link}}" method="post"> <form class="ui form" action="{{.Link}}" method="post">


+ 27
- 41
templates/repo/modelarts/index.tmpl View File

@@ -247,61 +247,47 @@
{{range .Tasks}} {{range .Tasks}}
<div class="ui grid stackable item"> <div class="ui grid stackable item">
<div class="row"> <div class="row">
<!-- 任务名 --> <!-- 任务名 -->
<div class="four wide column">
<div class="seven wide column">
<a class="title" href="{{$.Link}}/{{.JobID}}"> <a class="title" href="{{$.Link}}/{{.JobID}}">
<span class="fitted">{{svg "octicon-tasklist" 16}}</span> <span class="fitted">{{svg "octicon-tasklist" 16}}</span>
<span class="fitted">{{.JobName}}</span> <span class="fitted">{{.JobName}}</span>
</a> </a>
</div> </div>


<!--任务状态 -->
<div class="three wide column job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}">
{{.Status}}
</div>

<!-- 任务创建时间 -->
<div class="three wide column"> <div class="three wide column">
<span class="ui text center">{{svg "octicon-flame" 16}} {{TimeSinceUnix .CreatedUnix $.Lang}}</span>
</div>

<!-- 查看 -->
<div class="one wide column">
<span class="ui text clipboard">
<a class="title" href="{{$.Link}}/{{.JobID}}">
<span class="fitted">查看</span>
</a>
<!--任务状态 -->
<span class="mini ui compact button job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}">
{{.Status}}
</span> </span>
<!-- 任务创建时间 -->
<span class="">{{TimeSinceUnix .CreatedUnix $.Lang}}</span>
</div> </div>


<!-- 删除任务 -->
<div class="one wide column">
<div class="ui text center clipboard">
<form id="delForm-{{.JobID}}" action="{{if ne .Status "STOPPED"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/del{{end}}" method="post">
{{$.CsrfTokenHtml}}
<a class="fitted" onclick="assertDelete(this)" style="{{if ne .Status "STOPPED"}}color:#CCCCCC{{end}}; font-size:16px; font-weight:bold">删除</a>
</form>
</div>
</div>

<!-- 调试 -->
<div class="one wide column">
<div class="ui text center clipboard">
<a class="title" onclick="stop(this)" href="{{if not .CanDebug}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/debug{{end}}" style="{{if not .CanDebug}}color:#CCCCCC{{end}}">
<span class="fitted">调试</span>
</a>
</div>
</div>

<!-- 停止 -->
<div class="one wide column">
<div class="ui text center clipboard">
<div class="six wide column text right">
<div class="mini ui compact buttons">
<a class="ui basic button" href="{{$.Link}}/{{.JobID}}">
查看
</a>
<a class="ui basic {{if not .CanDebug}}disabled {{else}}blue {{end}}button" href="{{$.Link}}/{{.JobID}}/debug">
调试
</a>
<form id="stopForm-{{.JobID}}" action="{{if ne .Status "RUNNING"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/stop{{end}}" method="post"> <form id="stopForm-{{.JobID}}" action="{{if ne .Status "RUNNING"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/stop{{end}}" method="post">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<a class="fitted" onclick="document.getElementById('stopForm-{{.JobID}}').submit();" style="{{if ne .Status "RUNNING"}}color:#CCCCCC{{end}}; font-size:16px; font-weight:bold">停止</a>
</form>
<a class="ui basic {{if eq .Status "RUNNING"}}disabled {{else}}blue {{end}}" onclick="document.getElementById('stopForm-{{.JobID}}').submit();">
停止
</a>
</form>
</div> </div>

<!-- 删除任务 -->
<form class="mini ui compact buttons" id="delForm-{{.JobID}}" action="{{if ne .Status "STOPPED"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/del{{end}}" method="post">
{{$.CsrfTokenHtml}}
<a class="ui compact {{if ne .Status "STOPPED"}}disabled {{else}}red {{end}}button" onclick="assertDelete(this)">
删除
</a>
</form>
</div> </div>


<!-- 镜像列表弹窗 --> <!-- 镜像列表弹窗 -->


+ 2
- 3
web_src/less/_dataset.less View File

@@ -143,10 +143,9 @@
} }
} }
.item { .item {
padding-top: 15px;
padding-bottom: 10px;
border-bottom: 1px dashed #aaaaaa;
border-bottom: 1px solid rgba(34,36,38,.15);
} }
.ui.grid > .row { .ui.grid > .row {
align-items: center; align-items: center;
} }


Loading…
Cancel
Save