Multiple HTTPS certificate support

This commit is contained in:
刘河
2019-03-30 12:03:17 +08:00
parent 5fd335f330
commit 2b841adb1b
16 changed files with 560 additions and 111 deletions

View File

@@ -22,13 +22,29 @@
<div class="form-group" id="scheme">
<label class="control-label col-sm-2" langtag="info-scheme">协议类型</label>
<div class="col-sm-10">
<select class="form-control" name="scheme">
<select id="scheme_select" class="form-control" name="scheme">
<option {{if eq "all" .h.Scheme}}selected{{end}} value="all">all</option>
<option {{if eq "http" .h.Scheme}}selected{{end}} value="http">http</option>
<option {{if eq "https" .h.Scheme}}selected{{end}} value="https">https</option>
</select>
</div>
</div>
{{if eq false .https_just_proxy}}
<div class="form-group" id="cert_file">
<label class="col-sm-2 control-label" langtag="info-https-cert">https cert file路径</label>
<div class="col-sm-10">
<input value="{{.h.CertFilePath}}" class="form-control" type="text" name="cert_file_path"
placeholder="empty means to be unrestricted">
</div>
</div>
<div class="form-group" id="key_file">
<label class="col-sm-2 control-label" langtag="info-https-key">https key file路径</label>
<div class="col-sm-10">
<input value="{{.h.KeyFilePath}}" class="form-control" type="text" name="key_file_path"
placeholder="empty means to be unrestricted">
</div>
</div>
{{end}}
<div class="form-group">
<label class="col-sm-2 control-label" langtag="info-url-router">url路由</label>
<div class="col-sm-10">
@@ -99,5 +115,15 @@
}
})
})
$("#scheme_select").on("change", function () {
if ($("#scheme_select").val() == "all" || $("#scheme_select").val() == "https") {
$("#cert_file").css("display", "block")
$("#key_file").css("display", "block")
} else {
$("#cert_file").css("display", "none")
$("#key_file").css("display", "none")
}
})
})
</script>