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: Database beta https://github.com/siyuan-note/siyuan/issues/9242
Daniel30d60d2de868
diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.tsindex d7a34d4772..c7941307e7 100644--- a/app/src/protyle/hint/extend.ts+++ b/app/src/protyle/hint/extend.ts@@ -20,7 +20,7 @@ import {hideElements} from "../ui/hideElements";import {genAssetHTML} from "../../asset/renderAssets";import {unicode2Emoji} from "../../emoji";import {avRender} from "../render/av/render";-import {needSubscribe} from "../../util/needSubscribe";+import {isPaidUser} from "../../util/needSubscribe";export const hintSlash = (key: string, protyle: IProtyle) => {const allList: IHintData[] = [{@@ -48,7 +48,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {value: Constants.ZWSP + 5,html: '<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconSparkles"></use></svg><span class="b3-list-item__text">AI Chat</span></div>',}]- if (!needSubscribe("")) {+ if (isPaidUser()) {allList.push({filter: ["数据库", "属性视图", "shujuku", "shuxingshitu", "sjk", "sxst", "database", "attribute view"],value: '<div data-type="NodeAttributeView" data-av-type="table"></div>',diff --git a/app/src/util/needSubscribe.ts b/app/src/util/needSubscribe.tsindex a7ff60f55b..290481292c 100644--- a/app/src/util/needSubscribe.ts+++ b/app/src/util/needSubscribe.ts@@ -12,7 +12,8 @@ export const needLogin = (tip = window.siyuan.languages.needLogin) => {};export const needSubscribe = (tip = window.siyuan.languages._kernel[29]) => {- if (window.siyuan.user && (window.siyuan.user.userSiYuanProExpireTime === -1 || window.siyuan.user.userSiYuanProExpireTime > 0)) {+ if (window.siyuan.user && (window.siyuan.user.userSiYuanProExpireTime === -1 || window.siyuan.user.userSiYuanProExpireTime > 0) ||+ window.siyuan.user.userSiYuanOneTimePayStatus === 1) {return false;}if (tip) {@@ -27,3 +28,7 @@ export const needSubscribe = (tip = window.siyuan.languages._kernel[29]) => {}return true;};++export const isPaidUser = () => {+ return 0 === window.siyuan.user.userSiYuanSubscriptionStatus || 1 === window.siyuan.user.userSiYuanOneTimePayStatus;+}diff --git a/kernel/model/conf.go b/kernel/model/conf.goindex 565275436d..f3c747e0c8 100644--- a/kernel/model/conf.go+++ b/kernel/model/conf.go@@ -714,12 +714,12 @@ func IsSubscriber() bool {return nil != Conf.User && (-1 == Conf.User.UserSiYuanProExpireTime || 0 < Conf.User.UserSiYuanProExpireTime) && 0 == Conf.User.UserSiYuanSubscriptionStatus}-func IsOneTimePaid() bool {+func IsPaidUser() bool {if IsSubscriber() {return true}return nil != Conf.User // Sign in to use S3/WebDAV data sync https://github.com/siyuan-note/siyuan/issues/8779- // TODO https://github.com/siyuan-note/siyuan/issues/8780+ // TODO S3/WebDAV data sync and backup are available for a fee https://github.com/siyuan-note/siyuan/issues/8780// return nil != Conf.User && 1 == Conf.User.UserSiYuanOneTimePayStatus}diff --git a/kernel/model/repository.go b/kernel/model/repository.goindex a1bc7a9726..c22e6bcb23 100644--- a/kernel/model/repository.go+++ b/kernel/model/repository.go@@ -634,7 +634,7 @@ func DownloadCloudSnapshot(tag, id string) (err error) {return}case conf.ProviderWebDAV, conf.ProviderS3:- if !IsOneTimePaid() {+ if !IsPaidUser() {util.PushErrMsg(Conf.Language(214), 5000)return}@@ -676,7 +676,7 @@ func UploadCloudSnapshot(tag, id string) (err error) {return}case conf.ProviderWebDAV, conf.ProviderS3:- if !IsOneTimePaid() {+ if !IsPaidUser() {util.PushErrMsg(Conf.Language(214), 5000)return}@@ -722,7 +722,7 @@ func RemoveCloudRepoTag(tag string) (err error) {return}case conf.ProviderWebDAV, conf.ProviderS3:- if !IsOneTimePaid() {+ if !IsPaidUser() {util.PushErrMsg(Conf.Language(214), 5000)return}@@ -754,7 +754,7 @@ func GetCloudRepoTagSnapshots() (ret []*dejavu.Log, err error) {return}case conf.ProviderWebDAV, conf.ProviderS3:- if !IsOneTimePaid() {+ if !IsPaidUser() {util.PushErrMsg(Conf.Language(214), 5000)return}@@ -790,7 +790,7 @@ func GetCloudRepoSnapshots(page int) (ret []*dejavu.Log, pageCount, totalCount ireturn}case conf.ProviderWebDAV, conf.ProviderS3:- if !IsOneTimePaid() {+ if !IsPaidUser() {util.PushErrMsg(Conf.Language(214), 5000)return}diff --git a/kernel/model/sync.go b/kernel/model/sync.goindex 75103bf72f..b2af51ea53 100644--- a/kernel/model/sync.go+++ b/kernel/model/sync.go@@ -235,7 +235,7 @@ func checkSync(boot, exit, byHand bool) bool {return false}case conf.ProviderWebDAV, conf.ProviderS3:- if !IsOneTimePaid() {+ if !IsPaidUser() {return false}}