Browse Source

Merge branch 'fix-3144' of https://git.openi.org.cn/OpenI/aiforge into fix-3144

tags/v1.22.11.2^2^2
liuzx 3 years ago
parent
commit
8f4d50b6bc
4 changed files with 21 additions and 25 deletions
  1. +6
    -6
      templates/admin/cloudbrain/list.tmpl
  2. +4
    -6
      templates/admin/cloudbrain/search.tmpl
  3. +4
    -6
      templates/admin/cloudbrain/search_dashboard.tmpl
  4. +7
    -7
      templates/user/dashboard/cloudbrains.tmpl

+ 6
- 6
templates/admin/cloudbrain/list.tmpl View File

@@ -170,7 +170,7 @@
</div>
<!-- 智算中心 -->
<div class="one wide column text center nowrap" style="width:8% !important;">
<span style="font-size: 12px;" class="aicenter_{{.DisplayJobName}}_{{$JobID}}">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span>
<span style="font-size: 12px;" class="aicenter_{{.DisplayJobName}}_{{$JobID}}" title="{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span>
</div>
<!-- XPU类型 -->
<div class="one wide column text center nowrap" style="width:8% !important;">
@@ -184,16 +184,16 @@
spanEl.setAttribute('title', cardType);
spanEl.innerText = cardType;
var cluster = spec.Cluster || '--';
var cluster = {{.Cluster}} || '--';
var clusterName = document.querySelector('.cloudbrain_debug').dataset['cluster' + cluster[0] + cluster.toLocaleLowerCase().slice(1)] || '--';
spanEl = document.querySelector('.cluster_{{.DisplayJobName}}_{{$JobID}}');
spanEl.setAttribute('title', cluster);
spanEl.innerText = clusterName;

var aiCenter = spec.AiCenterName || '--';
spanEl = document.querySelector('.aicenter_{{.DisplayJobName}}_{{$JobID}}');
spanEl.setAttribute('title', aiCenter);
spanEl.innerText = aiCenter;
// var aiCenter = spec.AiCenterName || '--';
// spanEl = document.querySelector('.aicenter_{{.DisplayJobName}}_{{$JobID}}');
// spanEl.setAttribute('title', aiCenter);
// spanEl.innerText = aiCenter;
})();
</script>
<!-- 创建者 -->


+ 4
- 6
templates/admin/cloudbrain/search.tmpl View File

@@ -71,22 +71,20 @@
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
type: "GET",
url: "/api/v1/cloudbrain/get_center_info",
url: "/api/v1/cloudbrainboard/cloudbrain/resource_queues",
dataType: "json",
data: {},
success: function (res) {
var data = res || [];
var data = res.resourceQueues || [];
var aiCenterSelEl = $('#aiCenter-sel');
var itemEl = aiCenterSelEl.find('.menu .item').eq(0);
var selectAiCenterCode = aiCenterSelEl.find('.default').attr('aicenter');
var selectAiCenterName = '';
var lang = document.querySelector('html').getAttribute('lang') || 'en-US';
var except = ['', 'more'];
for (var i = 0, iLen = data.length; i < iLen; i++) {
var dataI = data[i];
var aiCenterCode = dataI.name;
if (except.indexOf(aiCenterCode) >= 0) continue;
var aiCenterName = lang === 'en-US' ? dataI.content_en : dataI.content;
var aiCenterCode = dataI.AiCenterCode;
var aiCenterName = dataI.AiCenterName;
var itemClone = itemEl.clone();
var oHref = itemClone.attr('href');
var oId = itemClone.attr('id');


+ 4
- 6
templates/admin/cloudbrain/search_dashboard.tmpl View File

@@ -85,22 +85,20 @@
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
type: "GET",
url: "/api/v1/cloudbrain/get_center_info",
url: "/api/v1/cloudbrainboard/cloudbrain/resource_queues",
dataType: "json",
data: {},
success: function (res) {
var data = res || [];
var data = res.resourceQueues || [];
var aiCenterSelEl = $('#aiCenter-sel');
var itemEl = aiCenterSelEl.find('.menu .item').eq(0);
var selectAiCenterCode = aiCenterSelEl.find('.default').attr('aicenter');
var selectAiCenterName = '';
var lang = document.querySelector('html').getAttribute('lang') || 'en-US';
var except = ['', 'more'];
for (var i = 0, iLen = data.length; i < iLen; i++) {
var dataI = data[i];
var aiCenterCode = dataI.name;
if (except.indexOf(aiCenterCode) >= 0) continue;
var aiCenterName = lang === 'en-US' ? dataI.content_en : dataI.content;
var aiCenterCode = dataI.AiCenterCode;
var aiCenterName = dataI.AiCenterName;
var itemClone = itemEl.clone();
var oHref = itemClone.attr('href');
var oId = itemClone.attr('id');


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

@@ -65,7 +65,7 @@
</div>
</div>
</div>
{{range .Tasks}}
{{range .Tasks}}
{{if .Repo}}
<div class="ui grid stackable item">
<div class="row">
@@ -154,7 +154,7 @@
<!-- 智算中心 -->
<div class="one wide column text center nowrap" style="width:8% !important;">
<span style="font-size: 12px;" class="aicenter_{{.DisplayJobName}}_{{$JobID}}">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span>
<span style="font-size: 12px;" class="aicenter_{{.DisplayJobName}}_{{$JobID}}" title="{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span>
</div>
<!-- XPU类型 -->
<div class="one wide column text center nowrap" style="width:10% !important;">
@@ -168,16 +168,16 @@
spanEl.setAttribute('title', cardType);
spanEl.innerText = cardType;
var cluster = spec.Cluster || '--';
var cluster = {{.Cluster}} || '--';
var clusterName = document.querySelector('.cloudbrain_debug').dataset['cluster' + cluster[0] + cluster.toLocaleLowerCase().slice(1)] || '--';
spanEl = document.querySelector('.cluster_{{.DisplayJobName}}_{{$JobID}}');
spanEl.setAttribute('title', cluster);
spanEl.innerText = clusterName;

var aiCenter = spec.AiCenterName || '--';
spanEl = document.querySelector('.aicenter_{{.DisplayJobName}}_{{$JobID}}');
spanEl.setAttribute('title', aiCenter);
spanEl.innerText = aiCenter;
// var aiCenter = spec.AiCenterName || '--';
// spanEl = document.querySelector('.aicenter_{{.DisplayJobName}}_{{$JobID}}');
// spanEl.setAttribute('title', aiCenter);
// spanEl.innerText = aiCenter;
})();
</script>
<!-- 项目 -->


Loading…
Cancel
Save