feat: allow create local wiki

This commit is contained in:
tiddlygit-test 2020-11-21 16:58:30 +08:00
parent a29a1d849b
commit 4575983c7c
3 changed files with 10 additions and 3 deletions

View file

@ -85,7 +85,8 @@
"TagName": "Tag Name", "TagName": "Tag Name",
"TagNameHelp": "Tiddlers with this Tag will be add to this sub-wiki (you can add or change this Tag later, by right-click workspace Icon and choose Edit Workspace)", "TagNameHelp": "Tiddlers with this Tag will be add to this sub-wiki (you can add or change this Tag later, by right-click workspace Icon and choose Edit Workspace)",
"GitToken": "Git Token", "GitToken": "Git Token",
"GitTokenDescription": "The credentials used to log in to Git. Will expire after a certain period of time" "GitTokenDescription": "The credentials used to log in to Git. Will expire after a certain period of time",
"NoGitInfoAlert": "You haven't selected an online Git repo address, or you haven't successfully logged in to your Github account. Click the Create button will create a local wiki that will not be automatically sync to Github. Please be aware."
}, },
"EditWorkspace": { "EditWorkspace": {
"Path": "Wiki Path", "Path": "Wiki Path",

View file

@ -85,7 +85,8 @@
"StartLinkingSubWikiToMainWiki": "开始链接子Wiki到父Wiki", "StartLinkingSubWikiToMainWiki": "开始链接子Wiki到父Wiki",
"AddFileSystemPath": "正在为子Wiki添加FileSystemPaths", "AddFileSystemPath": "正在为子Wiki添加FileSystemPaths",
"TagName": "标签名", "TagName": "标签名",
"TagNameHelp": "加上此标签的笔记将会自动被放入这个子知识库内(可先不填,之后右键点击这个工作区的图标选择编辑工作区修改)" "TagNameHelp": "加上此标签的笔记将会自动被放入这个子知识库内(可先不填,之后右键点击这个工作区的图标选择编辑工作区修改)",
"NoGitInfoAlert": "你未选择在线Git仓库地址或未成功登录Github账号可能被墙。点击创建按钮将创建一个不会自动同步到Github的本地仓库请注意。"
}, },
"EditWorkspace": { "EditWorkspace": {
"Path": "Wiki的位置", "Path": "Wiki的位置",

View file

@ -87,11 +87,16 @@ function NewWikiDoneButton({
<Alert severity="info">{wikiCreationMessage}</Alert> <Alert severity="info">{wikiCreationMessage}</Alert>
</Snackbar> </Snackbar>
{isCreateMainWorkspace && (!githubWikiUrl || !userInfo) && (
<Typography variant="body1" display="inline">
{t('AddWorkspace.NoGitInfoAlert')}
</Typography>
)}
{isCreateMainWorkspace ? ( {isCreateMainWorkspace ? (
<CloseButton <CloseButton
variant="contained" variant="contained"
color="secondary" color="secondary"
disabled={!parentFolderLocation || !githubWikiUrl || progressBarOpen || !userInfo} disabled={!parentFolderLocation || progressBarOpen}
onClick={async () => { onClick={async () => {
updateForm(workspaceFormData); updateForm(workspaceFormData);
setWikiCreationMessage(t('AddWorkspace.Processing')); setWikiCreationMessage(t('AddWorkspace.Processing'));