An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Change `Search asset content` and `Add watermark to exported PDF or image` from paid features to free features
Daniel86431cc106fc
diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.tsindex 3737e3d8d6..81cb941cc1 100644--- a/app/src/protyle/export/index.ts+++ b/app/src/protyle/export/index.ts@@ -12,8 +12,6 @@ import {fetchPost, fetchSyncPost} from "../../util/fetch";import {Dialog} from "../../dialog";import {replaceLocalPath} from "../../editor/rename";import {setStorageVal} from "../util/compatibility";-import {isPaidUser} from "../../util/needSubscribe";-import {getCloudURL} from "../../config/util/about";import {getFrontend} from "../../util/functions";const getPluginStyle = async () => {@@ -269,7 +267,6 @@ const renderPDF = async (id: string) => {</div><span class="fn__hr"></span><input id="watermark" class="b3-switch" type="checkbox" ${localData.watermark ? "checked" : ""}>- <div style="display:none;font-size: 12px;margin-top: 12px;color: var(--b3-theme-on-surface);">${window.siyuan.languages._kernel[214].replaceAll("${accountServer}", getCloudURL(""))}</div></label></div><div class="fn__flex" style="padding: 0 16px">@@ -477,12 +474,6 @@ const renderPDF = async (id: string) => {refreshPreview();});const watermarkElement = actionElement.querySelector('#watermark');- watermarkElement.addEventListener('change', () => {- if (watermarkElement.checked && ${!isPaidUser()}) {- watermarkElement.nextElementSibling.style.display = "";- watermarkElement.checked = false;- }- });const refreshPreview = () => {previewElement.innerHTML = '<div class="fn__loading" style="left:0;height: 100vh"><img width="48px" src="${servePath}/stage/loading-pure.svg"></div>'fetchPost("/api/export/exportPreviewHTML", {diff --git a/app/src/protyle/export/util.ts b/app/src/protyle/export/util.tsindex 69ed4e2486..ab2ccdfa5d 100644--- a/app/src/protyle/export/util.ts+++ b/app/src/protyle/export/util.ts@@ -12,8 +12,6 @@ import {highlightRender} from "../render/highlightRender";import {processRender} from "../util/processCode";import {isIPhone, isSafari, openByMobile, setStorageVal} from "../util/compatibility";import {useShell} from "../../util/pathName";-import {isPaidUser} from "../../util/needSubscribe";-import {getCloudURL} from "../../config/util/about";export const afterExport = (exportPath: string, msgId: string) => {/// #if !BROWSER@@ -121,16 +119,9 @@ export const exportImage = (id: string) => {const watermarkElement = (exportDialog.element.querySelector("#watermark") as HTMLInputElement);watermarkElement.addEventListener("change", () => {window.siyuan.storage[Constants.LOCAL_EXPORTIMG].watermark = watermarkElement.checked;- if (watermarkElement.checked && !isPaidUser()) {- watermarkElement.checked = false;- showMessage(window.siyuan.languages._kernel[214].replaceAll("${accountServer}", getCloudURL("")));- }updateWatermark();});const updateWatermark = () => {- if (!isPaidUser()) {- return;- }const watermarkPreviewElement = exportDialog.element.querySelector(".export-img__watermark") as HTMLElement;watermarkPreviewElement.innerHTML = "";if (watermarkElement.checked) {diff --git a/app/src/search/assets.ts b/app/src/search/assets.tsindex d754cc54b2..01540c4db2 100644--- a/app/src/search/assets.ts+++ b/app/src/search/assets.ts@@ -8,10 +8,7 @@ import {genQueryHTML} from "./util";import {MenuItem} from "../menus/Menu";import {Dialog} from "../dialog";import {addClearButton} from "../util/addClearButton";-import {isPaidUser} from "../util/needSubscribe";-import {showMessage} from "../dialog/message";import {saveAssetKeyList} from "./toggleHistory";-import {getCloudURL} from "../config/util/about";export const openSearchAsset = (element: HTMLElement, isStick: boolean) => {/// #if !MOBILE@@ -165,15 +162,6 @@ export const openSearchAsset = (element: HTMLElement, isStick: boolean) => {let inputTimeout: number;export const assetInputEvent = (element: Element, localSearch?: ISearchAssetOption, page = 1) => {const loadingElement = element.parentElement.querySelector(".fn__loading--top");- if (!isPaidUser()) {- loadingElement.classList.add("fn__none");- element.querySelector(".search__drag")?.classList.add("fn__none");- element.querySelector("#searchAssetPreview").classList.add("fn__none");- element.querySelector("#searchAssetList").innerHTML = `<div class="search__empty">- ${window.siyuan.languages["_kernel"][214].replaceAll("${accountServer}", getCloudURL(""))}-</div>`;- return;- }loadingElement.classList.remove("fn__none");clearTimeout(inputTimeout);inputTimeout = window.setTimeout(() => {@@ -449,10 +437,6 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)iconHTML: "",label: window.siyuan.languages.rebuildIndex,click() {- if (!isPaidUser()) {- showMessage(window.siyuan.languages["_kernel"][214].replaceAll("${accountServer}", getCloudURL("")));- return;- }element.parentElement.querySelector(".fn__loading--top").classList.remove("fn__none");fetchPost("/api/asset/fullReindexAssetContent", {}, () => {assetInputEvent(element, localData);diff --git a/kernel/api/search.go b/kernel/api/search.goindex 0ea003394a..39786db3c9 100644--- a/kernel/api/search.go+++ b/kernel/api/search.go@@ -88,11 +88,6 @@ func fullTextSearchAssetContent(c *gin.Context) {return}- if !model.IsPaidUser() {- ret.Code = 1- return- }-page, pageSize, query, types, method, orderBy := parseSearchAssetContentArgs(arg)assetContents, matchedAssetCount, pageCount := model.FullTextSearchAssetContent(query, types, method, orderBy, page, pageSize)ret.Data = map[string]interface{}{diff --git a/kernel/model/export.go b/kernel/model/export.goindex a0c9716efc..d5e2f87c12 100644--- a/kernel/model/export.go+++ b/kernel/model/export.go@@ -1110,10 +1110,6 @@ func processPDFWatermark(pdfCtx *model.Context, watermark bool) {return}- if !IsPaidUser() {- return- }-mode := "text"if gulu.File.IsExist(str) {if ".pdf" == strings.ToLower(filepath.Ext(str)) {