Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/DNSVirtualService/box_instance_config.html
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/DNSVirtualService/box_instance_config.html	(revision 38606)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/DNSVirtualService/box_instance_config.html	(working copy)
@@ -205,6 +205,7 @@
 
 // The submit action
 box.$el.find('.main-form').submit(function(e){
+    e.preventDefault();
     if(box.changed_fields.length == 0){
         return false;
     }
@@ -246,7 +247,16 @@
         $HIVE.alert('warning',gettext('Please correct these errors'),err_msg,false);
         return false;
     }
-
+    if (typeof post_data["vip"] != "undefined" || typeof post_data["vport"] != "undefined") {
+        $HIVE.confirm2('warning', 'Warning!', "{% trans %}This operation will re-write the virtual service name\nClick \"Yes\" to confirm your operation{% endtrans %}".replace("\n", "<br/>"), false);
+        $(".ok-btn").click(function(){
+            doPostForm(post_data);
+        });
+        return false;
+    }
+    doPostForm(post_data);
+});
+function doPostForm(post_data) {
     progressDlg = $HIVE.progressDlg('{% trans %}Updating...{% endtrans %}');
     progressDlg.showPleaseWait();
     // AJAX post the data to submit, returns [true/false, 'info or error message']
@@ -292,7 +302,7 @@
         return false
     });
     return false;
-});
+}
 $HIVE.set_help_link('{{ MODEL._meta.get_help_link() }}');
 var action_functions = {
     csrf_token:"{{ csrf_token }}",
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/HTTPSVirtualService/box_instance_config.html
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/HTTPSVirtualService/box_instance_config.html	(revision 38606)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/HTTPSVirtualService/box_instance_config.html	(working copy)
@@ -248,6 +248,7 @@
 
 // The submit action
 box.$el.find('.main-form').submit(function(e){
+    e.preventDefault();
     if(box.changed_fields.length == 0){
         return false;
     }
@@ -299,7 +300,16 @@
             }
         }
     }
-
+    if (typeof post_data["vip"] != "undefined" || typeof post_data["vport"] != "undefined") {
+        $HIVE.confirm2('warning', 'Warning!', "{% trans %}This operation will re-write the virtual service name\nClick \"Yes\" to confirm your operation{% endtrans %}".replace("\n", "<br/>"), false);
+        $(".ok-btn").click(function(){
+            doPostForm(post_data);
+        });
+        return false;
+    }
+    doPostForm(post_data);
+});
+function doPostForm(post_data) {
     progressDlg = $HIVE.progressDlg('Updating...');
     progressDlg.showPleaseWait();
     // AJAX post the data to submit, returns [true/false, 'info or error message']
@@ -345,7 +355,7 @@
         return false
     });
     return false;
-});
+}
 $HIVE.set_help_link('{{ MODEL._meta.get_help_link() }}');
 var action_functions = {
     csrf_token:"{{ csrf_token }}",
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/HTTPVirtualService/box_instance_config.html
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/HTTPVirtualService/box_instance_config.html	(revision 38606)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/HTTPVirtualService/box_instance_config.html	(working copy)
@@ -248,6 +248,7 @@
 
 // The submit action
 box.$el.find('.main-form').submit(function(e){
+    e.preventDefault();
     if(box.changed_fields.length == 0){
         return false;
     }
@@ -299,7 +300,16 @@
             }
         }
     }
-
+    if (typeof post_data["vip"] != "undefined" || typeof post_data["vport"] != "undefined") {
+        $HIVE.confirm2('warning', 'Warning!', "{% trans %}This operation will re-write the virtual service name\nClick \"Yes\" to confirm your operation{% endtrans %}".replace("\n", "<br/>"), false);
+        $(".ok-btn").click(function(){
+            doPostForm(post_data);
+        });
+        return false;
+    }
+    doPostForm(post_data);
+});
+function doPostForm(post_data) {
     progressDlg = $HIVE.progressDlg('Updating...');
     progressDlg.showPleaseWait();
     // AJAX post the data to submit, returns [true/false, 'info or error message']
@@ -345,7 +355,7 @@
         return false
     });
     return false;
-});
+}
 $HIVE.set_help_link('{{ MODEL._meta.get_help_link() }}');
 var action_functions = {
     csrf_token:"{{ csrf_token }}",
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/OtherVirtualService/box_instance_config.html
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/OtherVirtualService/box_instance_config.html	(revision 0)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/OtherVirtualService/box_instance_config.html	(working copy)
@@ -0,0 +1,388 @@
+{# Required Context Variables: MODEL, MANAGER, OBJECT #}
+{% extends "box.html" %}
+
+{% block box_content %}
+{% import "widgets/form.html" as form %}
+{% import "widgets/action.html" as Action %}
+{% set field_group=MODEL._meta.field_groups[PARAMS['group_name']] %}
+    <div class="box-header my-header">
+        <div class="box-icon-title">
+            <i class="fa fa-cogs"></i>
+        </div>
+        <h2>
+            {% if MODEL._meta.profile %}
+                {% if not field_group or field_group.name == 'default' %}
+                    {{ MODEL._meta.verbose_name | truncate(30, True) }}
+                {% else %}
+                    {{ MODEL._meta.verbose_name | truncate(30, True) }} - {{ field_group.verbose_name | truncate(30, True) }} 
+                {% endif %}
+            {% else %}
+                {% if field_group %}
+                    {{ OBJECT.repr() | truncate(30, True) }} - {{ field_group.verbose_name | truncate(30, True) }}  
+                {% else %}
+                    {{ OBJECT.repr() | truncate(30, True) }}
+                {% endif %}
+            {% endif %}
+        </h2>
+    </div>
+    <div class="box-content">
+    <form class="form-horizontal main-form">
+            <script type="text/javascript">
+            var js_hook_{{ id|jsvar }} = new Object();
+            js_hook_{{ id|jsvar }}.id = "{{ id|jsvar}}";
+            js_hook_{{ id|jsvar }}.form_fields = {};
+            js_hook_{{ id|jsvar }}.ready_total = 0;
+            js_hook_{{ id|jsvar }}.ready_count = 0;
+            </script>
+            {% if field_group %}
+            <div class="row-fluid">
+                <div class="span12 with-min-width field-group-box">
+                    <fieldset>
+                    <div class="group_actions" >
+                    {% for action in field_group.related_actions(OBJECT) if not (SESSION.is_segment_user and action.seg_hidden) %}
+                        {{ Action.ActionWidget(action.name, action) }}
+                    {% endfor %}
+                    </div>
+                    {% for field in field_group.fields if field.visible_in_edit() and not field.is_external_component() and not (SESSION.is_segment_user and field.seg_hidden) and not (field.is_unprivileged and SESSION.is_unprivileged_role) %}
+                        {% set context_of_field = (PARAMS.get("context", {})|url2obj).get(field.name, None) %}
+                        {% if context_of_field != None %}
+                            {{ field.static_widget(manager=MANAGER, context_value=context_of_field[0], context_repr=context_of_field[1]).render(form, 'js_hook_'+id|jsvar, {'form':form, 'csrf_token':csrf_token}) }}
+                        {% else %}
+                            {{ field.default_widget(editable=field.editable, model_instance=OBJECT, manager=MANAGER).render(form, 'js_hook_'+id|jsvar, {'form':form, 'csrf_token':csrf_token, 'session':SESSION}) }}
+                        {% endif %}
+                    {% endfor %}
+                    </fieldset>
+            	</div>
+            </div><!-- row-fluid -->
+            {% else %}
+            {% set group_num=MODEL._meta.field_groups|length %}
+            {% for group_name, each_field_group in MODEL._meta.field_groups.iteritems() if each_field_group.visible_in_edit(OBJECT) and not (SESSION.is_segment_user and each_field_group.seg_hidden) %}
+            {% set has_fields={"bool":false} %}
+            {% for field in each_field_group.fields if field.visible_in_edit() and not field.hide_in_popup_edit and not field.is_external_component() and not (SESSION.is_segment_user and field.seg_hidden) %}
+                 {% if field.name %}
+                     {% if has_fields.update({"bool":true}) %}{% endif %}
+                 {% endif %}
+            {% endfor %}
+            <div class="row-fluid">
+                <div class="span12 with-min-width field-group-box">
+                    {% if each_field_group.verbose_name and group_num > 1 %}
+                    <a id="{{ each_field_group.name }}"></a>
+                    {% if has_fields.bool %}
+            	        <legend>{{ each_field_group.verbose_name }}</legend>
+                    {% endif %}
+            	    {% endif %}
+                    <fieldset>
+                    <div class="group_actions_{{ group_name }}" >
+                    {% for action in each_field_group.related_actions(OBJECT) %}
+                        {% if not action.edit_hidden %}
+                            {{ Action.ActionWidget(action.name, action) }}
+                        {% endif %}
+                    {% endfor %}
+                    </div>
+                    {% for field in each_field_group.fields if field.visible_in_edit() and not field.hide_in_popup_edit and not field.is_external_component() and not (SESSION.is_segment_user and field.seg_hidden) %}
+                        {% set context_of_field = (PARAMS.get("context", {})|url2obj).get(field.name, None) %}
+                        {% if context_of_field != None %}
+                            {{ field.static_widget(manager=MANAGER, context_value=context_of_field[0], context_repr=context_of_field[1]).render(form, 'js_hook_'+id|jsvar, {'form':form, 'csrf_token':csrf_token}) }}
+                        {% else %}
+                            {{ field.default_widget(editable=field.editable, model_instance=OBJECT, manager=MANAGER).render(form, 'js_hook_'+id|jsvar, {'form':form, 'csrf_token':csrf_token,'session':SESSION}) }}
+                        {% endif %}
+                    {% endfor %}
+                    </fieldset>
+            	</div>
+            </div><!-- row-fluid -->
+            {% endfor %}
+            {% endif %}
+            <div class="btn-static" style="display:none;">
+                <div class="btn-switch">
+                    <button type="submit" class="btn btn-action">{% trans %}Save Changes{% endtrans %}</button>
+                    <button type="button" class="btn btn-default btn-cancel">{% trans %}Cancel{% endtrans %}</button>
+                </div>
+            </div>
+    </form>
+    </div><!-- box-content -->
+{% endblock box_content %}
+
+{% block box_script %}
+{% if 0 %}
+<script type="text/javascript">
+// Just make editor happy to highlight the scripts
+{% endif %}
+
+{% set field_group=MODEL._meta.field_groups[PARAMS['group_name']] %}
+
+var field_group_dict = {{ MODEL._meta.get_field_group_dict()|json_dumps }};
+var group_condition_dict = {{ MODEL._meta.get_group_condition_dict()|json_dumps }};
+var field_condition_dict = {{ MODEL._meta.get_field_condition_dict()|json_dumps }};
+// copy the hook's data into box
+var hook = js_hook_{{ id|jsvar }};
+var title_id = hook['id'].replace(/_/g,'-');
+var Title = $("#" + title_id).find(".box-header.my-header").find("h2").text();
+var sTitle = Title.trim();
+var arr = [];
+
+box.form_fields = hook.form_fields;
+require(['widget-form'], function(form){
+    form.on_ready(js_hook_{{id|jsvar}}, function(){
+        {% if field_group %}
+        var obj_data = $.parseJSON(window.atob("{{ OBJECT.get_field_dict(serialize=True, group=PARAMS["group_name"])|b64encode }}"));
+        {% else %}
+        var obj_data = $.parseJSON(window.atob("{{ OBJECT.get_field_dict(serialize=True, visible_edit_only=True)|b64encode }}"));
+        {% endif %}
+        $.each(box.form_fields, function(field_name, field_widget){
+            if (field_name in obj_data) {
+                field_widget.set_value(obj_data[field_name]);
+            } else {
+                field_widget.hide(); // CONDITIONAL_NONE
+            }
+        });
+   
+        //show the title and input in hover if too long.
+        if (sTitle.length > 94) {
+            sTitle = sTitle.substring(0,92)+"...";
+            $("#" + title_id).find(".box-header.my-header").find("h2").text(sTitle);
+            $("#" + title_id).find(".box-header.my-header").find("h2").parent().popover({
+                trigger: "hover",
+                content: '<div id="title-content">'+Title.trim()+'</div>',
+                placement: "bottom",
+                html: true 
+            });
+        }
+
+        try{
+            var len = $("#" + title_id).find(".box-content").find(".textinput").length;
+            for(var index = 0; index < len; index++){
+                arr[index] = index;
+            }
+            $.each(arr, function(i,val){
+                if ($("#" + title_id).find(".box-content").find(".textinput").eq(i).css('display') == 'none' || $("#" + title_id).find(".box-content").find(".textinput").eq(i).parent().hasClass("union-content")){			
+                    return true;
+                }
+                else if($("#" + title_id).find(".box-content").find(".textinput").eq(i).find("input").attr("disabled")){
+                    var idValue = $("#" + title_id).find(".box-content").find(".textinput").eq(i).find("input").attr("id");
+                    if ($("#" + title_id).find(".box-content").find(".textinput").eq(i).hasClass("style-default") || $("#" + title_id).find(".box-content").find(".textinput").eq(i).hasClass("style-None")) { 
+                        if(obj_data[idValue.split('textinput_')[1]].length > 30){
+                            $("#" + title_id).find(".box-content").find("."+idValue).popover({
+                                trigger: "hover",
+                                content: '<div id="input-content">'+obj_data[idValue.split('textinput_')[1]].trim()+'</div>',
+                                placement: "bottom",
+                                html: true
+                            });
+                        }
+                    }
+                }
+            });
+        }catch (e) {
+            console.log(e);
+        }
+        
+        // XXX Listen to all the widgets' form:changed event
+        box.changed_fields = []
+        $HIVE.check_form_condition(box, field_group_dict, group_condition_dict, field_condition_dict);
+        $.each(box.form_fields, function(key,value){
+            box.listenTo(value, "form:changed", function(){
+                $HIVE.check_form_condition(box, field_group_dict, group_condition_dict, field_condition_dict);
+                if (_.indexOf(box.changed_fields, value) == -1) {
+                    box.changed_fields.push(value)
+                }
+                box.$el.find(".btn-static").fadeIn("slow"); 
+                if ($(".btn-static").is(":visible")) {
+                    var buttonH = $(".btn-static").offset().top;  
+                    $(function(){ 
+                        $(window).scroll(function(){ 
+                            var scrollH = $(this).scrollTop();  
+                            if (scrollH >= buttonH) {
+                                $(".btn-switch").addClass("btn-fixed");
+                            }else{  
+                                $(".btn-switch").removeClass("btn-fixed");
+                            } 
+                        });
+                    });
+                }
+            });
+            box.listenTo(value, "form:refreshpage", function(){
+                console.log("some widget ask refresh page");
+                box.trigger("box:switch", box.url);
+            });
+        });
+    });
+});
+
+// The cancel action
+box.$el.find(".btn-cancel").click(function(){
+    box.trigger("box:cancel");
+    return false
+});
+
+
+
+function isShowSNMPReminder (){
+    // return true, if this rendered view is /System/Admin Tools/SNMP and the setting is not recommand Level
+    // return false, others
+    // selected element
+    let possibleElements = $(`ul[role=menu]>li[rel].selected`).get()
+    if (possibleElements.length==0){
+        // not SNMP setting submit
+        return false
+    }
+    const snmpTrapLevelSearchKey = ":"
+    let selectedLevelE = possibleElements.filter((e)=>{
+        return e.innerText.includes(snmpTrapLevelSearchKey)
+    })
+    if (typeof(selectedLevelE[0]) == 'undefined') {
+        return false
+    }
+    // based on recommandLevel, decide pop up reminder or not
+    const recommandedLevelList = ['0', '1', '2', '3']
+    let isRecommandLevels = false
+    for (let i=0;i<recommandedLevelList.length; i++){
+        if (selectedLevelE[0].innerText.includes(recommandedLevelList[i])){
+            isRecommandLevels = true
+            break
+        }
+    }
+    return !isRecommandLevels
+}
+
+// The submit action
+box.$el.find('.main-form').submit(function(e){
+    e.preventDefault();
+    if(isShowSNMPReminder()){
+        // based on isRecommandLevels and isConfirmChange to confirm save change
+        let reminder = 'Configuring SNMP Trap Level other than "Error" is not recommended and it might impact on the performance.'
+        let isConfirmChange = confirm(reminder);
+        if(!isConfirmChange){
+            // not save the cuurent state
+            return
+        }
+    }
+
+    if(box.changed_fields.length == 0){
+        return false;
+    }
+    {%if not SESSION.allow_config %}
+        $HIVE.alert('error','Config Mode Entrance Denied', 'You are enable user, not allowed to change the configuration of APV');
+        box.trigger("box:cancel");
+        return false;
+    {% endif%}
+    var err = false;
+    var err_msg = '';
+    var post_data = {};
+    try {
+        // only submit the changed fields
+        $.each(box.changed_fields, function(key,value){
+            if (value.is_hidden()) {
+                return; // continue
+            }
+            if (value['validate'] != undefined) {
+                validate_result = value['validate']();
+                if (!validate_result[0]) {
+                    err = true;
+                    err_msg += '<b>' + value['label'] + '</b> -- ' + validate_result[1] + '<br />';
+                }
+            }
+            if (value['validate_on_blur'] != undefined) {
+                validate_result = value['validate_on_blur']();
+                if (!validate_result[0]) {
+                    err = true;
+                    err_msg += '<b>' + value['label'] + '</b> -- ' + validate_result[1] + '<br />';
+                }
+            }
+            post_data[value['name']] = value.get_value();
+        });
+    } catch (e) {
+        console.log(e);
+        return false;
+    }
+    if (err) {
+        $HIVE.alert('warning',gettext('Please correct these errors'),err_msg,false);
+        return false;
+    }
+    if (typeof post_data["vip"] != "undefined" || typeof post_data["vport"] != "undefined") {
+        $HIVE.confirm2('warning', 'Warning!', "{% trans %}This operation will re-write the virtual service name\nClick \"Yes\" to confirm your operation{% endtrans %}".replace("\n", "<br/>"), false);
+        $(".ok-btn").click(function(){
+            doPostForm(post_data);
+        });
+        return false;
+    }
+    doPostForm(post_data);
+});
+function doPostForm(post_data) {
+    progressDlg = $HIVE.progressDlg('{% trans %}Updating...{% endtrans %}');
+    progressDlg.showPleaseWait();
+    // AJAX post the data to submit, returns [true/false, 'info or error message']
+    var submit_url = '{{ OBJECT.get_ajax_url('update') }}';
+
+    $.post(submit_url, {'post_data':JSON.stringify(post_data),'csrfmiddlewaretoken':'{{ csrf_token }}'}, function(data){
+        try {
+            if (data[0] === true) {
+		        progressDlg.hidePleaseWait();
+                var dict_name = {'info':gettext('Info'), 'warning':gettext('Warning')}
+                if (data[2] !== []) {
+                    for (i = 0; i < data[2].length; i++) {
+                        $HIVE.alert(data[2][i][0], dict_name[data[2][i][0]], data[2][i][1])
+                    }
+                }
+                // Refresh the page
+                {% if field_group %}
+                    var group_arg = "?group_name={{ PARAMS['group_name'] }}";
+                {% else %}
+                    var group_arg = "?";
+                {% endif %}
+                {% if PARAMS and 'standalone' in PARAMS %}
+                window.location.href = "{{ REQUEST.path.split('/')[-1]|escape_url }}" + group_arg + "&standalone=True";
+        		{% else %}
+                box.trigger("box:finish", "{{ OBJECT.get_ajax_url('box_instance_config')}}" + group_arg);
+        		{% endif %}
+            } else {
+		        progressDlg.hidePleaseWait();
+                $HIVE.alert('error','{{ OBJECT.repr()|e }} {% trans %}Update Error{% endtrans %}', data[1]);
+                return false;
+            }
+        } catch (e) {
+            $HIVE.alert('error', 'Fatal Error', 'Invalid response from server');
+            return false;
+        } 
+    }, "json").fail(function(){
+        progressDlg.hidePleaseWait();
+        if (_.has(post_data, 'enable_webui') && !(post_data.enable_webui)) {
+            $HIVE.alert('warning','warning','WebUI has been disabled. Your current WebUI session is terminated.');
+        }else{
+            $HIVE.alert('error','Fatal Error','Fail sending data to server');
+        }
+        return false
+    });
+    return false;
+}
+$HIVE.set_help_link('{{ MODEL._meta.get_help_link() }}');
+var action_functions = {
+    csrf_token:"{{ csrf_token }}",
+    allow_config:{% if not SESSION.allow_config %} false {% else %} true {% endif%},
+    popup_cb: function(args){
+        var rsp = args;
+        if (rsp[1]['config_change']) {
+            // need refresh the page
+            console.log("action finish, need refresh page");
+            box.trigger("box:switch", box.url);
+        } else {
+            //seems no need to do
+        }
+    },
+    get_data: function(){
+        data = {
+            '__pk_list':['{{ OBJECT.pk_str()|escape_url }}']
+        };
+        return data;
+    },
+};
+{% if field_group %}
+init_action('group_actions', action_functions);
+{% else %}
+    {% set group_num=MODEL._meta.field_groups|length %}
+    {% for group_name, each_field_group in MODEL._meta.field_groups.iteritems() if each_field_group.visible_in_edit(OBJECT) and not (SESSION.is_segment_user and each_field_group.seg_hidden) %}
+init_action('group_actions_{{ group_name }}' , action_functions);
+    {% endfor %}
+{% endif %}
+{% if 0 %}
+</script>
+{% endif %}
+{% endblock %}
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/TCPSVirtualService/box_instance_config.html
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/TCPSVirtualService/box_instance_config.html	(revision 38606)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/TCPSVirtualService/box_instance_config.html	(working copy)
@@ -248,6 +248,7 @@
 
 // The submit action
 box.$el.find('.main-form').submit(function(e){
+    e.preventDefault();
     if(box.changed_fields.length == 0){
         return false;
     }
@@ -299,7 +300,16 @@
             }
         }
     }
-
+    if (typeof post_data["vip"] != "undefined" || typeof post_data["vport"] != "undefined") {
+        $HIVE.confirm2('warning', 'Warning!', "{% trans %}This operation will re-write the virtual service name\nClick \"Yes\" to confirm your operation{% endtrans %}".replace("\n", "<br/>"), false);
+        $(".ok-btn").click(function(){
+            doPostForm(post_data);
+        });
+        return false;
+    }
+    doPostForm(post_data);
+});
+function doPostForm(post_data) {
     progressDlg = $HIVE.progressDlg('Updating...');
     progressDlg.showPleaseWait();
     // AJAX post the data to submit, returns [true/false, 'info or error message']
@@ -345,7 +355,7 @@
         return false
     });
     return false;
-});
+}
 $HIVE.set_help_link('{{ MODEL._meta.get_help_link() }}');
 var action_functions = {
     csrf_token:"{{ csrf_token }}",
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/TCPVirtualService/box_instance_config.html
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/TCPVirtualService/box_instance_config.html	(revision 38606)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/TCPVirtualService/box_instance_config.html	(working copy)
@@ -248,6 +248,7 @@
 
 // The submit action
 box.$el.find('.main-form').submit(function(e){
+    e.preventDefault();
     if(box.changed_fields.length == 0){
         return false;
     }
@@ -299,7 +300,16 @@
             }
         }
     }
-    
+    if (typeof post_data["vip"] != "undefined" || typeof post_data["vport"] != "undefined") {
+        $HIVE.confirm2('warning', 'Warning!', "{% trans %}This operation will re-write the virtual service name\nClick \"Yes\" to confirm your operation{% endtrans %}".replace("\n", "<br/>"), false);
+        $(".ok-btn").click(function(){
+            doPostForm(post_data);
+        });
+        return false;
+    }
+    doPostForm(post_data);
+});
+function doPostForm(post_data) {
     progressDlg = $HIVE.progressDlg('Updating...');
     progressDlg.showPleaseWait();
     // AJAX post the data to submit, returns [true/false, 'info or error message']
@@ -345,7 +355,7 @@
         return false
     });
     return false;
-});
+}
 $HIVE.set_help_link('{{ MODEL._meta.get_help_link() }}');
 var action_functions = {
     csrf_token:"{{ csrf_token }}",
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/UDPVirtualService/box_instance_config.html
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/UDPVirtualService/box_instance_config.html	(revision 38606)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/loadbalancing/slb/vs/protocols/UDPVirtualService/box_instance_config.html	(working copy)
@@ -248,6 +248,7 @@
 
 // The submit action
 box.$el.find('.main-form').submit(function(e){
+    e.preventDefault();
     if(box.changed_fields.length == 0){
         return false;
     }
@@ -299,7 +300,16 @@
             }
         }
     }
-
+    if (typeof post_data["vip"] != "undefined" || typeof post_data["vport"] != "undefined") {
+        $HIVE.confirm2('warning', 'Warning!', "{% trans %}This operation will re-write the virtual service name\nClick \"Yes\" to confirm your operation{% endtrans %}".replace("\n", "<br/>"), false);
+        $(".ok-btn").click(function(){
+            doPostForm(post_data);
+        });
+        return false;
+    }
+    doPostForm(post_data);
+});
+function doPostForm(post_data) {
     progressDlg = $HIVE.progressDlg('Updating...');
     progressDlg.showPleaseWait();
     // AJAX post the data to submit, returns [true/false, 'info or error message']
@@ -345,7 +355,7 @@
         return false
     });
     return false;
-});
+}
 $HIVE.set_help_link('{{ MODEL._meta.get_help_link() }}');
 var action_functions = {
     csrf_token:"{{ csrf_token }}",
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/hive/model/ajax.py
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/hive/model/ajax.py	(revision 38606)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/hive/model/ajax.py	(working copy)
@@ -1202,6 +1202,8 @@
         except TemplateNotFound:
             if group_basic:
                 template = env.get_template('/box_' + sub_action + '_group.html')
+            elif 'loadbalancing/slb/vs/protocols/' in self.request.path and sub_action == "instance_config":
+                template = env.get_template('loadbalancing/slb/vs/protocols/OtherVirtualService/box_instance_config.html')
             else:
                 template = env.get_template('/box_' + sub_action + '.html')
         ctx = {'REQUEST':self.request, 'SESSION':self.session, 'MEDIA':'/media/',
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/media/js/coffee/hive.coffee
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/media/js/coffee/hive.coffee	(revision 38606)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/media/js/coffee/hive.coffee	(working copy)
@@ -132,6 +132,35 @@
 $HIVE.confirm = (msg) ->
     return window.confirm(msg)
 
+$HIVE.confirm2 = (type, title, msg, transferred = true) ->
+  type_to_sign =
+    warning: "fa-warning"
+    error: "fa-warning"
+    info: "fa-info-circle"
+  id = $HIVE.alertcount++
+  if transferred
+      msg = $HIVE.str_html_protect(msg)
+  template = [
+    "<div id=\"ALERT" + id + "\" class=\"modal modal-alert " + type + "\" tabindex=\"-1\" data-width=\"460\">\t\t",
+      "<div class=\"modal-dialog\">",
+        "<div class=\"modal-content\">",
+          "<div class=\"modal-header\">",
+            "<h6><i class=\"fa " + type_to_sign[type] + "\"></i>&nbsp;&nbsp;" + title + "</h6>",
+          "</div>",
+          "<div class=\"modal-body\">",
+            msg,
+          "</div>",
+          "<div class=\"modal-footer\">",
+            "<button type=\"button\" data-dismiss=\"modal\" class=\"btn btn-action ok-btn\">Yes</button>",
+            "<button type=\"button\" data-dismiss=\"modal\" class=\"btn btn-default\">No</button>",
+          "</div>",
+        "</div>",
+      "</div>",
+    "</div>"
+  ].join("")
+  $("body").append $(template)
+  $("#ALERT" + id).modal()
+
 $HIVE.progressDlg = (title) ->
     title = $HIVE.str_html_protect(title)
     pleaseWaitDiv = $("""
