mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Database beta https://github.com/siyuan-note/siyuan/issues/9242
This commit is contained in:
parent
7923cca130
commit
30d60d2de8
5 changed files with 16 additions and 11 deletions
|
|
@ -20,7 +20,7 @@ import {hideElements} from "../ui/hideElements";
|
||||||
import {genAssetHTML} from "../../asset/renderAssets";
|
import {genAssetHTML} from "../../asset/renderAssets";
|
||||||
import {unicode2Emoji} from "../../emoji";
|
import {unicode2Emoji} from "../../emoji";
|
||||||
import {avRender} from "../render/av/render";
|
import {avRender} from "../render/av/render";
|
||||||
import {needSubscribe} from "../../util/needSubscribe";
|
import {isPaidUser} from "../../util/needSubscribe";
|
||||||
|
|
||||||
export const hintSlash = (key: string, protyle: IProtyle) => {
|
export const hintSlash = (key: string, protyle: IProtyle) => {
|
||||||
const allList: IHintData[] = [{
|
const allList: IHintData[] = [{
|
||||||
|
|
@ -48,7 +48,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
|
||||||
value: Constants.ZWSP + 5,
|
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>',
|
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({
|
allList.push({
|
||||||
filter: ["数据库", "属性视图", "shujuku", "shuxingshitu", "sjk", "sxst", "database", "attribute view"],
|
filter: ["数据库", "属性视图", "shujuku", "shuxingshitu", "sjk", "sxst", "database", "attribute view"],
|
||||||
value: '<div data-type="NodeAttributeView" data-av-type="table"></div>',
|
value: '<div data-type="NodeAttributeView" data-av-type="table"></div>',
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ export const needLogin = (tip = window.siyuan.languages.needLogin) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const needSubscribe = (tip = window.siyuan.languages._kernel[29]) => {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
if (tip) {
|
if (tip) {
|
||||||
|
|
@ -27,3 +28,7 @@ export const needSubscribe = (tip = window.siyuan.languages._kernel[29]) => {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isPaidUser = () => {
|
||||||
|
return 0 === window.siyuan.user.userSiYuanSubscriptionStatus || 1 === window.siyuan.user.userSiYuanOneTimePayStatus;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -714,12 +714,12 @@ func IsSubscriber() bool {
|
||||||
return nil != Conf.User && (-1 == Conf.User.UserSiYuanProExpireTime || 0 < Conf.User.UserSiYuanProExpireTime) && 0 == Conf.User.UserSiYuanSubscriptionStatus
|
return nil != Conf.User && (-1 == Conf.User.UserSiYuanProExpireTime || 0 < Conf.User.UserSiYuanProExpireTime) && 0 == Conf.User.UserSiYuanSubscriptionStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsOneTimePaid() bool {
|
func IsPaidUser() bool {
|
||||||
if IsSubscriber() {
|
if IsSubscriber() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return nil != Conf.User // Sign in to use S3/WebDAV data sync https://github.com/siyuan-note/siyuan/issues/8779
|
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
|
// return nil != Conf.User && 1 == Conf.User.UserSiYuanOneTimePayStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -634,7 +634,7 @@ func DownloadCloudSnapshot(tag, id string) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||||
if !IsOneTimePaid() {
|
if !IsPaidUser() {
|
||||||
util.PushErrMsg(Conf.Language(214), 5000)
|
util.PushErrMsg(Conf.Language(214), 5000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -676,7 +676,7 @@ func UploadCloudSnapshot(tag, id string) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||||
if !IsOneTimePaid() {
|
if !IsPaidUser() {
|
||||||
util.PushErrMsg(Conf.Language(214), 5000)
|
util.PushErrMsg(Conf.Language(214), 5000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -722,7 +722,7 @@ func RemoveCloudRepoTag(tag string) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||||
if !IsOneTimePaid() {
|
if !IsPaidUser() {
|
||||||
util.PushErrMsg(Conf.Language(214), 5000)
|
util.PushErrMsg(Conf.Language(214), 5000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -754,7 +754,7 @@ func GetCloudRepoTagSnapshots() (ret []*dejavu.Log, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||||
if !IsOneTimePaid() {
|
if !IsPaidUser() {
|
||||||
util.PushErrMsg(Conf.Language(214), 5000)
|
util.PushErrMsg(Conf.Language(214), 5000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -790,7 +790,7 @@ func GetCloudRepoSnapshots(page int) (ret []*dejavu.Log, pageCount, totalCount i
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||||
if !IsOneTimePaid() {
|
if !IsPaidUser() {
|
||||||
util.PushErrMsg(Conf.Language(214), 5000)
|
util.PushErrMsg(Conf.Language(214), 5000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@ func checkSync(boot, exit, byHand bool) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||||
if !IsOneTimePaid() {
|
if !IsPaidUser() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue