{"size": 1640, "ext": "js", "max_stars_repo_path": "dms/web/static/t_js/Web_Config/config.js", "max_stars_repo_name": "zhmsg/dms", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dms/web/static/t_js/Web_Config/config.js", "max_issues_repo_name": "zhmsg/dms", "max_issues_repo_issues_event_min_datetime": "2015-09-18T01:19:28.000Z", "max_issues_repo_issues_event_max_datetime": "2021-12-13T19:51:10.000Z", "max_forks_repo_path": "dms/web/static/t_js/Web_Config/config.js", "max_forks_repo_name": "zhmsg/dms", "max_forks_repo_forks_event_min_datetime": "2017-06-30T08:11:10.000Z", "max_forks_repo_forks_event_max_datetime": "2017-06-30T08:11:10.000Z"}
{"max_stars_count": null, "max_issues_count": 12, "max_forks_count": 1, "avg_line_length": 28.7719298246, "max_line_length": 91, "alphanum_fraction": 0.4487804878}
/**
 * Created by zhouhenglc on 2019/11/20.
 */

var config_vm = null;

$(function(){
    var o_keys = UrlArgsValue(location.href, "keys");
    if(o_keys == null){
        var keys = [];
    }
    else{
        var keys = o_keys.split(",");
    }
    var config_keys = {};
    for(var index in keys){
        config_keys[keys[index]] = {'value': ''}
    }
    var values_url = "/config/values";
    my_request2(values_url, "GET", {'keys': o_keys}, function (data) {
        for(var key in data){
            var value = data[key];
            if(value != null){
                config_keys[key]['origin_value'] = value.config_value;
                config_keys[key]['value'] = value.config_value;
            }
        }
    });
    config_vm = new Vue({
        el: "#div_config",
        data: {
            config_keys: config_keys
        },
        methods: {
            submit_action: function(){
                var data = {};
                var has_update = false;
                for(var key in this.config_keys){
                    if(this.config_keys[key].value != this.config_keys[key].origin_value) {
                        data[key] = this.config_keys[key].value;
                        has_update = true;
                    }
                }
                console.info(data);
                if(has_update == false){
                    alert1("无更新无需提交");
                    return false;
                }
                my_async_request2(values_url, 'POST', data, function(data){
                    alert1("更新成功！");
                    location.reload();
                })
            }
        }
    });

});