From ca0679951ec9092cd6f840a351c71d77ebc59ca0 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 29 Aug 2013 14:33:50 -0700 Subject: [PATCH] CLOUDSTACK-4562: addS3/addSwift API is retired (being replaced with addImageStore API) and old configuration 's3.enable'/'swift.enable' has been removed from database. So, remove obsolete UI that calls addS3/addSwift API. --- ui/scripts/system.js | 199 ------------------------------------------- 1 file changed, 199 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 43f7b2abfe6..78f02428e93 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -5612,205 +5612,6 @@ }); } } - }, - - // Enable swift - enableSwift: { - label: 'label.enable.swift', - isHeader: true, - addRow: false, - preFilter: function(args) { - var swiftEnableConfiguration = false; - $.ajax({ - url: createURL('listConfigurations'), - data: { - name: 'swift.enable' - }, - async: false, - success: function(json) { - swiftEnableConfiguration = json.listconfigurationsresponse.configuration[0].value == 'true' ? true : false; - } - }); - - var havingSwift = false; - $.ajax({ - url: createURL("listImageStores"), - data: { - provider: 'Swift' - }, - async: false, - success: function(json) { - var items = json.listimagestoreresponse.imagestore; - if (items != null && items.length > 0) - havingSwift = true; - } - }); - - if(swiftEnableConfiguration == true && havingSwift == false) - return true; - else - return false; - }, - messages: { - notification: function(args) { - return 'label.enable.swift'; - } - }, - createForm: { - desc: 'confirm.enable.swift', - fields: { - url: { - label: 'label.url', - validation: { - required: true - } - }, - account: { - label: 'label.account' - }, - username: { - label: 'label.username' - }, - key: { - label: 'label.key' - } - } - }, - action: function(args) { - $.ajax({ - url: createURL('addSwift'), - data: { - url: args.data.url, - account: args.data.account, - username: args.data.username, - key: args.data.key - }, - success: function(json) { - args.response.success(); - - cloudStack.dialog.notice({ - message: 'message.after.enable.swift' - }); - }, - error: function(json) { - args.response.error(parseXMLHttpResponse(json)); - } - }); - } - }, - - enableS3: { - label: 'label.enable.s3', - isHeader: true, - addRow: false, - - preFilter: function(args) { - var s3EnableConfiguration = false; - $.ajax({ - url: createURL('listConfigurations'), - data: { - name: 's3.enable' - }, - async: false, - success: function(json) { - s3EnableConfiguration = json.listconfigurationsresponse.configuration[0].value == 'true' ? true : false; - } - }); - - var havingS3 = false; - $.ajax({ - url: createURL("listImageStores"), - data: { - provider: 'S3' - }, - async: false, - success: function(json) { - var items = json.listimagestoreresponse.imagestore; - if (items != null && items.length > 0) { - havingS3 = true; - } - } - }); - - if(s3EnableConfiguration == true && havingS3 == false) - return true; - else - return false; - }, - - messages: { - notification: function(args) { - return 'label.enable.s3'; - } - }, - - createForm: { - desc: 'confirm.enable.s3', - fields: { - accesskey: { - label: 'label.s3.access_key', - validation: { - required: true - } - }, - secretkey: { - label: 'label.s3.secret_key', - validation: { - required: true - } - }, - bucket: { - label: 'label.s3.bucket', - validation: { - required: true - } - }, - endpoint: { - label: 'label.s3.endpoint' - }, - usehttps: { - label: 'label.s3.use_https', - isEditable: true, - isBoolean: true, - isChecked: true, - converter: cloudStack.converters.toBooleanText - }, - connectiontimeout: { - label: 'label.s3.connection_timeout' - }, - maxerrorretry: { - label: 'label.s3.max_error_retry' - }, - sockettimeout: { - label: 'label.s3.socket_timeout' - } - } - }, - action: function(args) { - $.ajax({ - url: createURL('addS3'), - data: { - accesskey: args.data.accesskey, - secretkey: args.data.secretkey, - bucket: args.data.bucket, - endpoint: args.data.endpoint, - usehttps: (args.data.usehttps != null && args.data.usehttps == 'on' ? 'true' : 'false'), - connectiontimeout: args.data.connectiontimeout, - maxerrorretry: args.data.maxerrorretry, - sockettimeout: args.data.sockettimeout - }, - success: function(json) { - args.response.success(); - - cloudStack.dialog.notice({ - message: 'message.after.enable.s3' - }); - }, - error: function(json) { - args.response.error(parseXMLHttpResponse(json)); - } - }); - } } },