🎨 Support configuration of cloud provider connectivity check URL https://github.com/siyuan-note/siyuan/issues/7805

This commit is contained in:
Liang Ding 2023-03-29 14:10:18 +08:00
parent 947e5aad9d
commit 07414dcdc8
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 35 additions and 1 deletions

View file

@ -93,6 +93,11 @@ const renderProvider = (provider: number) => {
<option ${window.siyuan.config.sync.s3.skipTlsVerify ? "" : "selected"} value="false">Verify</option>
<option ${window.siyuan.config.sync.s3.skipTlsVerify ? "selected" : ""} value="true">Skip</option>
</select>
</label>
<label class="b3-label b3-label--noborder fn__flex config__item">
<div class="fn__flex-center fn__size200">Connectivity Check URL</div>
<div class="fn__space"></div>
<input id="checkURL" class="b3-text-field fn__block" value="${window.siyuan.config.sync.s3.checkURL}">
</label>`;
} else if (provider === 3) {
const tip = `<div class="b3-label b3-label--inner">
@ -133,6 +138,11 @@ const renderProvider = (provider: number) => {
<option ${window.siyuan.config.sync.webdav.skipTlsVerify ? "" : "selected"} value="false">Verify</option>
<option ${window.siyuan.config.sync.webdav.skipTlsVerify ? "selected" : ""} value="true">Skip</option>
</select>
</label>
<label class="b3-label b3-label--noborder fn__flex config__item">
<div class="fn__flex-center fn__size200">Connectivity Check URL</div>
<div class="fn__space"></div>
<input id="checkURL" class="b3-text-field fn__block" value="${window.siyuan.config.sync.webdav.checkURL}">
</label>`;
}
return "";
@ -217,6 +227,7 @@ const bindProviderEvent = () => {
region: (providerPanelElement.querySelector("#region") as HTMLInputElement).value,
skipTlsVerify: (providerPanelElement.querySelector("#s3SkipTlsVerify") as HTMLInputElement).value === "true",
timeout: timeout,
checkURL: (providerPanelElement.querySelector("#checkURL") as HTMLInputElement).value,
};
fetchPost("/api/sync/setSyncProviderS3", {s3}, () => {
window.siyuan.config.sync.s3 = s3;
@ -236,6 +247,7 @@ const bindProviderEvent = () => {
password: (providerPanelElement.querySelector("#password") as HTMLInputElement).value,
skipTlsVerify: (providerPanelElement.querySelector("#webdavSkipTlsVerify") as HTMLInputElement).value === "true",
timeout: timeout,
checkURL: (providerPanelElement.querySelector("#checkURL") as HTMLInputElement).value,
};
fetchPost("/api/sync/setSyncProviderWebDAV", {webdav}, () => {
window.siyuan.config.sync.webdav = webdav;

View file

@ -433,6 +433,7 @@ declare interface IConfig {
region: string
skipTlsVerify: boolean
timeout: number
checkURL: string
}
webdav: {
endpoint: string
@ -440,6 +441,7 @@ declare interface IConfig {
password: string
skipTlsVerify: boolean
timeout: number
checkURL: string
}
},
lang: string