+
@@ -63,10 +73,10 @@
diff --git a/web_src/js/components/Images.vue b/web_src/js/components/Images.vue
index a56d81e4c..d0e9febbc 100644
--- a/web_src/js/components/Images.vue
+++ b/web_src/js/components/Images.vue
@@ -327,10 +327,10 @@ export default {
},
getImageList(){
this.loading = true
- this.$axios.get('/explore/images/public',{
+ this.$axios.get('/images/public',{
params:this.params
}).then((res)=>{
-
+ console.log("res",res)
this.totalNum = res.data.count
this.tableData = res.data.rows
this.loading = false
@@ -339,10 +339,10 @@ export default {
getImageList1(){
this.loading1 = true
- this.$axios.get('/explore/images/custom',{
+ this.$axios.get('/images/custom',{
params:this.params1
}).then((res)=>{
-
+ console.log("res",res)
this.totalNum1 = res.data.count
this.tableData1 = res.data.rows
this.loading1 = false
diff --git a/web_src/js/features/images.js b/web_src/js/features/images.js
index 3f806b622..302f16452 100644
--- a/web_src/js/features/images.js
+++ b/web_src/js/features/images.js
@@ -1,6 +1,32 @@
import Images from '../components/Images.vue';
-
+import Vue from 'vue';
export default async function initImage(){
+ function validate() {
+ $("#form_image")
+ .form({
+ on: 'blur',
+ // inline:true,
+ fields: {
+ tag: {
+ identifier : 'tag',
+ rules: [
+ {
+ type: 'regExp[/^[A-Za-z0-9_.-]{1,100}[A-Za-z0-9_.]$/]',
+ }
+ ]
+ },
+ description:{
+ identifier : 'description',
+ rules: [
+ {
+ type: 'empty',
+
+ }
+ ]
+ },
+ }
+ })
+ }
function initDropdown(){
$('#dropdown_image')
.dropdown({
@@ -27,7 +53,9 @@ export default async function initImage(){
})
}
});
+
}
+ validate()
initDropdown()
let link = $('.submit-image-tmplvalue').data('link')
$('.ui.create_image.green.button').click(()=>{
@@ -38,43 +66,42 @@ export default async function initImage(){
data:$('#form_image').serialize(),
success:function(res){
console.log("res",res)
+ if(res.Code===1){
+ $('.alert').html(res.Message).removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut();
+ }
},
error: function(xhr){
// 隐藏 loading
// 只有请求不正常(状态码不为200)才会执行
// $('.ui.error.message').text(xhr.responseText)
// $('.ui.error.message').css('display','block')
+ $('.alert').html(xhr.responseText).removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut();
},
complete:function(xhr){
- // $("#mask").css({"display":"none","z-index":"1"})
+ $("#mask").css({"display":"none","z-index":"1"})
}
})
})
+ $('#cancel_submit_image').click(()=>{
+ if(link.includes('cloudbrain')){
+ let repoLink = link.split('cloudbrain')[0]
+ location.href = `${window.config.AppSubUrl}${repoLink}debugjob?debugListType=all`
+ }
+ })
console.log("initImage")
- const el = document.getElementById('image-base');
- if (!el) {
- return;
- }
-
- // let defaultText = document.getElementById("default_text").offsetHeight
- // defaultText = defaultText>40 ? defaultText+12 :defaultText
- // $("#dropdown_container").css("height",defaultText)
- new Vue({
- delimiters: ['${', '}'],
- el,
- data() {
- return{
-
- }
- },
- components: {
- Images
- },
- mounted(){
- },
- methods:{
+ function initVueImages() {
+ const el = document.getElementById('images');
+ console.log(el)
+
+ if (!el) {
+ return;
}
- });
-
+
+ new Vue({
+ el:el,
+ render: h => h(Images)
+ });
+ }
+ initVueImages()
}
\ No newline at end of file
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 943a66318..035d9317a 100755
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -36,7 +36,7 @@ import {createCodeEditor} from './features/codeeditor.js';
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 Images from './components/Images.vue';
import EditTopics from './components/EditTopics.vue';
import DataAnalysis from './components/DataAnalysis.vue'
import Contributors from './components/Contributors.vue'
@@ -2923,7 +2923,7 @@ $(document).ready(async () => {
initVueEditAbout();
initVueEditTopic();
initVueContributors();
- initVueImages();
+ // initVueImages();
initVueModel();
initVueDataAnalysis();
initVueWxAutorize();
@@ -4277,20 +4277,20 @@ function initVueContributors() {
}
-function initVueImages() {
- const el = document.getElementById('images');
+// function initVueImages() {
+// const el = document.getElementById('images');
- if (!el) {
- return;
- }
+// if (!el) {
+// return;
+// }
- new Vue({
- el: '#images',
+// new Vue({
+// el: '#images',
- render: h => h(Images)
- });
-}
+// render: h => h(Images)
+// });
+// }
function initVueModel() {
const el = document.getElementById('model_list');