Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:iphone: s3

Vanessa62a5d1a339c5
diff --git a/app/src/config/repos.ts b/app/src/config/repos.ts
index a959781d6e..94d7a01e9b 100644
--- a/app/src/config/repos.ts
+++ b/app/src/config/repos.ts
@@ -67,6 +67,14 @@ const renderProvider = (provider: number) => {
<div>Region</div>
<div class="fn__hr"></div>
<input id="region" class="b3-text-field fn__block" value="${window.siyuan.config.sync.s3.region}">
+</div>
+<div class="b3-label b3-label--noborder">
+ <div>Addressing</div>
+ <div class="fn__hr"></div>
+ <select class="b3-select fn__block" id="pathStyle">
+ <option ${window.siyuan.config.sync.s3.pathStyle ? "selected" : ""} value="${window.siyuan.config.sync.s3.pathStyle}">Path-style</option>
+ <option ${window.siyuan.config.sync.s3.pathStyle ? "selected" : ""} value="${window.siyuan.config.sync.s3.pathStyle}">Virtual-hosted-style</option>
+ </select>
</div>`;
}
return `${tip}
@@ -94,13 +102,21 @@ const renderProvider = (provider: number) => {
<div class="fn__flex-center fn__size200">Region</div>
<div class="fn__space"></div>
<input id="region" class="b3-text-field fn__flex-1" value="${window.siyuan.config.sync.s3.region}">
+</label>
+<label class="b3-label b3-label--noborder fn__flex">
+ <div class="fn__flex-center fn__size200">Addressing</div>
+ <div class="fn__space"></div>
+ <select class="b3-select fn__flex-1" id="pathStyle">
+ <option ${window.siyuan.config.sync.s3.pathStyle ? "selected" : ""} value="${window.siyuan.config.sync.s3.pathStyle}">Path-style</option>
+ <option ${window.siyuan.config.sync.s3.pathStyle ? "selected" : ""} value="${window.siyuan.config.sync.s3.pathStyle}">Virtual-hosted-style</option>
+ </select>
</label>`;
} else if (provider === 3) {
const tip = `<div class="b3-label b3-label--inner">
${window.siyuan.languages.syncThirdPartyProviderWebDAVIntro}
<div class="fn__hr"></div>
${window.siyuan.languages.syncThirdPartyProviderTip}
-</div>`
+</div>`;
if (isMobile()) {
return `${tip}
<div class="b3-label b3-label--noborder">
@@ -200,6 +216,7 @@ const bindProviderEvent = () => {
accessKey: (providerPanelElement.querySelector("#accessKey") as HTMLInputElement).value,
secretKey: (providerPanelElement.querySelector("#secretKey") as HTMLInputElement).value,
bucket: (providerPanelElement.querySelector("#bucket") as HTMLInputElement).value,
+ pathStyle: (providerPanelElement.querySelector("#pathStyle") as HTMLInputElement).value === "true",
region: (providerPanelElement.querySelector("#region") as HTMLInputElement).value,
};
fetchPost("/api/sync/setSyncProviderS3", {s3}, () => {
diff --git a/app/src/mobile/util/menu.ts b/app/src/mobile/util/menu.ts
index 6ff4c525e0..8f1073b994 100644
--- a/app/src/mobile/util/menu.ts
+++ b/app/src/mobile/util/menu.ts
@@ -435,15 +435,13 @@ ${accountHTML}
event.stopPropagation();
break;
} else if (target.id === "menuSync") {
- if (!needSubscribe()) {
- closePanel();
- modelElement.style.top = "0";
- modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconCloud"></use>';
- modelElement.querySelector(".toolbar__text").textContent = window.siyuan.languages.cloud;
- modelMainElement.innerHTML = repos.genHTML();
- repos.element = modelMainElement;
- repos.bindEvent();
- }
+ closePanel();
+ modelElement.style.top = "0";
+ modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconCloud"></use>';
+ modelElement.querySelector(".toolbar__text").textContent = window.siyuan.languages.cloud;
+ modelMainElement.innerHTML = repos.genHTML();
+ repos.element = modelMainElement;
+ repos.bindEvent();
event.preventDefault();
event.stopPropagation();
break;
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index de84989002..154d9bb617 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -335,6 +335,7 @@ declare interface IConfig {
provider: number
s3: {
endpoint: string
+ pathStyle: boolean
accessKey: string
secretKey: string
bucket: string