From 1d47b571e7c7f6bd9dd7ddb506414fc389420874 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 17 Aug 2017 23:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E5=8C=BA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mogui/settings.py | 4 +- mogui/settings.pyc | Bin 3013 -> 3033 bytes mogui/view/v1/release/index.html | 76 +++++++++++++++++-------------- 3 files changed, 44 insertions(+), 36 deletions(-) diff --git a/mogui/settings.py b/mogui/settings.py index 847d7ec..2e0a0b1 100644 --- a/mogui/settings.py +++ b/mogui/settings.py @@ -123,13 +123,13 @@ AUTH_PASSWORD_VALIDATORS = [ LANGUAGE_CODE = 'zh-Hans' -TIME_ZONE = 'UTC' +TIME_ZONE = 'Asia/Shanghai' USE_I18N = True USE_L10N = True -USE_TZ = True +USE_TZ = False # Static files (CSS, JavaScript, Images) diff --git a/mogui/settings.pyc b/mogui/settings.pyc index 882d429cb4a28985efc9fc73d8857ba1c2e8294f..3ffd06af4c980592bc211e48a222ccd457bbb504 100644 GIT binary patch delta 104 zcmX>qep8&C`7sFr=6>M9DIwGBRW_F=WXxq_Q!jSTHm*F{D^B zq%$!@$!|W(D8MdM%*(*Q;8>iQs2`k>n3tZBm^t|=haRKCW)aTyjGU}MNw>tD;?&KD HxR@CMMm`zP delta 84 zcmV-a0IUDm7sVF`1M>|Ex1@Zr2cZEa4FFmj0Ax1+S{wjn0RU5C;f!0{{R3Ra8Th?+7jdAG00_uK}~y3IYLkw-hM= diff --git a/mogui/view/v1/release/index.html b/mogui/view/v1/release/index.html index 66b48bd..383c3d5 100644 --- a/mogui/view/v1/release/index.html +++ b/mogui/view/v1/release/index.html @@ -102,49 +102,57 @@ new Vue({ */ handle_release : function(release_id, project_id, handle_type) { - this.loading = true; - this.$http.post(__host__+'release/handle_release', {csrfmiddlewaretoken:'{{ csrf_token }}', release_id:release_id, project_id:project_id, handle_type:handle_type}, {emulateJSON: true}).then((response) => + var type_msg = (handle_type == 1) ? '正式发布上线' : '回滚到上一次保留的状态'; + this.$confirm('此操作将'+type_msg+', 是否继续?', '提示', { - console.log(response.data); - if(response.data.code == 0) + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.loading = true; + this.$http.post(__host__+'release/handle_release', {csrfmiddlewaretoken:'{{ csrf_token }}', release_id:release_id, project_id:project_id, handle_type:handle_type}, {emulateJSON: true}).then((response) => { - this.$message({ - showClose: true, - message: response.data.msg, - type: 'success' - }); - - setTimeout(function() - { - window.location.reload(); - }, 1000); - } else { - // git错误提示信息 - if(response.data.tips.length > 0) + console.log(response.data); + if(response.data.code == 0) { - this.$notify({ - title: notify_error_title, - message: response.data.tips, - duration: 0 + this.$message({ + showClose: true, + message: response.data.msg, + type: 'success' }); - } + setTimeout(function() + { + window.location.reload(); + }, 1000); + } else { + // git错误提示信息 + if(response.data.tips.length > 0) + { + this.$notify({ + title: notify_error_title, + message: response.data.tips, + duration: 0 + }); + } + + this.$message({ + showClose: true, + message: response.data.msg, + type: 'warning' + }); + } + this.loading = false; + }, (response) => + { this.$message({ showClose: true, - message: response.data.msg, - type: 'warning' + message: error_msg, + type: 'error' }); - } - this.loading = false; - }, (response) => - { - this.$message({ - showClose: true, - message: error_msg, - type: 'error' + this.loading = false; }); - this.loading = false; - }); + }).catch(() => {}); }, /** -- GitLab