mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40: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 {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>',
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 i
|
|||
return
|
||||
}
|
||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||
if !IsOneTimePaid() {
|
||||
if !IsPaidUser() {
|
||||
util.PushErrMsg(Conf.Language(214), 5000)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ func checkSync(boot, exit, byHand bool) bool {
|
|||
return false
|
||||
}
|
||||
case conf.ProviderWebDAV, conf.ProviderS3:
|
||||
if !IsOneTimePaid() {
|
||||
if !IsPaidUser() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue