mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 13:10:26 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			896 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			896 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
Tea.context(function () {
 | 
						|
	var that = this;
 | 
						|
 | 
						|
	this.success = NotifyPopup
 | 
						|
 | 
						|
	this.selectedType = this.scheduling.code;
 | 
						|
	this.schedulingTypeDescription = null;
 | 
						|
 | 
						|
	this.changeSchedulingType = function () {
 | 
						|
		this.schedulingTypeDescription = this.schedulingTypes.$find(function (k, v) {
 | 
						|
			return v.code == that.selectedType;
 | 
						|
		}).description;
 | 
						|
	};
 | 
						|
	this.changeSchedulingType();
 | 
						|
 | 
						|
	// hash
 | 
						|
	this.hashKey = "";
 | 
						|
	this.hashVar = "";
 | 
						|
	if (this.scheduling.code == "hash") {
 | 
						|
		this.hashKey = this.scheduling.options.key;
 | 
						|
	} else {
 | 
						|
		this.hashKey = "${remoteAddr}";
 | 
						|
	}
 | 
						|
 | 
						|
	this.changeHashVar = function () {
 | 
						|
		if (this.hashVar.length > 0) {
 | 
						|
			this.hashKey = this.hashVar;
 | 
						|
		}
 | 
						|
	};
 | 
						|
 | 
						|
	// sticky
 | 
						|
	if (this.scheduling.code == "sticky") {
 | 
						|
		this.stickyType = this.scheduling.options.type;
 | 
						|
		this.stickyParam = this.scheduling.options.param;
 | 
						|
	} else {
 | 
						|
		this.stickyType = "cookie";
 | 
						|
		this.stickyParam = "Origin";
 | 
						|
	}
 | 
						|
}); |