+
-
-
@@ -436,15 +484,18 @@
$(document).ready(loadJobStatus);
function loadJobStatus() {
$(".job-status").each((index, job) => {
+ console.log("---------",index,job)
const jobID = job.dataset.jobid;
const repoPath = job.dataset.repopath;
if (job.textContent.trim() == 'STOPPED') {
+
return
}
$.get(`/api/v1/repos/${repoPath}/cloudbrain/${jobID}`, (data) => {
const jobID = data.JobID
const status = data.JobStatus
+ console.log("status",status)
if (status != job.textContent.trim()) {
//$('#' + jobID).text(status)
//if (status == 'STOPPED') {
diff --git a/templates/repo/datasets/dataset_list.tmpl b/templates/repo/datasets/dataset_list.tmpl
index cf6c47926..47716418a 100755
--- a/templates/repo/datasets/dataset_list.tmpl
+++ b/templates/repo/datasets/dataset_list.tmpl
@@ -1,63 +1,52 @@
+
{{if .Attachments}}
{{range .Attachments}}
-
+
-
- {{.Size | FileSize}}
-
-
- {{svg "octicon-flame" 16}} {{(.DownloadCount | PrettyNumber)}}
-
-
-
- {{svg "octicon-file" 16}}
-
-
-
- {{svg "octicon-file-binary" 16}}
-
-
-
- {{if $.IsSigned}}
-
-
+
+
+ {{svg "octicon-flame" 16}} {{(.DownloadCount | PrettyNumber)}}
+ {{svg "octicon-file" 16}}
+ {{svg "octicon-file-binary" 16}}
- {{end}}
- {{if not .CanDel}}
-
{{end}}
diff --git a/templates/repo/datasets/index.tmpl b/templates/repo/datasets/index.tmpl
index 6fa6ccb69..167b1ef44 100755
--- a/templates/repo/datasets/index.tmpl
+++ b/templates/repo/datasets/index.tmpl
@@ -37,7 +37,7 @@
{{if .Permission.CanWrite $.UnitTypeDatasets}}
@@ -66,7 +66,7 @@
@@ -80,7 +80,7 @@
-
{{if eq .Type 0}}{{.i18n.Tr "repo.cloudbrain1"}}{{else}}{{.i18n.Tr "repo.cloudbrain2"}}{{end}}-{{.i18n.Tr "datasets"}}
+ {{if eq .Type 0}}{{.i18n.Tr "repo.cloudbrain1"}}{{else}}{{.i18n.Tr "repo.cloudbrain2"}}{{end}}-{{.i18n.Tr "datasets"}}
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index b48efd498..eaa4cab9a 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -55,14 +55,48 @@
#contributorInfo > a.circular:nth-child(9n+8){
background-color: #bfd0aa;
}
+.vue_menu {
+ cursor: auto;
+ position: absolute;
+ outline: none;
+ top: 100%;
+ margin: 0em;
+ padding: 0em 0em;
+ background: #fff;
+ font-size: 1em;
+ text-shadow: none;
+ text-align: left;
+ /* -webkit-box-shadow: 0px 2px 3px 0px rgb(34 36 38 / 15%); */
+ box-shadow: 0px 2px 3px 0px rgba(34, 36, 38, 0.15);
+ border: 1px solid rgba(34,36,38,0.15);
+ border-radius: 0.28571429rem;
+ -webkit-transition: opacity 0.1s ease;
+ transition: opacity 0.1s ease;
+ z-index: 11;
+ will-change: transform, opacity;
+ width: 100% !important;
+
+ -webkit-animation-iteration-count: 1;
+ animation-iteration-count: 1;
+ -webkit-animation-duration: 300ms;
+ animation-duration: 300ms;
+ -webkit-animation-timing-function: ease;
+ animation-timing-function: ease;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+}
+
+
+
+
{{template "repo/header" .}}
{{template "base/alert" .}}
-
+
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
-
-
+
-
+
-
+
+
+
diff --git a/web_src/js/components/MinioUploader.vue b/web_src/js/components/MinioUploader.vue
index 71aa3b2ce..8006b0c91 100755
--- a/web_src/js/components/MinioUploader.vue
+++ b/web_src/js/components/MinioUploader.vue
@@ -1,17 +1,16 @@
-
- 只有zip格式的数据集才能发起云脑任务
-
{{ file_status_text }}
- {{ status }}
+ {{ status }}
-
云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源;调试使用的数据集也需要上传到对应的环境。
+
说明:
+ - 只有zip格式的数据集才能发起云脑任务;
+ - 云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源;调试使用的数据集也需要上传到对应的环境。
diff --git a/web_src/js/components/ObsUploader.vue b/web_src/js/components/ObsUploader.vue
index 1f1697a78..381cb7f95 100755
--- a/web_src/js/components/ObsUploader.vue
+++ b/web_src/js/components/ObsUploader.vue
@@ -6,9 +6,12 @@
/>
{{ file_status_text }}
- {{ status }}
+ {{ status }}
+
+
说明:
+ - 只有zip格式的数据集才能发起云脑任务;
+ - 云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源;调试使用的数据集也需要上传到对应的环境。
-
云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源;调试使用的数据集也需要上传到对应的环境。
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 2cc622cc0..5c6ff188a 100755
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -36,6 +36,7 @@ import MinioUploader from './components/MinioUploader.vue';
import ObsUploader from './components/ObsUploader.vue';
import EditAboutInfo from './components/EditAboutInfo.vue';
import Images from './components/Images.vue'
+import EditTopics from './components/EditTopics.vue'
Vue.use(ElementUI);
Vue.prototype.$axios = axios;
@@ -2967,11 +2968,13 @@ $(document).ready(async () => {
initVueUploader();
initObsUploader();
initVueEditAbout();
+ initVueEditTopic();
initVueImages();
initTeamSettings();
initCtrlEnterSubmit();
initNavbarContentToggle();
- initTopicbar();
+ // initTopicbar();
+ // closeTopicbar();
initU2FAuth();
initU2FRegister();
initIssueList();
@@ -3666,7 +3669,19 @@ function initVueEditAbout() {
});
}
-
+
+function initVueEditTopic() {
+ const el = document.getElementById('topic_edit1');
+
+ if (!el) {
+ return;
+ }
+
+ new Vue({
+ el:'#topic_edit1',
+ render:h=>h(EditTopics)
+ })
+}
function initVueImages() {
const el = document.getElementById('images');
console.log("el",el)
@@ -3677,6 +3692,7 @@ function initVueImages() {
new Vue({
el: '#images',
+
render: h => h(Images)
});
}
@@ -3932,218 +3948,243 @@ function initNavbarContentToggle() {
});
}
-function initTopicbar() {
- const mgrBtn = $('#manage_topic');
- const editDiv = $('#topic_edit');
- const viewDiv = $('#repo-topics');
- const saveBtn = $('#save_topic');
- const topicDropdown = $('#topic_edit .dropdown');
- const topicForm = $('#topic_edit.ui.form');
- const topicPrompts = getPrompts();
-
- mgrBtn.on('click', () => {
- viewDiv.hide();
- editDiv.css('display', ''); // show Semantic UI Grid
- });
-
- function getPrompts() {
- const hidePrompt = $('div.hide#validate_prompt');
- const prompts = {
- countPrompt: hidePrompt.children('#count_prompt').text(),
- formatPrompt: hidePrompt.children('#format_prompt').text()
- };
- hidePrompt.remove();
- return prompts;
- }
-
- saveBtn.on('click', () => {
- const topics = $('input[name=topics]').val();
-
- $.post(
- saveBtn.data('link'),
- {
- _csrf: csrf,
- topics
- },
- (_data, _textStatus, xhr) => {
- if (xhr.responseJSON.status === 'ok') {
- viewDiv.children('.topic').remove();
- if (topics.length) {
- const topicArray = topics.split(',');
-
- const last = viewDiv.children('a').last();
- for (let i = 0; i < topicArray.length; i++) {
- const link = $('
');
- link.attr(
- 'href',
- `${AppSubUrl}/explore/repos?q=${encodeURIComponent(
- topicArray[i]
- )}&topic=1`
- );
- link.text(topicArray[i]);
- link.insertBefore(last);
- }
- }
- editDiv.css('display', 'none');
- viewDiv.show();
- }
- }
- )
- .fail((xhr) => {
- if (xhr.status === 422) {
- if (xhr.responseJSON.invalidTopics.length > 0) {
- topicPrompts.formatPrompt = xhr.responseJSON.message;
-
- const {invalidTopics} = xhr.responseJSON;
- const topicLables = topicDropdown.children('a.ui.label');
-
- topics.split(',').forEach((value, index) => {
- for (let i = 0; i < invalidTopics.length; i++) {
- if (invalidTopics[i] === value) {
- topicLables
- .eq(index)
- .removeClass('green')
- .addClass('red');
- }
- }
- });
- } else {
- topicPrompts.countPrompt = xhr.responseJSON.message;
- }
- }
- })
- .always(() => {
- topicForm.form('validate form');
- });
- });
-
- topicDropdown.dropdown({
- allowAdditions: true,
- forceSelection: false,
- fields: {name: 'description', value: 'data-value'},
- saveRemoteData: false,
- label: {
- transition: 'horizontal flip',
- duration: 200,
- variation: false,
- blue: true,
- basic: true
- },
- className: {
- label: 'ui small label'
- },
- apiSettings: {
- url: `${AppSubUrl}/api/v1/topics/search?q={query}`,
- throttle: 500,
- cache: false,
- onResponse(res) {
- const formattedResponse = {
- success: false,
- results: []
- };
- const stripTags = function (text) {
- return text.replace(/<[^>]*>?/gm, '');
- };
-
- const query = stripTags(this.urlData.query.trim());
- let found_query = false;
- const current_topics = [];
- topicDropdown
- .find('div.label.visible.topic,a.label.visible')
- .each((_, e) => {
- current_topics.push(e.dataset.value);
- });
-
- if (res.topics) {
- let found = false;
- for (let i = 0; i < res.topics.length; i++) {
- // skip currently added tags
- if (current_topics.includes(res.topics[i].topic_name)) {
- continue;
- }
-
- if (
- res.topics[i].topic_name.toLowerCase() === query.toLowerCase()
- ) {
- found_query = true;
- }
- formattedResponse.results.push({
- description: res.topics[i].topic_name,
- 'data-value': res.topics[i].topic_name
- });
- found = true;
- }
- formattedResponse.success = found;
- }
-
- if (query.length > 0 && !found_query) {
- formattedResponse.success = true;
- formattedResponse.results.unshift({
- description: query,
- 'data-value': query
- });
- } else if (query.length > 0 && found_query) {
- formattedResponse.results.sort((a, b) => {
- if (a.description.toLowerCase() === query.toLowerCase()) return -1;
- if (b.description.toLowerCase() === query.toLowerCase()) return 1;
- if (a.description > b.description) return -1;
- if (a.description < b.description) return 1;
- return 0;
- });
- }
-
- return formattedResponse;
- }
- },
- onLabelCreate(value) {
- value = value.toLowerCase().trim();
- this.attr('data-value', value)
- .contents()
- .first()
- .replaceWith(value);
- return $(this);
- },
- onAdd(addedValue, _addedText, $addedChoice) {
- addedValue = addedValue.toLowerCase().trim();
- $($addedChoice).attr('data-value', addedValue);
- $($addedChoice).attr('data-text', addedValue);
- }
- });
-
- $.fn.form.settings.rules.validateTopic = function (_values, regExp) {
- const topics = topicDropdown.children('a.ui.label');
- const status =
- topics.length === 0 || (topics.last().attr('data-value').match(regExp) !== null && topics.last().attr('data-value').length <= 35);
- if (!status) {
- topics
- .last()
- .removeClass('green')
- .addClass('red');
- }
- return status && topicDropdown.children('a.ui.label.red').length === 0;
- };
-
- topicForm.form({
- on: 'change',
- inline: true,
- fields: {
- topics: {
- identifier: 'topics',
- rules: [
- {
- type: 'validateTopic',
- value: /^[\u4e00-\u9fa5a-z0-9][\u4e00-\u9fa5a-z0-9-]{0,105}$/,
- prompt: topicPrompts.formatPrompt
- },
- {
- type: 'maxCount[25]',
- prompt: topicPrompts.countPrompt
- }
- ]
- }
- }
- });
-}
+// function initTopicbar() {
+// const mgrBtn = $('#manage_topic');
+// const editDiv = $('#topic_edit');
+// const viewDiv = $('#repo-topics');
+// const saveBtn = $('#save_topic');
+// const topicDropdown = $('#topic_edit .dropdown');
+// const topicForm = $('#topic_edit.ui.form');
+// const topicInput = $("#topics_input")
+// const topicPrompts = getPrompts();
+
+
+// mgrBtn.on('click', (e) => {
+// // viewDiv.hide();
+// editDiv.css('display', ''); // show Semantic UI Grid
+// topicInput.val('')
+// console.log("-----------------asdasd",$("#topics_input"),$("#topics_input").val())
+// stopPropagation(e);
+
+// });
+// $(document).bind('click',function(){
+// editDiv.css('display','none');
+
+// })
+// editDiv.click(function(e){
+// stopPropagation(e);
+// })
+
+// function getPrompts() {
+// const hidePrompt = $('div.hide#validate_prompt');
+// const prompts = {
+// countPrompt: hidePrompt.children('#count_prompt').text(),
+// formatPrompt: hidePrompt.children('#format_prompt').text()
+// };
+// hidePrompt.remove();
+// return prompts;
+// }
+
+// function stopPropagation(e) {
+// var ev = e || window.event;
+// if (ev.stopPropagation) {
+// ev.stopPropagation();
+// }
+// else if (window.event) {
+// window.event.cancelBubble = true;//兼容IE
+// }
+// }
+
+
+// saveBtn.on('click', () => {
+// const topics = $('input[name=topics]').val();
+
+// $.post(
+// saveBtn.data('link'),
+// {
+// _csrf: csrf,
+// topics
+// },
+// (_data, _textStatus, xhr) => {
+// if (xhr.responseJSON.status === 'ok') {
+// console.log("--------saveBtn------------")
+// viewDiv.children('.topic').remove();
+// if (topics.length) {
+// const topicArray = topics.split(',');
+
+// const last = viewDiv.children('a').last();
+// for (let i = 0; i < topicArray.length; i++) {
+// const link = $('
');
+// link.attr(
+// 'href',
+// `${AppSubUrl}/explore/repos?q=${encodeURIComponent(
+// topicArray[i]
+// )}&topic=1`
+// );
+// link.text(topicArray[i]);
+// link.insertBefore(last);
+// }
+// }
+// editDiv.css('display', 'none');
+// viewDiv.show();
+// }
+// }
+// )
+// .fail((xhr) => {
+// if (xhr.status === 422) {
+// if (xhr.responseJSON.invalidTopics.length > 0) {
+// topicPrompts.formatPrompt = xhr.responseJSON.message;
+
+// const {invalidTopics} = xhr.responseJSON;
+// const topicLables = topicDropdown.children('a.ui.label');
+
+// topics.split(',').forEach((value, index) => {
+// for (let i = 0; i < invalidTopics.length; i++) {
+// if (invalidTopics[i] === value) {
+// topicLables
+// .eq(index)
+// .removeClass('green')
+// .addClass('red');
+// }
+// }
+// });
+// } else {
+// topicPrompts.countPrompt = xhr.responseJSON.message;
+// }
+// }
+// })
+// .always(() => {
+// topicForm.form('validate form');
+// });
+// });
+
+// topicDropdown.dropdown({
+// allowAdditions: true,
+// forceSelection: false,
+// fields: {name: 'description', value: 'data-value'},
+// saveRemoteData: false,
+// label: {
+// transition: 'horizontal flip',
+// duration: 200,
+// variation: false,
+// blue: true,
+// basic: true
+// },
+// className: {
+// label: 'ui small label'
+// },
+// apiSettings: {
+// url: `${AppSubUrl}/api/v1/topics/search?q={query}`,
+// throttle: 500,
+// cache: false,
+// onResponse(res) {
+// const formattedResponse = {
+// success: false,
+// results: []
+// };
+// const stripTags = function (text) {
+// return text.replace(/<[^>]*>?/gm, '');
+// };
+
+// const query = stripTags(this.urlData.query.trim());
+// let found_query = false;
+// const current_topics = [];
+// topicDropdown
+// .find('div.label.visible.topic,a.label.visible')
+// .each((_, e) => {
+// current_topics.push(e.dataset.value);
+// });
+
+// if (res.topics) {
+// let found = false;
+// for (let i = 0; i < res.topics.length; i++) {
+// // skip currently added tags
+// if (current_topics.includes(res.topics[i].topic_name)) {
+// continue;
+// }
+
+// if (
+// res.topics[i].topic_name.toLowerCase() === query.toLowerCase()
+// ) {
+// found_query = true;
+// }
+// formattedResponse.results.push({
+// description: res.topics[i].topic_name,
+// 'data-value': res.topics[i].topic_name
+// });
+// found = true;
+// }
+// formattedResponse.success = found;
+// }
+
+// if (query.length > 0 && !found_query) {
+// formattedResponse.success = true;
+// formattedResponse.results.unshift({
+// description: query,
+// 'data-value': query
+// });
+// } else if (query.length > 0 && found_query) {
+// formattedResponse.results.sort((a, b) => {
+// if (a.description.toLowerCase() === query.toLowerCase()) return -1;
+// if (b.description.toLowerCase() === query.toLowerCase()) return 1;
+// if (a.description > b.description) return -1;
+// if (a.description < b.description) return 1;
+// return 0;
+// });
+// }
+
+// return formattedResponse;
+// }
+// },
+// onLabelCreate(value) {
+// value = value.toLowerCase().trim();
+// this.attr('data-value', value)
+// .contents()
+// .first()
+// .replaceWith(value);
+// return $(this);
+// },
+// onAdd(addedValue, _addedText, $addedChoice) {
+// addedValue = addedValue.toLowerCase().trim();
+// $($addedChoice).attr('data-value', addedValue);
+// $($addedChoice).attr('data-text', addedValue);
+// }
+// });
+
+// $.fn.form.settings.rules.validateTopic = function (_values, regExp) {
+// const topics = topicDropdown.children('a.ui.label');
+// const status =
+// topics.length === 0 || (topics.last().attr('data-value').match(regExp) !== null && topics.last().attr('data-value').length <= 35);
+// if (!status) {
+// topics
+// .last()
+// .removeClass('green')
+// .addClass('red');
+// }
+// return status && topicDropdown.children('a.ui.label.red').length === 0;
+// };
+
+// topicForm.form({
+// on: 'change',
+// inline: true,
+// fields: {
+// topics: {
+// identifier: 'topics',
+// rules: [
+// {
+// type: 'validateTopic',
+// value: /^[\u4e00-\u9fa5a-z0-9][\u4e00-\u9fa5a-z0-9-]{0,105}$/,
+// prompt: topicPrompts.formatPrompt
+// },
+// {
+// type: 'maxCount[25]',
+// prompt: topicPrompts.countPrompt
+// }
+// ]
+// }
+// }
+// });
+// }
window.toggleDeadlineForm = function () {
$('#deadlineForm').fadeToggle(150);
diff --git a/web_src/less/_dataset.less b/web_src/less/_dataset.less
index 79acbf524..3bc19ef63 100644
--- a/web_src/less/_dataset.less
+++ b/web_src/less/_dataset.less
@@ -140,19 +140,32 @@
border: 1px solid #ffffff;
}
}
- }
+ }
}
+
.item {
border-bottom: 1px solid rgba(34,36,38,.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;
+ text-overflow: ellipsis;
+ display: block;
}
.directory-seperator {
padding: 0 4px;
diff --git a/web_src/less/openi.less b/web_src/less/openi.less
index 3c82606e9..cf8ca6d27 100644
--- a/web_src/less/openi.less
+++ b/web_src/less/openi.less
@@ -220,3 +220,25 @@ footer .column{margin-bottom:0!important; padding-bottom:0!important;}
.ui.vertical.menu .dropdown.item .menu {
left: 50%;
}
+
+// icon cloudbrain
+.i-round{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;}
+.i-bg-organ{background-position: -496px -52px;}
+.STOPPED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -459px -52px;}
+.RUNNING{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -478px -52px;}
+.i-bg-orange{background-position: -495px -51px;}
+.FAILED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -532px -52px;}
+.i-bg-green{background-position: -441px -52px;}
+.i-bg-used{background-position: -514px -52px;}
+.icon-bind{background-position: -550px -52px;}
+.icon-unbind{background-position: -568px -52px;}
+.CREATING, .STOPPING, .DELETING, .STARTING, .WAITING{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;}
+.text_over{
+ overflow: hidden;
+ text-overflow: ellipsis;
+ -o-text-overflow: ellipsis;
+ white-space: nowrap;
+ display: inline-block;
+ width: 100%;
+}
+