diff --git a/ui/public/index.html b/ui/public/index.html index 8540fc7d..a5c139f9 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -12,6 +12,9 @@ + + + oscar-ui @@ -20,6 +23,11 @@ + + + + +
diff --git a/ui/src/components/forms/FunctionForm.vue b/ui/src/components/forms/FunctionForm.vue index d5bd138b..a950a50f 100644 --- a/ui/src/components/forms/FunctionForm.vue +++ b/ui/src/components/forms/FunctionForm.vue @@ -79,6 +79,7 @@ Select a file or enter a URL + @@ -108,8 +109,58 @@ - - + + + + Edit + + + Save + + + + + + + + + Note: To edit the script sending in the creation of the service press the Edit button. + + + + Edit + + + Save + + + + + + +
+ +
- Cancel + Cancel Clear NEXT @@ -535,7 +586,7 @@ - Cancel + Cancel Clear BACK @@ -744,7 +795,7 @@ - Cancel + Cancel Clear BACK @@ -876,11 +927,60 @@ export default { showinput: true, memory: '', varsEnv: '', + editScript: false } }, methods: { + editSummernote(){ + var _this = this + $('.summernote').summernote( + { + callbacks:{ + onInit: function() { + $('.summernote').summernote('codeview.activate'); + }, + }, + codeviewFilter: true, + codeviewIframeFilter: true, + focus: true, + height: 200, // set editor height + minHeight: null, // set minimum height of editor + maxHeight: null, // set maximum height of editor + toolbar: [ + // [groupName, [list of button]] + ['style', ['bold', 'italic', 'underline', 'clear']], + ['font', ['strikethrough', 'superscript', 'subscript']], + ['fontsize', ['fontsize']], + ['color', ['color']], + ['para', ['ul', 'ol', 'paragraph']], + ['height', ['height']], + ['view', ['codeview']] + ], + codemirror: { // codemirror options + theme: 'monokai', + lineNumbers: true, + lineWrapping: true, + tabMode: 'indent' + }, + + }) + .on("summernote.enter", function(we, e) { + $(this).summernote("pasteHTML", "

"); + e.preventDefault(); + }); + $('.summernote').summernote('code',_this.base64String) + }, + saveSummernote(){ + this.base64String = $('.summernote').summernote('code') + $('.summernote').summernote('destroy'); + setTimeout(function(){ + $('.summernote').css('display','none'); + },100) + this.editScript = false + }, + show(id){ $("#myTabContent .tab-pane-content").removeClass("show active") $("#myTab .nav-link").removeClass("show active") @@ -1056,6 +1156,11 @@ export default { removeFile (key) { this.files.splice(key, 1) this.$refs.files.value = null + // this.base64String = '' + $('.summernote').summernote('destroy'); + setTimeout(function(){ + $('.summernote').css('display','none'); + },100) }, handleFilesUpload () { this.files = [] @@ -1112,7 +1217,7 @@ export default { }); this.cleanfield() }, - closeWithoutSave () { + closeWithoutSave() { this.progress.active = false this.dialog = false this.clear() @@ -1124,20 +1229,25 @@ export default { return obj; }, submit () { - if (this.$refs.form.validate() && this.files.length != 0) { + + if(this.$refs.form.validate() && this.editionMode == true && this.base64String != ''){ + this.editFunction() + }else if (this.$refs.form.validate() && this.files.length != 0) { this.progress.active = true this.editionMode ? this.editFunction() : this.newFunction() this.envrequirehost = false this.envrequiretoken = false this.envrequirespace = false - }else if (this.editionMode == false){ + }else { + if (this.files.length == 0){ + this.filerequire = true + }else{ + this.filerequire = false + } this.show('home') - } - if (this.files.length == 0){ - this.filerequire = true - }else{ - this.filerequire = false - } + } + + }, clear () { @@ -1184,6 +1294,13 @@ export default { this.showselectInput = false this.showselectOutput = false this.select_logLevel = 'INFO' + this.editScript = false + this.base64String = '' + $('.summernote').summernote('destroy'); + setTimeout(function(){ + $('.summernote').css('display','none'); + },100) + }, newFunction () { if (this.minio.endpoint != "") { @@ -1272,7 +1389,7 @@ export default { }, 'input': this.inputs, 'output': this.outputs, - 'script': script, + 'script': this.base64String, 'storage_providers':this.form.storage_provider } @@ -1356,11 +1473,7 @@ export default { }else{ this.showselectOutput = true } - this.script = data.script - if(this.script != ""){ - this.files.length = 1 - } - + this.base64String = data.script }) } } diff --git a/ui/src/components/services.js b/ui/src/components/services.js index d6337e06..9cb4338d 100644 --- a/ui/src/components/services.js +++ b/ui/src/components/services.js @@ -125,7 +125,7 @@ export default { deleteAllJobCall(params,callBackHandler) { axios({ method: 'delete', - url: '/system/logs/'+params, + url: '/system/logs/'+params.serviceName+'?all='+params.all, auth: { username: this.username_auth, password: this.password_auth diff --git a/ui/src/views/BucketContent.vue b/ui/src/views/BucketContent.vue index 5707dd25..e6cf0d38 100644 --- a/ui/src/views/BucketContent.vue +++ b/ui/src/views/BucketContent.vue @@ -571,8 +571,38 @@ export default { if(i>0){ before = i-1 } - - if(i == 0){ + if(first_path == ''){ + var file = { + name: '', + path: '', + icon: '', + color: '', + lastModified: '', + size: '', + } + first.push(file) + }else if(first_path == this.paths[i][this.paths[i].length-1]){ + var extension = this.getFileExtension1(first_path) + var icon_file = '' + var color_file = '' + if(extension == 'jpg' || extension == 'jpeg' || extension == 'png'){ + icon_file = 'insert_photo' + color_file = 'blue' + }else{ + icon_file = 'insert_drive_file' + color_file = 'gray' + } + var file = { + name: this.paths[i][0], + path: this.allData[i].name, + icon: icon_file, + color: color_file, + lastModified: response.files[i].lastModified, + size: response.files[i].size, + } + first.push(file) + + }else if(i == 0){ var extension = this.getFileExtension1(first_path) if (extension == undefined){ var folder = { diff --git a/ui/src/views/Logs.vue b/ui/src/views/Logs.vue index 9c81b3d4..2fb9de66 100644 --- a/ui/src/views/Logs.vue +++ b/ui/src/views/Logs.vue @@ -16,6 +16,7 @@ autorenew + DELETE SUCCESS JOBS DELETE ALL JOBS