Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/log-location/log-location.controller.js
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/log-location/log-location.controller.js	(revision 0)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/log-location/log-location.controller.js	(working copy)
@@ -0,0 +1,166 @@
+angular.module('cm.storage')
+    .controller('storageLogLocationCtrl', [
+        '$scope',
+        '$rootScope',
+        '$state',
+        '$stateParams',
+        '$location',
+        '$uibModal',
+        '$aside',
+        'storageService',
+        'dashboardService',
+        '$filter',
+        function ($scope, $rootScope, $state, $stateParams, $location, $uibModal, $aside, storageService, dashboardService, $filter) {
+            $rootScope.title = 'Storage Management';
+            var storageViewModel = this;
+            storageViewModel.diskList = [
+                {
+                    'name': 'Primary',
+                    'value': 'primary'
+                }
+            ];
+            // storageViewModel.enter = function (item) {
+            //     storageViewModel.diskStatusWidget.highlight = $filter('T')(item['name']);
+            // }
+
+            // storageViewModel.detail = function (item) {
+            //     storageViewModel.detailPage = true;
+            //     storageViewModel.detailloading = true
+            //
+            //     storageService.postStorageQuery(JSON.stringify(item)).then(function (resp) {
+            //         storageViewModel.detailloading = false
+            //         if (resp && resp.status == 200) {
+            //             _.each(resp.data.paths, function (path) {
+            //                 path['sizeStr'] = storageService.ValueFormat1024(path.size) + 'B'
+            //             })
+            //             storageViewModel.detailPaths = resp.data.paths
+            //         }
+            //     })
+            // }
+
+            storageViewModel.moduleList = []
+
+            storageViewModel.scheduleDetail = {
+                schedule: true
+            };
+
+            storageViewModel.storage = {
+                primary: {
+                    free: {unit: '', value: 0},
+                    used: {unit: '', value: 0},
+                    total: {unit: '', value: 0},
+                },
+                secondary: {
+                    free: {unit: '', value: 0},
+                    used: {unit: '', value: 0},
+                    total: {unit: '', value: 0},
+                }
+            }
+
+            let getDiskStatusData = function () {
+                let post_data = {
+                    "from": "now-20s",
+                    "to": "now-10s",
+                    "queries": [{
+                        "datasourceId": 1,
+                        "query": "select mean(used), mean(free) from (SELECT sum(used) as used, sum(free) as free FROM disk where $timeFilter group by time(10s)); " +
+                            "select sum(read_rate), sum(write_rate) from (SELECT non_negative_derivative(last(read_bytes),1s) as read_rate, non_negative_derivative(last(write_bytes),1s) as write_rate FROM diskio WHERE $timeFilter GROUP BY \"name\", time(10s)) group by time(10s);",
+                        "rawQuery": true,
+                        "resultFormat": "time_series"
+                    }]
+                };
+                dashboardService.get_composer_data('/composer/tsdb/query', JSON.stringify(post_data)).then(function (res) {
+                    if (res && res.data.code === 0) {
+                        let total = 0;
+                        _.each(res.data.data.results['A'].series, function (series) {
+                            if (series.name === "mean") {
+                                total += series.points[0][1];
+                                storageViewModel.storage.primary.used = storageService.formatBigData(series.points[0][1]);
+                            } else if (series.name === "mean_1") {
+                                total += series.points[0][1];
+                                storageViewModel.storage.primary.free = storageService.formatBigData(series.points[0][1]);
+                            }
+                        });
+                        storageViewModel.storage.primary.total = storageService.formatBigData(total);
+                        storageViewModel.getSecondaryDiskInformation();
+                    }
+                });
+            }
+
+            storageViewModel.refresh = function () {
+                storageViewModel.diskList = [
+                    {
+                        'name': 'Primary',
+                        'value': 'primary'
+                    }
+                ];
+                storageViewModel.secondaryDisk = {
+                    isDiskAvailable: false,
+                    logLocation: 'primary'
+                };
+                getDiskStatusData();
+            }
+
+            storageViewModel.showProgressBar = function () {
+                var modalInstance = $uibModal.open({
+                    templateUrl: 'app/modules/common/templates/progress.html',
+                    controller: 'showProgressCtrl',
+                    controllerAs: 'progress',
+                    backdrop: false
+                });
+            };
+
+            storageViewModel.cancel = function () {
+                storageViewModel.showProgressBar();
+                storageViewModel.refresh()
+            };
+
+            storageViewModel.secondaryDisk = {
+                isDiskAvailable: false,
+                logLocation: 'primary'
+            };
+
+            storageViewModel.getSecondaryDiskInformation = function () {
+                storageService.getSecondaryDriveInfo().then(function (res) {
+                    if (res && res.status === 200) {
+                        $rootScope.$broadcast('endLoading', true);
+                        let response = res.data;
+                        storageViewModel.secondaryDisk.isDiskAvailable = response['is_disk_available'];
+                        if (storageViewModel.secondaryDisk.isDiskAvailable) {
+                            storageViewModel.diskList.push({
+                                'name': 'Secondary',
+                                'value': 'secondary'
+                            })
+                            console.log(response);
+                            storageViewModel.storage.secondary.total = storageService.formatBigData(response.total);
+                            storageViewModel.storage.secondary.used = storageService.formatBigData(response.used);
+                            storageViewModel.storage.secondary.free = storageService.formatBigData(response.free);
+                            storageViewModel.showProgressBar();
+                            storageService.getLogLocation().then(function (resp) {
+                                $rootScope.$broadcast('endLoading', true);
+                                if (res && res.status === 200) {
+                                    let log_info = resp.data
+                                    storageViewModel.secondaryDisk.logLocation = log_info['location'];
+                                }
+                            })
+                        }
+                    } else {
+                        $rootScope.$broadcast('endLoading', true);
+                    }
+                })
+            }
+
+            storageViewModel.changeLogLocation = function () {
+                storageViewModel.showProgressBar()
+                storageService.updateLogLocation(storageViewModel.secondaryDisk.logLocation).then(function (res) {
+                    $rootScope.$broadcast('endLoading', true);
+                    if (res && res.status === 200) {
+                        storageViewModel.refresh()
+                    } else {
+                        alert("Failed to update the log location. " + res.data.error);
+                    }
+                })
+            }
+
+            storageViewModel.refresh();
+        }])
Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/log-location/log-location.html
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/log-location/log-location.html	(revision 0)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/log-location/log-location.html	(working copy)
@@ -0,0 +1,97 @@
+<div class="row">
+    <div class="col-md-12">
+        <div class="col-md-8">
+            <div class="row">
+                <div class="widget">
+                    <div class="widget-header">
+                        <span>{{ 'Log Location Configuration' | T }}</span>
+                    </div>
+                    <br>
+                    <div class="alert alert-info" role="alert"
+                         ng-if="!storageLogLocation.secondaryDisk.isDiskAvailable">
+                        In addition, AMP supports secondary storage for long-term log retention by mounting an external
+                        secondary storage device on the AMP. On successful mounting, users can avail this option by
+                        selecting 'Secondary' in the 'Choose Storage for Logs' menu below.
+                    </div>
+                    <div class="alert alert-info" role="alert" ng-if="storageLogLocation.secondaryDisk.isDiskAvailable">
+                        Users can enable the 'Secondary Storage' by selecting 'Secondary' option in the 'Choose Storage
+                        for Logs' menu below.
+                    </div>
+                    <div>
+                        <form class="form-horizontal" name="storageListForm" unsaved-warning-form>
+                            <div class="form-group">
+                                <label class="control-label col-md-3">{{ 'Choose Storage for Logs' | T }}</label>
+                                <div class="col-md-4">
+                                    <select name="role" class="form-control"
+                                            ng-model="storageLogLocation.secondaryDisk.logLocation">
+                                        <option ng-repeat="row in storageLogLocation.diskList" value="{{row.value}}">
+                                            {{row.name|T}}
+                                        </option>
+                                    </select>
+                                </div>
+                            </div>
+                            <br>
+                            <div class="form-group">
+                                <div class="col-md-offset-3 col-md-6">
+                                    <button ng-show="storageListForm.$dirty" class="btn btn-primary"
+                                            ng-click="storageLogLocation.changeLogLocation()">{{ 'Save Changes' | T}}
+                                    </button>
+                                    <button ng-show="storageListForm.$dirty" type="reset"
+                                            class="btn btn-default btn-cancel"
+                                            ng-click="storageListForm.$dirty=false;storageLogLocation.cancel()">
+                                        {{'Cancel'|T}}
+                                    </button>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="col-md-4">
+            <div class="widget">
+                <div class="widget-header">
+                    <span>{{ 'Storage Management' | T }}</span>
+                </div>
+                <div class="table-responsive table-content">
+                    <table class="table table-striped table-hover">
+                        <thead>
+                        <tr>
+                            <th>Storage</th>
+                            <th>Total</th>
+                            <th>Used</th>
+                            <th>Free</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr>
+                            <td>Primary</td>
+                            <td>{{ storageLogLocation.storage.primary.total.value }} {{
+                                storageLogLocation.storage.primary.total.unit }}
+                            </td>
+                            <td>{{ storageLogLocation.storage.primary.used.value }} {{
+                                storageLogLocation.storage.primary.used.unit }}
+                            </td>
+                            <td>{{ storageLogLocation.storage.primary.free.value }} {{
+                                storageLogLocation.storage.primary.free.unit }}
+                            </td>
+                        </tr>
+                        <tr ng-if="storageLogLocation.secondaryDisk.isDiskAvailable">
+                            <td>Secondary</td>
+                            <td>{{ storageLogLocation.storage.secondary.total.value }} {{
+                                storageLogLocation.storage.secondary.total.unit }}
+                            </td>
+                            <td>{{ storageLogLocation.storage.secondary.used.value }} {{
+                                storageLogLocation.storage.secondary.used.unit }}
+                            </td>
+                            <td>{{ storageLogLocation.storage.secondary.free.value }} {{
+                                storageLogLocation.storage.secondary.free.unit }}
+                            </td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/primary/primary-storage.controller.js
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/primary/primary-storage.controller.js	(revision 0)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/primary/primary-storage.controller.js	(working copy)
@@ -0,0 +1,299 @@
+angular.module('cm.storage')
+    .controller('primaryStorageCtrl', [
+        '$scope',
+        '$rootScope',
+        '$state',
+        '$stateParams',
+        '$location',
+        '$uibModal',
+        '$aside',
+        'storageService',
+        'dashboardService',
+        '$filter',
+        function ($scope, $rootScope, $state, $stateParams, $location, $uibModal, $aside, storageService, dashboardService, $filter) {
+            $rootScope.title = 'Storage Management';
+            let storageViewModel = this;
+
+            storageViewModel.enter = function (item) {
+                storageViewModel.diskStatusWidget.highlight = $filter('T')(item['name']);
+            }
+
+            storageViewModel.detail = function (item) {
+                storageViewModel.detailPage = true;
+                storageViewModel.detailloading = true
+
+                storageService.postStorageQuery(JSON.stringify(item)).then(function (resp) {
+                    storageViewModel.detailloading = false
+                    if (resp && resp.status == 200) {
+                        _.each(resp.data.paths, function (path) {
+                            path['sizeStr'] = storageService.ValueFormat1024(path.size) + 'B'
+                        })
+                        storageViewModel.detailPaths = resp.data.paths
+                    }
+                })
+            }
+
+            storageViewModel.diskStatusWidget = {
+                title: $filter('T')('Disk Usage'),
+                type: 'disk_usage',
+                legendData: [$filter('T')('Used'), $filter('T')('Free')],
+                seriesData: [{name: $filter('T')('Used'), value: 0},
+                    {name: $filter('T')('Free'), value: 0}],
+                highlight: '',
+            }
+
+            storageViewModel.moduleList = []
+
+            storageViewModel.scheduleDetail = {
+                schedule: true
+            };
+
+            var getCrontab = function (cb) {
+                storageService.getStorageCrontab().then(function (res) {
+                    if (res && res.status == 200) {
+                        storageViewModel.scheduleDetail = {
+                            schedule: res.data.schedule,
+                            duration: parseInt(res.data.duration),
+                            percent: parseInt(res.data.percent)
+                        };
+                    }
+                    if (cb) {
+                        cb()
+                    }
+                })
+            }
+
+            storageViewModel.refresh = function () {
+                storageViewModel.detailPage = false;
+                getCrontab()
+
+                storageViewModel.diskStatusWidget.legendData = [$filter('T')('Used'), $filter('T')('Free')]
+                storageViewModel.diskStatusWidget.seriesData = [{
+                    name: $filter('T')('Used'),
+                    value: 0
+                }, {name: $filter('T')('Free'), value: 0}]
+                storageViewModel.diskStatusWidget.highlight = ''
+
+                var post_data = {
+                    "from": "now-20s",
+                    "to": "now",
+                    "queries": [{
+                        "datasourceId": 1,
+                        "query": "select mean(used), mean(free) from (SELECT sum(used) as used, sum(free) as free FROM disk where $timeFilter group by time(10s)); ",
+                        "rawQuery": true,
+                        "resultFormat": "time_series"
+                    }]
+                };
+                storageViewModel.totalSpace = 0;
+                dashboardService.get_composer_data('/composer/tsdb/query', JSON.stringify(post_data)).then(function (res) {
+                    if (res && res.data.code === 0) {
+                        var seriesData = [];
+                        _.each(res.data.data.results['A'].series, function (series) {
+                            if (series.name === "mean") {
+                                seriesData.push({
+                                    name: storageViewModel.diskStatusWidget.legendData[0],
+                                    value: series.points[0][1]
+                                })
+                                storageViewModel.totalSpace += series.points[0][1]
+                            } else if (series.name === "mean_1") {
+                                seriesData.push({
+                                    name: storageViewModel.diskStatusWidget.legendData[1],
+                                    value: series.points[0][1]
+                                })
+                                storageViewModel.totalSpace += series.points[0][1]
+                            }
+                        });
+                        storageViewModel.diskStatusWidget.seriesData = seriesData;
+
+                        storageService.getStorageAllocation().then(function (res) {
+                            if (res && res.status === 200) {
+                                var moduleList = [];
+                                for (var i = 0; i < res.data.length; i++) {
+                                    res.data[i]["index"] = i
+                                    moduleList.push(res.data[i])
+                                    storageService.postStorageQuery(JSON.stringify(res.data[i])).then(function (resp) {
+                                        if (resp && resp.status === 200) {
+                                            var size = 0;
+                                            _.each(resp.data.paths, function (path) {
+                                                if (path.size) {
+                                                    size += path.size
+                                                }
+                                            })
+
+                                            storageViewModel.diskStatusWidget.legendData[0] = $filter('T')('Other');
+                                            storageViewModel.diskStatusWidget.seriesData[0].name = $filter('T')('Other');
+                                            storageViewModel.diskStatusWidget.seriesData[0].value -= size;
+
+                                            storageViewModel.diskStatusWidget.legendData.push($filter('T')(resp.data['name']))
+                                            storageViewModel.diskStatusWidget.seriesData.push({
+                                                name: $filter('T')(resp.data['name']),
+                                                value: size
+                                            })
+                                            storageViewModel.moduleList[resp.data["index"]]['usage'] = parseInt(size * 100 / (storageViewModel.totalSpace))
+                                            storageViewModel.moduleList[resp.data["index"]]['sizeStr'] = storageService.ValueFormat1024(size) + 'B'
+                                        }
+                                    })
+                                }
+                                storageViewModel.moduleList = moduleList;
+                            }
+                        })
+                    }
+                });
+                storageViewModel.getSecondaryDiskInformation();
+            }
+
+            storageViewModel.showProgressBar = function () {
+                var modalInstance = $uibModal.open({
+                    templateUrl: 'app/modules/common/templates/progress.html',
+                    controller: 'showProgressCtrl',
+                    controllerAs: 'progress',
+                    backdrop: false
+                });
+            };
+
+            storageViewModel.applyCrontab = function () {
+                storageService.postStorageCrontab(JSON.stringify({
+                    "schedule": storageViewModel.scheduleDetail.schedule,
+                    "duration": storageViewModel.scheduleDetail.duration + '',
+                    "percent": storageViewModel.scheduleDetail.percent + '',
+                    "storage": 'primary',
+                })).then(function (res) {
+                    storageViewModel.showProgressBar();
+                    getCrontab(function () {
+                        $rootScope.$broadcast('endLoading', true);
+                    });
+                })
+            }
+
+            storageViewModel.cancel = function () {
+                storageViewModel.showProgressBar();
+                getCrontab(function () {
+                    $rootScope.$broadcast('endLoading', true);
+                });
+            };
+
+            storageViewModel.cleanup = function () {
+                storageViewModel.showProgressBar();
+                storageService.postStorageClean(JSON.stringify({
+                    "duration": storageViewModel.scheduleDetail.duration + '',
+                    "percent": storageViewModel.scheduleDetail.percent + ''
+                })).then(function (res) {
+                    $rootScope.$broadcast('endLoading', true);
+                    $rootScope.TipService.setMessage($filter("T")("Clean completely"));
+                    storageViewModel.refresh();
+                })
+            }
+
+            storageViewModel.getPercent = function (percent) {
+                if (!percent) return {width: '0%'};
+                percent = parseInt(percent);
+                if (isNaN(percent)) {
+                    return {width: '0%'};
+                } else {
+                    return {width: percent + '%'};
+                }
+            };
+
+            storageViewModel.secondaryDisk = {
+                isDiskAvailable: false
+            };
+
+            storageViewModel.getSecondaryDiskInformation = function () {
+                storageViewModel.secondaryDisk.isDiskAvailable = true;
+            }
+
+            storageViewModel.refresh();
+        }
+    ])
+    .directive('diskUsagePie', ['$filter', '$state', '$interval', 'storageService', function ($filter, $state, $interval, storageService) {
+        return {
+            scope: {},
+            restrict: 'A',
+            replace: true,
+            link: function ($scope, element, attrs, controller) {
+                var theme = "dark";
+                if (window.localStorage.theme && (window.localStorage.theme !== "dark")) {
+                    theme = "default";
+                }
+                var myChart = echarts.init(element.get(0), theme, {
+                    renderer: 'canvas'
+                });
+                var widgetConfig = attrs.diskUsagePie ? $scope.$parent.$eval(attrs.diskUsagePie) : {};
+
+                var option = {
+                    tooltip: {
+                        trigger: 'item',
+                        formatter: function (params) {
+                            return params.name + ": " + storageService.ValueFormat1024(params.value) + "B"
+                        }
+                    },
+                    legend: {
+                        show: false,
+                        data: widgetConfig.legendData
+                    },
+                    series: [
+                        {
+                            name: widgetConfig.title,
+                            type: 'pie',
+                            radius: '60%',
+                            center: ['50%', '50%'],
+                            label: {
+                                textStyle: {}
+                            },
+                            labelLine: {
+                                lineStyle: {},
+                                smooth: 0.2,
+                                length: 25,
+                                length2: 15
+                            },
+                            itemStyle: {
+                                borderRadius: 5,
+                                shadowColor: 'rgba(0, 0, 0, 0.5)',
+                                shadowBlur: 5
+                            },
+                            data: [],
+                            animationType: 'scale',
+                            animationEasing: 'elasticOut',
+                            animationDelay: function (idx) {
+                                return Math.random() * 200;
+                            }
+                        }
+                    ]
+                };
+                myChart.showLoading();
+
+                var lastHighLight = undefined;
+
+                $scope.$watch(function () {
+                    return widgetConfig
+                }, function (config) {
+                    option.legend.data = config.legendData;
+                    option.series[0].data = config.seriesData;
+                    myChart.setOption(option);
+                    myChart.hideLoading();
+
+                    if (config.highlight) {
+                        myChart.dispatchAction({
+                            type: 'highlight',
+                            seriesIndex: 0,
+                            name: config.highlight
+                        });
+                        if (lastHighLight) {
+                            myChart.dispatchAction({
+                                type: 'downplay',
+                                seriesIndex: 0,
+                                name: lastHighLight
+                            });
+                        }
+                        lastHighLight = config.highlight
+                    }
+                }, true);
+
+                window.addEventListener('resize', function () {
+                    if (myChart) {
+                        myChart.resize();
+                    }
+                });
+            }
+        };
+    }])
Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/primary/primary-storage.html
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/primary/primary-storage.html	(revision 0)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/primary/primary-storage.html	(working copy)
@@ -0,0 +1,127 @@
+<div class="row">
+    <div class="col-md-12">
+        <div class="col-md-8">
+            <div class="row">
+                <div class="widget">
+                    <div class="widget-header">
+                        <span>{{ 'Storage Clean' | T }}</span>
+                    </div>
+                    <div>
+                        <form class="form-horizontal" name="storageform" unsaved-warning-form>
+                            <div class="form-group">
+                                <label class="control-label col-md-3">{{ 'Scheduled cleaning' | T}}</label>
+                                <div class="col-md-6">
+                                    <input bs-switch class="switch" ng-model="primaryStorage.scheduleDetail.schedule" type="checkbox" switch-active="true" resettable>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-3">
+                                    {{ 'Retention duration of Data' | T}}
+                                    <i class="fa fa-info-circle" data-role="popover" data-popover-mode="hover" data-popover-position="top" data-popover-text="{{'Data exceeding the set period will be deleted' | T}}" data-popover-background="bg-cyan" data-popover-color="fg-white"></i>
+                                </label>
+                                <div class="col-md-3" style="display: inline-flex;">
+                                    <input type="number" oninput="if(value>999){value=999}else if(value<1){value=1}" class="form-control" name="duration" ng-model="primaryStorage.scheduleDetail.duration" resettable>
+                                    <span style="font-size: 15px; padding: 10px 5px">{{ 'Day' | T}}</span>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-3">
+                                    {{ 'Maximum disk usage' | T}}
+                                    <i class="fa fa-info-circle" data-role="popover" data-popover-mode="hover" data-popover-position="top" data-popover-text="{{'Historical data is deleted when the disk limit is exceeded' | T}}" data-popover-background="bg-cyan" data-popover-color="fg-white"></i>
+                                </label>
+                                <div class="col-md-3" style="display: inline-flex;">
+                                    <input type="number" oninput="if(value>90){value=90}else if(value<50){value=50}" class="form-control" name="percent" ng-model="primaryStorage.scheduleDetail.percent" resettable>
+                                    <span style="font-size: 15px; padding: 10px 5px">{{ '%' }}</span>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <div class="col-md-offset-3 col-md-6">
+                                    <button ng-show="storageform.$dirty" class="btn btn-primary" ng-click="primaryStorage.applyCrontab()">{{ 'Save Changes' | T}}</button>
+                                    <button ng-show="storageform.$dirty" type="reset" class="btn btn-default btn-cancel" ng-click="storageform.$dirty=false;primaryStorage.cancel()">{{'Cancel'|T}}</button>
+                                    <button class="btn btn-success" ng-click="primaryStorage.cleanup()">{{ 'Clean up immediately' | T}}</button>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+            <div class="row">
+                <div class="widget">
+                    <div class="widget-header">
+                        <span>{{ 'Storage Management' | T }}</span>
+                    </div>
+                    <div class="table-responsive" ng-if="!primaryStorage.detailPage">
+                        <table class="table table-striped table-hover">
+                            <thead>
+                            <tr>
+                                <th class="name">{{'Module' | T}}</th>
+                                <th>{{'Disk Usage' | T}}</th>
+                                <th>{{'Disk Size' | T}}</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            <tr ng-repeat="item in primaryStorage.moduleList" ng-mouseenter="primaryStorage.enter(item)">
+                                <td style="cursor: pointer;" ng-click="primaryStorage.detail(item)"><a>{{ item.name | T}}</a></td>
+                                <td>
+                                    <div class="col-pb" ng-if="item.sizeStr">
+                                        <div class="progress" title="{{item.usage}}%">
+                                            <div class="progress-bar progress-bar-info" role="progressbar" ng-style="primaryStorage.getPercent(item.usage)" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="col-pb" ng-if="!item.sizeStr">
+                                        <i class="fa fa-spinner fa-spin" style="color:#e4701d;"></i>
+                                    </div>
+                                </td>
+                                <td>
+                                    <span>{{item.sizeStr}}</span>
+                                </td>
+                            </tr>
+                            </tbody>
+                        </table>
+                    </div>
+                    <div class="table-responsive" ng-if="primaryStorage.detailPage">
+                        <div class="table-toolbar">
+                            <div class="">
+                                <div class="btn-group">
+                                    <button title="{{'Back'|T}}" class="btn btn-link hive_enable_active" ng-click="primaryStorage.detailPage = false">
+                                        <i class="fa fa-arrow-left"></i>
+                                    </button>
+                                </div>
+                            </div>
+                        </div>
+                        <table class="table table-striped table-hover" ng-if="!primaryStorage.detailloading">
+                            <thead>
+                            <tr>
+                                <th class="name">{{'Name' | T}}</th>
+                                <th>{{'Description' | T}}</th>
+                                <th>{{'Disk Size' | T}}</th>
+                                <th>{{'Action' | T}}</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            <tr ng-repeat="item in primaryStorage.detailPaths">
+                                <td>{{ item.name | T}}</td>
+                                <td>{{ item.description | T}}</td>
+                                <td>{{ item.sizeStr }}</td>
+                                <td ng-if="item.ui_url">
+                                    <a ui-sref="index.{{ item.ui_url }}">{{'View' | T}}</a>
+                                </td>
+                            </tr>
+                            </tbody>
+                        </table>
+                        <div style="text-align: center" ng-if="primaryStorage.detailloading">
+                            <img src="app/images/loading.gif">
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 graph ng-scope">
+            <div class="graph-title">
+                <span>{{primaryStorage.diskStatusWidget.title}}</span>
+            </div>
+            <div class="graph-container" disk-usage-pie="primaryStorage.diskStatusWidget" style="height: 360px"></div>
+        </div>
+    </div>
+</div>
Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/secondary/secondary-storage.controller.js
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/secondary/secondary-storage.controller.js	(revision 0)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/secondary/secondary-storage.controller.js	(working copy)
@@ -0,0 +1,198 @@
+angular.module('cm.storage')
+    .controller('secondaryStorageCtrl', [
+        '$scope',
+        '$rootScope',
+        '$state',
+        '$stateParams',
+        '$location',
+        '$uibModal',
+        '$aside',
+        'storageService',
+        'dashboardService',
+        '$filter',
+        function ($scope, $rootScope, $state, $stateParams, $location, $uibModal, $aside, storageService, dashboardService, $filter) {
+            $rootScope.title = 'Secondary Storage Management';
+            let storageViewModel = this;
+
+            storageViewModel.enter = function (item) {
+                storageViewModel.diskStatusWidget.highlight = $filter('T')(item['name']);
+            }
+
+            storageViewModel.detail = function (item) {
+                storageViewModel.detailPage = true;
+                storageViewModel.detailloading = true
+
+                storageService.postStorageQuery(JSON.stringify(item)).then(function (resp) {
+                    storageViewModel.detailloading = false
+                    if (resp && resp.status === 200) {
+                        _.each(resp.data.paths, function (path) {
+                            path['sizeStr'] = storageService.ValueFormat1024(path.size) + 'B'
+                        })
+                        storageViewModel.detailPaths = resp.data.paths
+                    }
+                })
+            }
+
+            storageViewModel.diskStatusWidget = {
+                title: $filter('T')('Disk Usage'),
+                type: 'disk_usage',
+                legendData: [$filter('T')('Used'), $filter('T')('Free')],
+                seriesData: [{name: $filter('T')('Used'), value: 0},
+                    {name: $filter('T')('Free'), value: 0}],
+                highlight: '',
+            }
+
+            storageViewModel.moduleList = []
+
+            storageViewModel.scheduleDetail = {
+                schedule: true
+            };
+
+            var getCrontab = function (cb) {
+                storageService.getStorageCrontab('secondary').then(function (res) {
+                    if (res && res.status === 200) {
+                        storageViewModel.scheduleDetail = {
+                            schedule: res.data.schedule,
+                            duration: parseInt(res.data.duration),
+                            percent: parseInt(res.data.percent)
+                        };
+                    }
+                    if (cb) {
+                        cb()
+                    }
+                })
+            }
+
+            storageViewModel.refresh = function () {
+                storageViewModel.detailPage = false;
+
+                getCrontab();
+
+                storageViewModel.diskStatusWidget.legendData = [$filter('T')('Used'), $filter('T')('Free')]
+                storageViewModel.diskStatusWidget.seriesData = [{
+                    name: $filter('T')('Used'),
+                    value: 0
+                }, {name: $filter('T')('Free'), value: 0}]
+                storageViewModel.diskStatusWidget.highlight = ''
+
+                storageViewModel.getSecondaryDiskInformation();
+
+                storageService.getStorageAllocation().then(function (res) {
+                    if (res && res.status === 200) {
+                        var moduleList = [];
+                        for (var i = 0; i < res.data.length; i++) {
+                            res.data[i]["index"] = i
+                            moduleList.push(res.data[i])
+                            storageService.postStorageQuery(JSON.stringify(res.data[i])).then(function (resp) {
+                                if (resp && resp.status === 200) {
+                                    var size = 0;
+                                    _.each(resp.data.paths, function (path) {
+                                        if (path.size) {
+                                            size += path.size
+                                        }
+                                    })
+                                    storageViewModel.moduleList[resp.data["index"]]['usage'] = parseInt(size * 100 / (storageViewModel.totalSpace))
+                                    storageViewModel.moduleList[resp.data["index"]]['sizeStr'] = storageService.ValueFormat1024(size) + 'B'
+                                }
+                            })
+                        }
+                        storageViewModel.moduleList = moduleList;
+                        console.log(storageViewModel.moduleList);
+                    }
+                })
+            }
+
+            storageViewModel.showProgressBar = function () {
+                var modalInstance = $uibModal.open({
+                    templateUrl: 'app/modules/common/templates/progress.html',
+                    controller: 'showProgressCtrl',
+                    controllerAs: 'progress',
+                    backdrop: false
+                });
+            };
+
+            storageViewModel.applyCrontab = function () {
+                storageService.postStorageCrontab(JSON.stringify({
+                    "schedule": storageViewModel.scheduleDetail.schedule,
+                    "duration": storageViewModel.scheduleDetail.duration + '',
+                    "percent": storageViewModel.scheduleDetail.percent + '',
+                    "storage": 'secondary',
+                })).then(function (res) {
+                    storageViewModel.showProgressBar();
+                    getCrontab(function () {
+                        $rootScope.$broadcast('endLoading', true);
+                    });
+                })
+            }
+
+            storageViewModel.cancel = function () {
+                storageViewModel.showProgressBar();
+                getCrontab(function () {
+                    $rootScope.$broadcast('endLoading', true);
+                });
+            };
+
+            storageViewModel.cleanup = function () {
+                storageViewModel.showProgressBar();
+                storageService.postStorageClean(JSON.stringify({
+                    "duration": storageViewModel.scheduleDetail.duration + '',
+                    "percent": storageViewModel.scheduleDetail.percent + ''
+                })).then(function (res) {
+                    $rootScope.$broadcast('endLoading', true);
+                    $rootScope.TipService.setMessage($filter("T")("Clean completely"));
+                    storageViewModel.refresh();
+                })
+            }
+
+            storageViewModel.getPercent = function (percent) {
+                if (!percent) return {width: '0%'};
+                percent = parseInt(percent);
+                if (isNaN(percent)) {
+                    return {width: '0%'};
+                } else {
+                    return {width: percent + '%'};
+                }
+            };
+
+            storageViewModel.secondaryDisk = {
+                isDiskAvailable: false
+            };
+
+            storageViewModel.storage = {
+                secondary: {
+                    free: {unit: '', value: 0},
+                    used: {unit: '', value: 0},
+                }
+            }
+
+            storageViewModel.getSecondaryDiskInformation = function () {
+                storageService.getSecondaryDriveInfo().then(function (res) {
+                    if (res && res.status === 200) {
+                        $rootScope.$broadcast('endLoading', true);
+                        let response = res.data;
+                        storageViewModel.secondaryDisk.isDiskAvailable = response['is_disk_available'];
+                        if (storageViewModel.secondaryDisk.isDiskAvailable) {
+                            storageViewModel.storage.secondary.total = storageService.formatBigData(response.total);
+                            storageViewModel.storage.secondary.used = storageService.formatBigData(response.used);
+                            storageViewModel.storage.secondary.free = storageService.formatBigData(response.free);
+                            storageViewModel.diskStatusWidget.seriesData = [
+                                {name: 'Free', value: response.free},
+                                {name: 'Used', value: response.used},
+                            ];
+                            storageViewModel.showProgressBar();
+                            storageService.getLogLocation().then(function (resp) {
+                                $rootScope.$broadcast('endLoading', true);
+                                if (res && res.status === 200) {
+                                    let log_info = resp.data
+                                    storageViewModel.secondaryDisk.logLocation = log_info['location'];
+                                }
+                            })
+                        }
+                    } else {
+                        $rootScope.$broadcast('endLoading', true);
+                    }
+                })
+            }
+
+            storageViewModel.refresh();
+        }])
Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/secondary/secondary-storage.html
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/secondary/secondary-storage.html	(revision 0)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/secondary/secondary-storage.html	(working copy)
@@ -0,0 +1,149 @@
+<div class="row">
+    <div class="col-md-12">
+        <div class="col-md-8">
+            <div class="row">
+                <div class="widget">
+                    <div class="widget-header">
+                        <span>{{ 'Storage Clean' | T }}</span>
+                    </div>
+                    <div>
+                        <form class="form-horizontal" name="storageform" unsaved-warning-form>
+                            <div class="form-group">
+                                <label class="control-label col-md-3">{{ 'Scheduled cleaning' | T}}</label>
+                                <div class="col-md-6">
+                                    <input bs-switch class="switch" ng-model="secondaryStorage.scheduleDetail.schedule"
+                                           type="checkbox" switch-active="true" resettable>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-3">
+                                    {{ 'Retention duration of Data' | T}}
+                                    <i class="fa fa-info-circle" data-role="popover" data-popover-mode="hover"
+                                       data-popover-position="top"
+                                       data-popover-text="{{'Data exceeding the set period will be deleted' | T}}"
+                                       data-popover-background="bg-cyan" data-popover-color="fg-white"></i>
+                                </label>
+                                <div class="col-md-3" style="display: inline-flex;">
+                                    <input type="number" oninput="if(value>999){value=999}else if(value<1){value=1}"
+                                           class="form-control" name="duration"
+                                           ng-model="secondaryStorage.scheduleDetail.duration" resettable>
+                                    <span style="font-size: 15px; padding: 10px 5px">{{ 'Day' | T}}</span>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-3">
+                                    {{ 'Maximum disk usage' | T}}
+                                    <i class="fa fa-info-circle" data-role="popover" data-popover-mode="hover"
+                                       data-popover-position="top"
+                                       data-popover-text="{{'Historical data is deleted when the disk limit is exceeded' | T}}"
+                                       data-popover-background="bg-cyan" data-popover-color="fg-white"></i>
+                                </label>
+                                <div class="col-md-3" style="display: inline-flex;">
+                                    <input type="number" oninput="if(value>90){value=90}else if(value<50){value=50}"
+                                           class="form-control" name="percent"
+                                           ng-model="secondaryStorage.scheduleDetail.percent" resettable>
+                                    <span style="font-size: 15px; padding: 10px 5px">{{ '%' }}</span>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <div class="col-md-offset-3 col-md-6">
+                                    <button ng-show="storageform.$dirty" class="btn btn-primary"
+                                            ng-click="secondaryStorage.applyCrontab()">{{ 'Save Changes' | T}}
+                                    </button>
+                                    <button ng-show="storageform.$dirty" type="reset" class="btn btn-default btn-cancel"
+                                            ng-click="storageform.$dirty=false;secondaryStorage.cancel()">{{'Cancel'|T}}
+                                    </button>
+                                    <button class="btn btn-success" ng-click="secondaryStorage.cleanup()">{{ 'Clean up
+                                        immediately' | T}}
+                                    </button>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+<!--            <div class="row">-->
+<!--                <div class="widget">-->
+<!--                    <div class="widget-header">-->
+<!--                        <span>{{ 'Storage Management' | T }}</span>-->
+<!--                    </div>-->
+<!--                    <div class="table-responsive" ng-if="!secondaryStorage.detailPage">-->
+<!--                        <table class="table table-striped table-hover">-->
+<!--                            <thead>-->
+<!--                            <tr>-->
+<!--                                <th class="name">{{'Module' | T}}</th>-->
+<!--                                <th>{{'Disk Usage' | T}}</th>-->
+<!--                                <th>{{'Disk Size' | T}}</th>-->
+<!--                            </tr>-->
+<!--                            </thead>-->
+<!--                            <tbody>-->
+<!--                            <tr ng-repeat="item in secondaryStorage.moduleList"-->
+<!--                                ng-mouseenter="secondaryStorage.enter(item)">-->
+<!--                                <td style="cursor: pointer;" ng-click="secondaryStorage.detail(item)"><a>{{ item.name |-->
+<!--                                    T}}</a></td>-->
+<!--                                <td>-->
+<!--                                    <div class="col-pb" ng-if="item.sizeStr">-->
+<!--                                        <div class="progress" title="{{item.usage}}%">-->
+<!--                                            <div class="progress-bar progress-bar-info" role="progressbar"-->
+<!--                                                 ng-style="secondaryStorage.getPercent(item.usage)" aria-valuenow="60"-->
+<!--                                                 aria-valuemin="0" aria-valuemax="100">-->
+<!--                                            </div>-->
+<!--                                        </div>-->
+<!--                                    </div>-->
+<!--                                    <div class="col-pb" ng-if="!item.sizeStr">-->
+<!--                                        <i class="fa fa-spinner fa-spin" style="color:#e4701d;"></i>-->
+<!--                                    </div>-->
+<!--                                </td>-->
+<!--                                <td>-->
+<!--                                    <span>{{item.sizeStr}}</span>-->
+<!--                                </td>-->
+<!--                            </tr>-->
+<!--                            </tbody>-->
+<!--                        </table>-->
+<!--                    </div>-->
+<!--                    <div class="table-responsive" ng-if="secondaryStorage.detailPage">-->
+<!--                        <div class="table-toolbar">-->
+<!--                            <div class="">-->
+<!--                                <div class="btn-group">-->
+<!--                                    <button title="{{'Back'|T}}" class="btn btn-link hive_enable_active"-->
+<!--                                            ng-click="secondaryStorage.detailPage = false">-->
+<!--                                        <i class="fa fa-arrow-left"></i>-->
+<!--                                    </button>-->
+<!--                                </div>-->
+<!--                            </div>-->
+<!--                        </div>-->
+<!--                        <table class="table table-striped table-hover" ng-if="!secondaryStorage.detailloading">-->
+<!--                            <thead>-->
+<!--                            <tr>-->
+<!--                                <th class="name">{{'Name' | T}}</th>-->
+<!--                                <th>{{'Description' | T}}</th>-->
+<!--                                <th>{{'Disk Size' | T}}</th>-->
+<!--                                <th>{{'Action' | T}}</th>-->
+<!--                            </tr>-->
+<!--                            </thead>-->
+<!--                            <tbody>-->
+<!--                            <tr ng-repeat="item in secondaryStorage.detailPaths">-->
+<!--                                <td>{{ item.name | T}}</td>-->
+<!--                                <td>{{ item.description | T}}</td>-->
+<!--                                <td>{{ item.sizeStr }}</td>-->
+<!--                                <td ng-if="item.ui_url">-->
+<!--                                    <a ui-sref="index.{{ item.ui_url }}">{{'View' | T}}</a>-->
+<!--                                </td>-->
+<!--                            </tr>-->
+<!--                            </tbody>-->
+<!--                        </table>-->
+<!--                        <div style="text-align: center" ng-if="secondaryStorage.detailloading">-->
+<!--                            <img src="app/images/loading.gif">-->
+<!--                        </div>-->
+<!--                    </div>-->
+<!--                </div>-->
+<!--            </div>-->
+        </div>
+        <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 graph ng-scope">
+            <div class="graph-title">
+                <span>{{secondaryStorage.diskStatusWidget.title}}</span>
+            </div>
+            <div class="graph-container" disk-usage-pie="secondaryStorage.diskStatusWidget" style="height: 360px"></div>
+        </div>
+    </div>
+</div>
Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.controller.js
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.controller.js	(revision 2354)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.controller.js	(working copy)
@@ -11,432 +11,28 @@
         'dashboardService',
         '$filter',
         function ($scope, $rootScope, $state, $stateParams, $location, $uibModal, $aside, storageService, dashboardService, $filter) {
-            $rootScope.title = 'Storage Management';
-            var storageViewModel = this;
+            let storageViewModel = this;
 
-            storageViewModel.enter = function (item) {
-                storageViewModel.diskStatusWidget.highlight = $filter('T')(item['name']);
-            }
-
-            storageViewModel.detail = function (item) {
-                storageViewModel.detailPage = true;
-                storageViewModel.detailloading = true
-
-                storageService.postStorageQuery(JSON.stringify(item)).then(function (resp) {
-                    storageViewModel.detailloading = false
-                    if (resp && resp.status == 200) {
-                        _.each(resp.data.paths, function (path) {
-                            path['sizeStr'] = storageService.ValueFormat1024(path.size) + 'B'
-                        })
-                        storageViewModel.detailPaths = resp.data.paths
-                    }
-                })
-            }
-
-            storageViewModel.diskStatusWidget = {
-                title: $filter('T')('Disk Usage'),
-                type: 'disk_usage',
-                legendData: [$filter('T')('Used'), $filter('T')('Free')],
-                seriesData: [{ name: $filter('T')('Used'), value: 0 },
-                { name: $filter('T')('Free'), value: 0 }],
-                highlight: '',
-            }
-
-            storageViewModel.moduleList = []
-
-            storageViewModel.scheduleDetail = {
-                schedule: true
-            };
-
-            var getCrontab = function (cb) {
-                storageService.getStorageCrontab().then(function (res) {
-                    if (res && res.status == 200) {
-                        storageViewModel.scheduleDetail = {
-                            schedule: res.data.schedule,
-                            duration: parseInt(res.data.duration),
-                            percent: parseInt(res.data.percent)
-                        };
-                    }
-                    if (cb) {
-                        cb()
-                    }
-                })
-            }
-
-            storageViewModel.refresh = function () {
-                storageViewModel.detailPage = false;
-                getCrontab()
-
-                storageViewModel.diskStatusWidget.legendData = [$filter('T')('Used'), $filter('T')('Free')]
-                storageViewModel.diskStatusWidget.seriesData = [{ name: $filter('T')('Used'), value: 0 }, { name: $filter('T')('Free'), value: 0 }]
-                storageViewModel.diskStatusWidget.highlight = ''
-
-                var post_data = {
-                    "from": "now-20s",
-                    "to": "now",
-                    "queries": [{
-                        "datasourceId": 1,
-                        "query": "select mean(used), mean(free) from (SELECT sum(used) as used, sum(free) as free FROM disk where $timeFilter group by time(10s)); ",
-                        "rawQuery": true,
-                        "resultFormat": "time_series"
-                    }]
-                };
-                storageViewModel.totalSpace = 0;
-                dashboardService.get_composer_data('/composer/tsdb/query', JSON.stringify(post_data)).then(function (res) {
-                    if (res && res.data.code == 0) {
-                        var seriesData = [];
-                        _.each(res.data.data.results['A'].series, function (series) {
-                            if (series.name == "mean") {
-                                seriesData.push({ name: storageViewModel.diskStatusWidget.legendData[0], value: series.points[0][1] })
-                                storageViewModel.totalSpace += series.points[0][1]
-                            } else if (series.name == "mean_1") {
-                                seriesData.push({ name: storageViewModel.diskStatusWidget.legendData[1], value: series.points[0][1] })
-                                storageViewModel.totalSpace += series.points[0][1]
-                            }
-                        });
-                        storageViewModel.diskStatusWidget.seriesData = seriesData;
-
-                        storageService.getStorageAllocation().then(function (res) {
-                            if (res && res.status == 200) {
-                                var moduleList = [];
-                                for (var i = 0; i < res.data.length; i++) {
-                                    res.data[i]["index"] = i
-                                    moduleList.push(res.data[i])
-                                    storageService.postStorageQuery(JSON.stringify(res.data[i])).then(function (resp) {
-                                        if (resp && resp.status == 200) {
-                                            var size = 0;
-                                            _.each(resp.data.paths, function (path) {
-                                                if (path.size) {
-                                                    size += path.size
-                                                }
-                                            })
-
-                                            storageViewModel.diskStatusWidget.legendData[0] = $filter('T')('Other');
-                                            storageViewModel.diskStatusWidget.seriesData[0].name = $filter('T')('Other');
-                                            storageViewModel.diskStatusWidget.seriesData[0].value -= size;
-
-                                            storageViewModel.diskStatusWidget.legendData.push($filter('T')(resp.data['name']))
-                                            storageViewModel.diskStatusWidget.seriesData.push({ name: $filter('T')(resp.data['name']), value: size })
-
-                                            storageViewModel.moduleList[resp.data["index"]]['usage'] = parseInt(size * 100 / (storageViewModel.totalSpace))
-                                            storageViewModel.moduleList[resp.data["index"]]['sizeStr'] = storageService.ValueFormat1024(size) + 'B'
-                                        }
-                                    })
-                                }
-                                storageViewModel.moduleList = moduleList;
-                            }
-                        })
-                    }
-                });
-            }
-
-            storageViewModel.refresh();
-
-            storageViewModel.showProgressBar = function () {
-                var modalInstance = $uibModal.open({
-                    templateUrl: 'app/modules/common/templates/progress.html',
-                    controller: 'showProgressCtrl',
-                    controllerAs: 'progress',
-                    backdrop: false
-                });
-            };
-
-            storageViewModel.applyCrontab = function () {
-                storageService.postStorageCrontab(JSON.stringify({
-                    "schedule": storageViewModel.scheduleDetail.schedule,
-                    "duration": storageViewModel.scheduleDetail.duration+'',
-                    "percent": storageViewModel.scheduleDetail.percent+''
-                })).then(function (res) {
-                    storageViewModel.showProgressBar();
-                    getCrontab(function () {
-                        $rootScope.$broadcast('endLoading', true);
-                    });
-                })
-            }
-
-            storageViewModel.cancel = function () {
-                storageViewModel.showProgressBar();
-                getCrontab(function () {
-                    $rootScope.$broadcast('endLoading', true);
-                });
+            $scope.url_contain = function (url) {
+                return $location.path().indexOf(url) > -1;
             };
 
-            storageViewModel.cleanup = function () {
-                storageViewModel.showProgressBar();
-                storageService.postStorageClean(JSON.stringify({
-                    "duration": storageViewModel.scheduleDetail.duration+'',
-                    "percent": storageViewModel.scheduleDetail.percent+''
-                })).then(function (res) {
-                    $rootScope.$broadcast('endLoading', true);
-                    $rootScope.TipService.setMessage($filter("T")("Clean completely"));
-                    storageViewModel.refresh();
-                })
-            }
-
-            storageViewModel.getPercent = function (percent) {
-                if (!percent) return { width: '0%' };
-                percent = parseInt(percent);
-                if (isNaN(percent)) {
-                    return { width: '0%' };
-                } else {
-                    return { width: percent + '%' };
-                }
+            storageViewModel.secondaryDisk = {
+                isDiskAvailable: false
             };
 
-        }
-    ])
-    .directive('diskUsagePie', ['$filter', '$state', '$interval', 'storageService', function ($filter, $state, $interval, storageService) {
-        return {
-            scope: {
-            },
-            restrict: 'A',
-            replace: true,
-            link: function ($scope, element, attrs, controller) {
-                var theme = "dark";
-                if (window.localStorage.theme && (window.localStorage.theme != "dark")) {
-                    theme = "default";
-                }
-                var myChart = echarts.init(element.get(0), theme, {
-                    renderer: 'canvas'
-                });
-                var widgetConfig = attrs.diskUsagePie ? $scope.$parent.$eval(attrs.diskUsagePie) : {};
+            storageViewModel.getSecondaryDiskInformation = function () {
+                storageViewModel.secondaryDisk.isDiskAvailable = true;
 
-                var option = {
-                    tooltip: {
-                        trigger: 'item',
-                        formatter: function (params) {
-                            return params.name + ": " + storageService.ValueFormat1024(params.value) + "B"
+                storageService.getSecondaryDriveInfo().then(function(res){
+                    if (res && res.status === 200) {
+                        let response = res.data;
+                        storageViewModel.secondaryDisk.isDiskAvailable = !response['is_disk_available'];
+                        if ($location.path() === '/storage') {
+                            $state.go('index.storage.log');
                         }
-                    },
-                    legend: {
-                        show: false,
-                        data: widgetConfig.legendData
-                    },
-                    series: [
-                        {
-                            name: widgetConfig.title,
-                            type: 'pie',
-                            radius: '60%',
-                            center: ['50%', '50%'],
-                            label: {
-                                textStyle: {
-                                }
-                            },
-                            labelLine: {
-                                lineStyle: {
-                                },
-                                smooth: 0.2,
-                                length: 25,
-                                length2: 15
-                            },
-                            itemStyle: {
-                                borderRadius: 5,
-                                shadowColor: 'rgba(0, 0, 0, 0.5)',
-                                shadowBlur: 5
-                            },
-                            data: [],
-                            animationType: 'scale',
-                            animationEasing: 'elasticOut',
-                            animationDelay: function (idx) {
-                                return Math.random() * 200;
-                            }
-                        }
-                    ]
-                };
-                myChart.showLoading();
-
-                var lastHighLight = undefined;
-
-                $scope.$watch(function () {
-                    return widgetConfig
-                }, function (config) {
-                    option.legend.data = config.legendData;
-                    option.series[0].data = config.seriesData;
-                    myChart.setOption(option);
-                    myChart.hideLoading();
-
-                    if (config.highlight) {
-                        myChart.dispatchAction({
-                            type: 'highlight',
-                            seriesIndex: 0,
-                            name: config.highlight
-                        });
-                        if (lastHighLight) {
-                            myChart.dispatchAction({
-                                type: 'downplay',
-                                seriesIndex: 0,
-                                name: lastHighLight
-                            });
-                        }
-                        lastHighLight = config.highlight
                     }
-                }, true);
-
-                window.addEventListener('resize', function () {
-                    if (myChart) {
-                        myChart.resize();
-                    }
-                });
+                })
             }
-        };
-    }])
-    // .directive('monitoringUsage', ['dashboardService', '$filter', '$interval', '$uibModal', '$state', function (dashboardService, $filter, $interval, $uibModal, $state) {
-    //     return {
-    //         scope: {
-    //         },
-    //         restrict: 'A',
-    //         replace: true,
-    //         link: function ($scope, element, attrs, controller) {
-    //             var theme = "halloween";
-    //             if (window.localStorage.theme && (window.localStorage.theme != "dark")) {
-    //                 theme = "westeros";
-    //             }
-    //             var myChart = echarts.init(element.get(0), theme, {
-    //                 renderer: 'canvas'
-    //             });
-    //             var widgetConfig = attrs.monitoringUsage ? $scope.$parent.$eval(attrs.monitoringUsage) : {};
-
-    //             var labelOption = {
-    //                 normal: {
-    //                     show: true,
-    //                     position: 'top',
-    //                     distance: 15,
-    //                     align: 'center',
-    //                     verticalAlign: 'middle',
-    //                     // rotate: 90,
-    //                     // fontSize: 16,
-    //                     formatter: function (params) {
-    //                         var value = params.value + '';
-    //                         var pos = value.indexOf('.');
-    //                         if (pos < 0) {
-    //                             pos = value.length;
-    //                             value += '.';
-    //                         }
-    //                         while (value.length <= pos + 2) {
-    //                             value += '0';
-    //                         }
-    //                         return value;
-    //                     },
-    //                     rich: {
-    //                         name: {
-    //                             textBorderColor: '#fff'
-    //                         }
-    //                     }
-    //                 }
-    //             };
-
-    //             var option = {
-    //                 // color: ['#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', '#eedd78', '#73a373', '#73b9bc', '#7289ab', '#91ca8c', '#f49f42'],
-    //                 tooltip: {
-    //                     trigger: 'axis',
-    //                     axisPointer: {
-    //                         type: 'shadow'// 'line' | 'shadow'
-    //                     },
-    //                     formatter: '{a}<br/>{b} : {c}%'
-    //                 },
-    //                 grid: {
-    //                     left: '3%',
-    //                     right: '4%',
-    //                     bottom: '3%',
-    //                     containLabel: true
-    //                 },
-    //                 xAxis: [
-    //                     {
-    //                         type: 'category',
-    //                         data: [$filter('T')('Image Space'), $filter('T')('DB Used')],
-    //                         axisTick: {
-    //                             alignWithLabel: true
-    //                         }
-    //                     }
-    //                 ],
-    //                 yAxis: [
-    //                     {
-    //                         type: 'value',
-    //                         minInterval: 20,
-    //                         max: 100,
-    //                         splitNumber: 5,
-    //                         // axisLabel: {
-    //                         //     formatter: function (a) {
-    //                         //         return a + '%';
-    //                         //     }
-    //                         // }
-    //                     }
-    //                 ],
-    //                 series: [
-    //                     {
-    //                         name: $filter('T')(widgetConfig.name),
-    //                         type: 'bar',
-    //                         barWidth: '45%',
-    //                         label: labelOption,
-    //                         itemStyle: {
-    //                             normal: {
-    //                                 color: function (params) {
-    //                                     var colorList = ['#dd6b66', '#B5C334', '#C1232B', '#FCCE10', '#27727B'];
-    //                                     var data = parseFloat(params.data);
-    //                                     if (params.dataIndex === 1 && data >= 80) {
-    //                                         return colorList[params.dataIndex + 1];
-    //                                     }
-    //                                     return colorList[params.dataIndex];
-    //                                 }
-    //                             }
-    //                         },
-    //                         data: []
-    //                     }
-    //                 ]
-    //             };
-    //             myChart.on('click', function (params) {
-    //                 if (params.dataIndex === 1) {
-    //                     var editModalInstance = $uibModal.open({
-    //                         templateUrl: 'app/modules/dashboard/modal/clearLog.html',
-    //                         controller: 'clearLogCtrl',
-    //                         controllerAs: 'clearLog',
-    //                         resolve: {
-    //                         }
-    //                     });
-    //                 }
-    //                 if (params.dataIndex === 0) {
-    //                     go('index.image');
-    //                 }
-    //                 function go(url) {
-    //                     $state.go(url);
-    //                 };
-    //             });
-    //             myChart.showLoading();
-    //             getSystemDiskInfo();
-    //             if (!angular.isDefined($scope.systemDataTimer)) {
-    //                 $scope.systemDataTimer = $interval(function () {
-    //                     getSystemDiskInfo();
-    //                 }, 5000);
-    //             }
-    //             $scope.$on('$destroy', function () {
-    //                 if (angular.isDefined($scope.systemDataTimer)) {
-    //                     $interval.cancel($scope.systemDataTimer);
-    //                     $scope.systemDataTimer = undefined;
-    //                 }
-    //             });
-    //             function getSystemDiskInfo() {
-    //                 dashboardService.getSystemDiskInfo().then(function (response) {
-    //                     if (response && response.status === 200) {
-    //                         parseData(response.data);
-    //                     }
-    //                 });
-    //             }
-    //             function parseData(data) {
-    //                 var imageU, dbU;
-    //                 imageU = data.image_space ? data.image_space : 0.0;
-    //                 dbU = data.db_used ? data.db_used : 0.0;
-    //                 option.series[0].data = [imageU, dbU];
-    //                 myChart.setOption(option);
-
-    //                 if (option.series[0].data.length > 0) {
-    //                     myChart.hideLoading();
-    //                 }
-    //             }
-    //             window.addEventListener('resize', function () {
-    //                 if (myChart) {
-    //                     myChart.resize();
-    //                 }
-    //             });
-    //         }
-    //     };
-    // }]);
+            storageViewModel.getSecondaryDiskInformation()
+        }])
Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.html
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.html	(revision 2354)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.html	(working copy)
@@ -1,128 +1,21 @@
 <div class="row">
     <div class="col-md-12">
-        <div class="col-md-8">
-            <div class="row">
-                <div class="widget">
-                    <div class="widget-header">
-                        <span>{{ 'Storage Clean' | T }}</span>
-                    </div>
-                    <div>
-                        <form class="form-horizontal" name="storageform" unsaved-warning-form>
-                            <div class="form-group">
-                                <label class="control-label col-md-3">{{ 'Scheduled cleaning' | T}}</label>
-                                <div class="col-md-6">
-                                    <input bs-switch class="switch" ng-model="storage.scheduleDetail.schedule" type="checkbox" switch-active="true" resettable>
-                                </div>
-                            </div>
-                            <div class="form-group">
-                                <label class="control-label col-md-3">
-                                    {{ 'Retention duration of Data' | T}}
-                                    <i class="fa fa-info-circle" data-role="popover" data-popover-mode="hover" data-popover-position="top" data-popover-text="{{'Data exceeding the set period will be deleted' | T}}" data-popover-background="bg-cyan" data-popover-color="fg-white"></i>
-                                </label>
-                                <div class="col-md-3" style="display: inline-flex;">
-                                    <input type="number" oninput="if(value>999){value=999}else if(value<1){value=1}" class="form-control" name="duration" ng-model="storage.scheduleDetail.duration" resettable>
-                                    <span style="font-size: 15px; padding: 10px 5px">{{ 'Day' | T}}</span>
-                                </div>
-                            </div>
-                            <div class="form-group">
-                                <label class="control-label col-md-3">
-                                    {{ 'Maximum disk usage' | T}}
-                                    <i class="fa fa-info-circle" data-role="popover" data-popover-mode="hover" data-popover-position="top" data-popover-text="{{'Historical data is deleted when the disk limit is exceeded' | T}}" data-popover-background="bg-cyan" data-popover-color="fg-white"></i>
-                                </label>
-                                <div class="col-md-3" style="display: inline-flex;">
-                                    <input type="number" oninput="if(value>90){value=90}else if(value<50){value=50}" class="form-control" name="percent" ng-model="storage.scheduleDetail.percent" resettable>
-                                    <span style="font-size: 15px; padding: 10px 5px">{{ '%' }}</span>
-                                </div>
-                            </div>
-                            <div class="form-group">
-                                <div class="col-md-offset-3 col-md-6">
-                                    <button ng-show="storageform.$dirty" class="btn btn-primary" ng-click="storage.applyCrontab()">{{ 'Save Changes' | T}}</button>
-                                    <button ng-show="storageform.$dirty" type="reset" class="btn btn-default btn-cancel" ng-click="storageform.$dirty=false;storage.cancel()">{{'Cancel'|T}}</button>
-                                    <button class="btn btn-success" ng-click="storage.cleanup()">{{ 'Clean up immediately' | T}}</button>
-                                </div>
-                            </div>
-                        </form>
-                    </div>
-                </div>
-            </div>
-            <div class="row">
-                <div class="widget">
-                    <div class="widget-header">
-                        <span>{{ 'Storage Management' | T }}</span>
-                    </div>
-                    <div class="table-responsive" ng-if="!storage.detailPage">
-                        <table class="table table-striped table-hover">
-                            <thead>
-                                <tr>
-                                    <th class="name">{{'Module' | T}}</th>
-                                    <th>{{'Disk Usage' | T}}</th>
-                                    <th>{{'Disk Size' | T}}</th>
-                                </tr>
-                            </thead>
-                            <tbody>
-                                <tr ng-repeat="item in storage.moduleList" ng-mouseenter="storage.enter(item)">
-                                    <td style="cursor: pointer;" ng-click="storage.detail(item)"><a>{{ item.name | T}}</a></td>
-                                    <td>
-                                        <div class="col-pb" ng-if="item.sizeStr">
-                                            <div class="progress" title="{{item.usage}}%">
-                                                <div class="progress-bar progress-bar-info" role="progressbar" ng-style="storage.getPercent(item.usage)" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">
-                                                </div>
-                                            </div>
-                                        </div>
-                                        <div class="col-pb" ng-if="!item.sizeStr">
-                                            <i class="fa fa-spinner fa-spin" style="color:#e4701d;"></i>
-                                        </div>
-                                    </td>
-                                    <td>
-                                        <span>{{item.sizeStr}}</span>
-                                    </td>
-                                </tr>
-                            </tbody>
-                        </table>
-                    </div>
-                    <div class="table-responsive" ng-if="storage.detailPage">
-                        <div class="table-toolbar">
-                            <div class="">
-                                <div class="btn-group">
-                                    <button title="{{'Back'|T}}" class="btn btn-link hive_enable_active" ng-click="storage.detailPage = false">
-                                        <i class="fa fa-arrow-left"></i>
-                                    </button>
-                                </div>
-                            </div>
-                        </div>
-                        <table class="table table-striped table-hover" ng-if="!storage.detailloading">
-                            <thead>
-                                <tr>
-                                    <th class="name">{{'Name' | T}}</th>
-                                    <th>{{'Description' | T}}</th>
-                                    <th>{{'Disk Size' | T}}</th>
-                                    <th>{{'Action' | T}}</th>
-                                </tr>
-                            </thead>
-                            <tbody>
-                                <tr ng-repeat="item in storage.detailPaths">
-                                    <td>{{ item.name | T}}</td>
-                                    <td>{{ item.description | T}}</td>
-                                    <td>{{ item.sizeStr }}</td>
-                                    <td ng-if="item.ui_url">
-                                        <a ui-sref="index.{{ item.ui_url }}">{{'View' | T}}</a>
-                                    </td>
-                                </tr>
-                            </tbody>
-                        </table>
-                        <div style="text-align: center" ng-if="storage.detailloading">
-                            <img src="app/images/loading.gif">
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 graph ng-scope">
-            <div class="graph-title">
-                <span>{{storage.diskStatusWidget.title}}</span>
-            </div>
-            <div class="graph-container" disk-usage-pie="storage.diskStatusWidget" style="height: 360px"></div>
-        </div>
+        <ul class="nav nav-tabs">
+            <li role="presentation" ng-class="{ active: url_contain('/storage/log') }">
+                <a ui-sref="index.storage.log">{{ 'Log Location' | T }}</a>
+            </li>
+            <li role="presentation" ng-class="{ active: url_contain('/storage/primary') }">
+                <a ui-sref="index.storage.primary">{{ 'Primary Storage' | T }}</a>
+            </li>
+            <li role="presentation" ng-class="{ active: url_contain('/storage/secondary') }"
+                ng-if="storage.secondaryDisk.isDiskAvailable">
+                <a ui-sref="index.storage.secondary">{{ 'Secondary Storage' | T }}</a>
+            </li>
+        </ul>
     </div>
 </div>
-</div>
\ No newline at end of file
+<div class="content-wrapper">
+    <div class="" ng-show="url_contain('/storage/log')" ui-view="log"></div>
+    <div class="" ng-show="url_contain('/storage/primary')" ui-view="primary"></div>
+    <div class="" ng-show="url_contain('/storage/secondary')" ui-view="secondary"></div>
+</div>
Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.module.js
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.module.js	(revision 2354)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.module.js	(working copy)
@@ -13,7 +13,49 @@
                 }
             },
             ncyBreadcrumb: {
-                label: '{{ "Storage Mangement" | T }}'
+                skip: true
+            }
+        });
+
+        $stateProvider.state('index.storage.log', {
+            url: '^/storage/log',
+            views: {
+                'log@index.storage': {
+                    templateUrl: 'app/modules/storage/log-location/log-location.html',
+                    controller: 'storageLogLocationCtrl',
+                    controllerAs: 'storageLogLocation'
+                }
+            },
+            ncyBreadcrumb: {
+                label: '{{ "Log Location" | T }}'
+            }
+        });
+
+        $stateProvider.state('index.storage.primary', {
+            url: '^/storage/primary',
+            views: {
+                'primary@index.storage': {
+                    templateUrl: 'app/modules/storage/primary/primary-storage.html',
+                    controller: 'primaryStorageCtrl',
+                    controllerAs: 'primaryStorage'
+                }
+            },
+            ncyBreadcrumb: {
+                label: '{{ "Primary Storage" | T }}'
+            }
+        });
+
+        $stateProvider.state('index.storage.secondary', {
+            url: '^/storage/secondary',
+            views: {
+                'secondary@index.storage': {
+                    templateUrl: 'app/modules/storage/secondary/secondary-storage.html',
+                    controller: 'secondaryStorageCtrl',
+                    controllerAs: 'secondaryStorage'
+                }
+            },
+            ncyBreadcrumb: {
+                label: '{{ "Secondary Storage" | T }}'
             }
         });
     }]);
Index: /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.service.js
===================================================================
--- /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.service.js	(revision 2354)
+++ /branches/amp_3_6_0/src/webui/webui/htdocs/new/src/client/app/modules/storage/storage.service.js	(working copy)
@@ -16,10 +16,13 @@
                 getSystemDiskInfo: getSystemDiskInfo,
                 ValueFormat1000: ValueFormat1000,
                 ValueFormat1024: ValueFormat1024,
+                getSecondaryDriveInfo: getSecondaryDriveInfo,
+                getLogLocation: getLogLocation,
+                updateLogLocation: updateLogLocation
             };
 
             function formatBigData(value) {
-                if (value == "") return { 'value': 0, 'unit': "" };
+                if (value == "") return {'value': 0, 'unit': ""};
                 value = parseFloat(value);
                 var size = "";
                 if (value < 0) {
@@ -46,9 +49,9 @@
                 var len = size.indexOf("\.");
                 var dec = size.substr(len + 1, 2);
                 if (dec == "00") {//当小数点后为00时 去掉小数部分
-                    return { 'value': size.substring(0, len) + size.substr(len + 3, 2), 'unit': unit };
+                    return {'value': size.substring(0, len) + size.substr(len + 3, 2), 'unit': unit};
                 }
-                return { 'value': size, 'unit': unit };
+                return {'value': size, 'unit': unit};
             }
 
             // function bigDataFormatter(value) {
@@ -112,6 +115,7 @@
                     }
                     return parseFloat((num / 1e12).toFixed(1)) + 'T';
                 }
+
                 if (value >= 0) {
                     return nFormatter(value);
                 }
@@ -134,6 +138,7 @@
                     }
                     return parseFloat((num / (1024 * 1024 * 1024 * 1024)).toFixed(1)) + 'T';
                 }
+
                 if (value >= 0) {
                     return nFormatter(value);
                 }
@@ -148,8 +153,8 @@
                 return api.post2('/storage/query', post_data);
             }
 
-            function getStorageCrontab() {
-                return api.get('/storage/crontab');
+            function getStorageCrontab(storage='primary') {
+                return api.get('/storage/crontab?storage=' + storage);
             }
 
             function postStorageCrontab(post_data) {
@@ -168,5 +173,20 @@
                 var url = '/api/cm/system/status/Disk/_fields';
                 return api.get(url);
             }
+
+            function getSecondaryDriveInfo() {
+                return api.get('/log/storage?type=secondary')
+            }
+
+            function getLogLocation() {
+                return api.get('/log/location')
+            }
+
+            function updateLogLocation(logLocation) {
+                let post_data = {
+                    "location": logLocation
+                }
+                return api.post2('/log/location', JSON.stringify(post_data))
+            }
         }
     ]);
