#4387 fix issue #4354 #4273 #4189

Merged
chenshihai merged 12 commits from issue_zpz_0620 into V20230628 10 months ago
  1. +2
    -0
      models/notification.go
  2. +2
    -1
      options/locale/locale_en-US.ini
  3. +2
    -1
      options/locale/locale_zh-CN.ini
  4. +2
    -0
      routers/user/notification.go
  5. +1
    -34
      templates/notice.tmpl
  6. +1
    -1
      templates/repo/cloudbrain/benchmark/index.tmpl
  7. +1
    -1
      templates/repo/modelarts/inferencejob/index.tmpl
  8. +1
    -1
      templates/repo/modelarts/trainjob/index.tmpl
  9. +1
    -1
      templates/user/notification/notification.tmpl
  10. +10
    -1
      templates/user/notification/notification_div.tmpl
  11. +44
    -0
      web_src/js/features/notification.js
  12. +29
    -0
      web_src/less/openi.less
  13. +1
    -1
      web_src/vuepages/langs/config/en-US.js
  14. +1
    -1
      web_src/vuepages/langs/config/zh-CN.js
  15. +2
    -2
      web_src/vuepages/pages/cloudbrain/configs.js
  16. +1
    -1
      web_src/vuepages/pages/dataset/square/components/PublicDataset.vue

+ 2
- 0
models/notification.go View File

@@ -29,6 +29,8 @@ const (
NotificationStatusUnread NotificationStatus = iota + 1
// NotificationStatusRead represents a read notification
NotificationStatusRead
// NotificationStatusRead represents a notification
NotificationStatusNotice
// NotificationStatusPinned represents a pinned notification
NotificationStatusPinned
)


+ 2
- 1
options/locale/locale_en-US.ini View File

@@ -1301,7 +1301,7 @@ model_Evaluation_not_created = Model evaluation has not been created
repo_not_initialized = Code version: You have not initialized the code repository, please <a href="%s"> initialized </a> first ;
debug_task_running_limit =Running time: no more than 4 hours, it will automatically stop if it exceeds 4 hours;
dataset_desc = Dataset: Cloud Brain 1 provides CPU/GPU,Cloud Brain 2 provides Ascend NPU.And dataset also needs to be uploaded to the corresponding environment;
platform_instructions = Instructions for use: You can refer to the <a href="https://openi.pcl.ac.cn/zeizei/OpenI_Learning"> OpenI_Learning </a> course of Qizhi AI collaboration platform.
platform_instructions = Instructions for use: You can refer to the OpenI AI collaboration platform<a href="%s"> Help Center </a>.
platform_instructions1 = Instructions for use: You can refer to the
platform_instructions2 = OpenI_Learning
platform_instructions3 = course of Openi AI collaboration platform.
@@ -3238,6 +3238,7 @@ max_size_tooltips= You can only upload a maximum of ? files at a time. The uploa
notifications = Notifications
unread = Unread
read = Read
notice = Notice
no_unread = No unread notifications.
no_read = No read notifications.
pin = Pin notification


+ 2
- 1
options/locale/locale_zh-CN.ini View File

@@ -1313,7 +1313,7 @@ model_Evaluation_not_created = 未创建过评测任务
repo_not_initialized = 代码版本:您还没有初始化代码仓库,请先<a href=%s>创建代码版本</a>;
debug_task_running_limit = 运行时长:最长不超过4个小时,超过4个小时将自动停止;
dataset_desc = 数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境;
platform_instructions = 使用说明:可以参考启智AI协作平台<a href="https://openi.pcl.ac.cn/zeizei/OpenI_Learning">小白训练营课程</a>。
platform_instructions = 使用说明:可以参考启智AI协作平台 <a href="%s" target="_blank">帮助中心</a>。
platform_instructions1 = 使用说明:可以参考启智AI协作平台
platform_instructions2 = 小白训练营课程
platform_instructions3 = 。
@@ -3256,6 +3256,7 @@ max_size_tooltips=一次最多只能上传?个文件, 上传已达到上限,
notifications=通知
unread=未读消息
read=已读消息
notice=通知消息
no_unread=没有未读通知。
no_read=没有未读通知。
pin=Pin 通知


+ 2
- 0
routers/user/notification.go View File

@@ -73,6 +73,8 @@ func getNotifications(c *context.Context) {
switch keyword {
case "read":
status = models.NotificationStatusRead
case "notice":
status = models.NotificationStatusNotice
default:
status = models.NotificationStatusUnread
}


+ 1
- 34
templates/notice.tmpl View File

@@ -1,38 +1,5 @@

{{template "base/head_home" .}}
<style>
.notice-container {
}
.notice-row {
display: flex;
justify-content: space-between;
align-items: center;
height: 52px;
border-bottom: 1px solid rgba(157, 197, 226, 0.2);
padding: 0 16px;
}
.notice-title {
flex: 1;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.notice-title a {
font-size: 16px;
color: rgb(16, 16, 16);
}
.notice-title a:hover {
opacity: 0.8;
}
.notice-time {
width: 150px;
text-align: right;
font-size: 14px;
color: rgba(16, 16, 16, 0.6);
}
</style>
<div class="ui container">
<h3 class="ui center am-pt-30 am-pb-20">{{.i18n.Tr "notice_announcement"}}</h3>
<div class="notice-container">
@@ -41,7 +8,6 @@
{{template "base/footer" .}}
<script>
;(function() {
var isZh = document.documentElement.getAttribute('lang') == 'zh-CN';
function getNotice() {
$.ajax({
type:"GET",
@@ -51,6 +17,7 @@
filename: 'notice/notice.json',
},
success:function(data){
var isZh = document.documentElement.getAttribute('lang') == 'zh-CN';
if (!data) return;
try {
var noticeList = JSON.parse(data).Notices || [];


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

@@ -61,7 +61,7 @@
{{if $.RepoIsEmpty}}
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.repo_not_initialized" .RepoLink | Safe}}</div>
{{end}}
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions" | Safe}}</div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions" "https://openi.pcl.ac.cn/docs/index.html#/cloudbrain/eval" | Safe}}</div>
</div>
</div>
{{else}}


+ 1
- 1
templates/repo/modelarts/inferencejob/index.tmpl View File

@@ -67,7 +67,7 @@
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.model_not_exist" .RepoLink .RepoLink | Safe}}</div>
{{end}}
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.dataset_desc"}}</div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions" | Safe}}</div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions" "https://openi.pcl.ac.cn/docs/index.html#/cloudbrain/infer/inference-job" | Safe}}</div>
</div>
</div>
{{else}}


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

@@ -72,7 +72,7 @@
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.repo_not_initialized" .RepoLink | Safe}}</div>
{{end}}
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.dataset_desc"}}</div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions" | Safe}}</div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions" "https://openi.pcl.ac.cn/docs/index.html#/cloudbrain/train/train" | Safe}}</div>
</div>
</div>
{{else}}


+ 1
- 1
templates/user/notification/notification.tmpl View File

@@ -1,3 +1,3 @@
{{template "base/head" .}}
{{template "user/notification/notification_div" .}}
{{template "base/footer" .}}
{{template "base/footer" .}}

+ 10
- 1
templates/user/notification/notification_div.tmpl View File

@@ -10,6 +10,9 @@
<a href="{{AppSubUrl}}/notifications?q=read" class="{{if eq .Status 2}}active{{end}} item">
{{.i18n.Tr "notification.read"}}
</a>
<a href="{{AppSubUrl}}/notifications?q=notice" class="{{if eq .Status 3}}active{{end}} item">
{{.i18n.Tr "notification.notice"}}
</a>
{{if and (eq .Status 1)}}
<form action="{{AppSubUrl}}/notifications/purge" method="POST" style="margin-left: auto;">
{{$.CsrfTokenHtml}}
@@ -25,8 +28,14 @@
{{if eq (len .Notifications) 0}}
{{if eq .Status 1}}
{{.i18n.Tr "notification.no_unread"}}
{{else}}
{{else if eq .Status 2}}
{{.i18n.Tr "notification.no_read"}}
{{else}}
<div class="notice-container" id="notice-container-json" style="min-height: 100px;">
<div class="ui inverted active dimmer" style="display: none;">
<div class="ui loader"></div>
</div>
</div>
{{end}}
{{else}}
<table class="ui unstackable striped very compact small selectable table" id="notification_table">


+ 44
- 0
web_src/js/features/notification.js View File

@@ -16,6 +16,12 @@ export function initNotificationsTable() {

return false;
});
const notificationDiv= $('#notice-container-json');
if (!notificationDiv.length) {
return;
} else {
getNotice()
}
}

export function initNotificationCount() {
@@ -139,6 +145,44 @@ export function initNotificationCount() {

fn(NotificationSettings.MinTimeout, notificationCount.text());
}
function getNotice() {
$('.notice-container .ui.dimmer').css('display','block')
$.ajax({
type:"GET",
url:"/dashboard/invitation",
dataType:"json",
data: {
filename: 'notice/notice.json',
},
success: function (data) {
$('.notice-container .ui.dimmer').css('display','none')
const isZh = document.documentElement.getAttribute('lang') == 'zh-CN';
if (!data) return;
try {
const noticeList = JSON.parse(data).Notices || [];
const noticeEl = $('.notice-container');
for (let i = 0, iLen = noticeList.length; i < iLen; i++) {
let noticeObj = noticeList[i];
noticeEl.append(`<div class="notice-row">
<div class="notice-title">
<a class="_hm-notice" href="${noticeObj.Link}">
<i class="ri-arrow-right-s-line" style="vertical-align:-2px;"></i>
<span>${isZh ? noticeObj.Title : (noticeObj.Title_en || noticeObj.Title)}</span>
</a>
</div>
<div class="notice-time">${noticeObj.Date || ''}</div>
</div>`);
}
} catch (e) {
console.info(e);
}
},
error: function (err) {
$('.notice-container .ui.dimmer').css('display','none')
console.info(err);
}
});
}

async function updateNotificationCountWithCallback(callback, timeout, lastCount) {
const currentCount = $('.notification_count').text();


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

@@ -1512,4 +1512,33 @@ i.SUCCEEDED {
span{
color: rgba(242, 113, 28, 1);
}
}

.notice-row {
display: flex;
justify-content: space-between;
align-items: center;
height: 52px;
border-bottom: 1px solid rgba(157, 197, 226, 0.2);
padding: 0 16px;
}
.notice-title {
flex: 1;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.notice-title a {
font-size: 16px;
color: rgb(16, 16, 16);
}
.notice-title a:hover {
opacity: 0.8;
}
.notice-time {
width: 150px;
text-align: right;
font-size: 14px;
color: rgba(16, 16, 16, 0.6);
}

+ 1
- 1
web_src/vuepages/langs/config/en-US.js View File

@@ -570,7 +570,7 @@ const en = {
debugTaskEmptyTitle: 'Debug task has not been created',
debugTaskEmptyTip1: 'Running time: no more than 4 hours, it will automatically stop if it exceeds 4 hours;',
debugTaskEmptyTip2: 'Dataset: Cloud Brain 1 provides CPU/GPU,Cloud Brain 2 provides Ascend NPU.And dataset also needs to be uploaded to the corresponding environment;',
debugTaskEmptyTip3: 'Instructions for use: You can refer to the <a href="https://openi.pcl.ac.cn/zeizei/OpenI_Learning"> OpenI_Learning </a> course of Qizhi AI collaboration platform.',
debugTaskEmptyTip3: 'Instructions for use: You can refer to the OpenI AI collaboration platform<a href="{url}"> Help Center </a>.',
onlineInferTaskEmptyTitle: 'Online Inference task has not been created',
onlineInferEmptyTip2:'Dataset: Cloud Brain 1 provides CPU/GPU,Cloud Brain 2 provides Ascend NPU.And dataset also needs to be uploaded to the corresponding environment;',
deleteConfirmTips: 'Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.',


+ 1
- 1
web_src/vuepages/langs/config/zh-CN.js View File

@@ -586,7 +586,7 @@ const zh = {
debugTaskEmptyTitle: '未创建过调试任务',
debugTaskEmptyTip1: '运行时长:最长不超过4个小时,超过4个小时将自动停止;',
debugTaskEmptyTip2: '数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境;',
debugTaskEmptyTip3: '使用说明:可以参考启智AI协作平台<a href="https://openi.pcl.ac.cn/zeizei/OpenI_Learning">小白训练营课程</a>。',
debugTaskEmptyTip3: '使用说明:可以参考启智AI协作平台 <a href="{url}" target="_blank">帮助中心</a>。',
onlineInferTaskEmptyTitle: '未创建过在线推理任务',
onlineInferEmptyTip2: '数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,在线推理使用的数据集也需要上传到对应的环境;',
deleteConfirmTips: '您确认删除该任务么?此任务一旦删除不可恢复。',


+ 2
- 2
web_src/vuepages/pages/cloudbrain/configs.js View File

@@ -295,7 +295,7 @@ export const ListPageConfigs = {
emptyTitle: i18n.t('cloudbrainObj.debugTaskEmptyTitle'),
emptyTip1: i18n.t('cloudbrainObj.debugTaskEmptyTip1'),
emptyTip2: i18n.t('cloudbrainObj.debugTaskEmptyTip2'),
emptyTip3: i18n.t('cloudbrainObj.debugTaskEmptyTip3'),
emptyTip3: i18n.t('cloudbrainObj.debugTaskEmptyTip3', {url:'https://openi.pcl.ac.cn/docs/index.html#/cloudbrain/debug/debug'}),
}, {
jobType: 'TRAIN',
jobTypeName: getListValueWithKey(JOB_TYPE, 'TRAIN'),
@@ -325,7 +325,7 @@ export const ListPageConfigs = {
emptyTitle: i18n.t('cloudbrainObj.onlineInferTaskEmptyTitle'),
emptyTip2: i18n.t('cloudbrainObj.onlineInferEmptyTip2'),
emptyTip3: i18n.t('cloudbrainObj.debugTaskEmptyTip3'),
emptyTip3: i18n.t('cloudbrainObj.debugTaskEmptyTip3', { url:'https://openi.pcl.ac.cn/docs/index.html#/cloudbrain/infer/online-inference'}),
}]
};
export const DetailPageConfigs = {


+ 1
- 1
web_src/vuepages/pages/dataset/square/components/PublicDataset.vue View File

@@ -146,7 +146,7 @@ export default {
sortSelect: 'default',
sortList:[
{name:'default',active:true},
{name:'latest',active:false},
{name:'newest',active:false},
{name:'recentupdate',active:false},
{name:'downloadtimes',active:false},
{name:'moststars',active:false},


Loading…
Cancel
Save