mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
update list wiki dir (#2909)
This commit is contained in:
@@ -94,7 +94,7 @@ class IndexContentViewer extends React.Component {
|
|||||||
}
|
}
|
||||||
// change dir url
|
// change dir url
|
||||||
else if (Utils.isInternalDirLink(url, repoID)) {
|
else if (Utils.isInternalDirLink(url, repoID)) {
|
||||||
let path = Utils.getPathFromInternalDirLink(url, repoID, slug);
|
let path = Utils.getPathFromInternalDirLink(url, repoID);
|
||||||
// replace url
|
// replace url
|
||||||
item.data.href = serviceURL + '/wikis/' + slug + path;
|
item.data.href = serviceURL + '/wikis/' + slug + path;
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,7 @@ class DirOperationToolbar extends React.Component {
|
|||||||
onEditClick = (e) => {
|
onEditClick = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let { path, repoID } = this.props;
|
let { path, repoID } = this.props;
|
||||||
let url = siteRoot + 'lib/' + repoID + '/file' + path + '?mode=edit';
|
let url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(path) + '?mode=edit';
|
||||||
window.open(url);
|
window.open(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -134,7 +134,7 @@ class WikiMarkdownViewer extends React.Component {
|
|||||||
}
|
}
|
||||||
// change dir url
|
// change dir url
|
||||||
else if (Utils.isInternalDirLink(url, repoID)) {
|
else if (Utils.isInternalDirLink(url, repoID)) {
|
||||||
let path = Utils.getPathFromInternalDirLink(url, repoID, slug);
|
let path = Utils.getPathFromInternalDirLink(url, repoID);
|
||||||
// replace url
|
// replace url
|
||||||
item.data.href = serviceURL + '/wikis/' + slug + path;
|
item.data.href = serviceURL + '/wikis/' + slug + path;
|
||||||
}
|
}
|
||||||
|
@@ -183,6 +183,7 @@ class Wiki extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loadSidePanel = (initialPath) => {
|
loadSidePanel = (initialPath) => {
|
||||||
|
|
||||||
if (initialPath === '/' || isDir === 'None') {
|
if (initialPath === '/' || isDir === 'None') {
|
||||||
seafileAPI.listDir(repoID, '/').then(res => {
|
seafileAPI.listDir(repoID, '/').then(res => {
|
||||||
let tree = this.state.treeData;
|
let tree = this.state.treeData;
|
||||||
@@ -207,7 +208,7 @@ class Wiki extends Component {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// update location url
|
// update location url
|
||||||
let url = siteRoot + 'wiki/lib/' + repoID + path;
|
let url = siteRoot + 'wiki/lib/' + repoID + Utils.encodePath(path);
|
||||||
window.history.pushState({ url: url, path: path}, path, url);
|
window.history.pushState({ url: url, path: path}, path, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,7 +240,7 @@ class Wiki extends Component {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
let fileUrl = siteRoot + 'wiki/lib/' + repoID + filePath;
|
let fileUrl = siteRoot + 'wiki/lib/' + repoID + Utils.encodePath(filePath);
|
||||||
window.history.pushState({url: fileUrl, path: filePath}, filePath, fileUrl);
|
window.history.pushState({url: fileUrl, path: filePath}, filePath, fileUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -317,7 +318,7 @@ class Wiki extends Component {
|
|||||||
let path = Utils.getPathFromInternalMarkdownLink(url, repoID);
|
let path = Utils.getPathFromInternalMarkdownLink(url, repoID);
|
||||||
this.showFile(path);
|
this.showFile(path);
|
||||||
} else if (Utils.isInternalDirLink(url, repoID)) {
|
} else if (Utils.isInternalDirLink(url, repoID)) {
|
||||||
let path = Utils.getPathFromInternalDirLink(url, repoID, slug);
|
let path = Utils.getPathFromInternalDirLink(url, repoID);
|
||||||
this.showDir(path);
|
this.showDir(path);
|
||||||
} else {
|
} else {
|
||||||
window.open(url);
|
window.open(url);
|
||||||
@@ -900,7 +901,7 @@ class Wiki extends Component {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const w = window.open('about:blank');
|
const w = window.open('about:blank');
|
||||||
const url = siteRoot + 'lib/' + repoID + '/file' + node.path;
|
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
|
||||||
w.location.href = url;
|
w.location.href = url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -446,12 +446,12 @@ export const Utils = {
|
|||||||
return path;
|
return path;
|
||||||
},
|
},
|
||||||
|
|
||||||
getPathFromInternalDirLink: function(url, repoID, repoName) {
|
getPathFromInternalDirLink: function(url, repoID) {
|
||||||
var repoName = encodeURIComponent(repoName);
|
var re = new RegExp(serviceURL + '/library/' + repoID + '(/.*)');
|
||||||
var re = new RegExp(serviceURL + '/library/' + repoID + '/' + repoName + '(/.*)');
|
|
||||||
var array = re.exec(url);
|
var array = re.exec(url);
|
||||||
var path = decodeURIComponent(array[1]);
|
var path = decodeURIComponent(array[1]);
|
||||||
|
path = path.slice(1);
|
||||||
|
path = path.slice(path.indexOf('/'));
|
||||||
return path;
|
return path;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -471,7 +471,13 @@ export const Utils = {
|
|||||||
var slug = encodeURIComponent(slug);
|
var slug = encodeURIComponent(slug);
|
||||||
var re = new RegExp(serviceURL + '/wikis/' + slug + '(.*\.md)');
|
var re = new RegExp(serviceURL + '/wikis/' + slug + '(.*\.md)');
|
||||||
var array = re.exec(url);
|
var array = re.exec(url);
|
||||||
var path = decodeURIComponent(array[1]);
|
var path = array[1];
|
||||||
|
try {
|
||||||
|
path = decodeURIComponent(path);
|
||||||
|
} catch(err) {
|
||||||
|
path = path.replace(/%/g, '%25');
|
||||||
|
path = decodeURIComponent(path);
|
||||||
|
}
|
||||||
return path;
|
return path;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -479,7 +485,13 @@ export const Utils = {
|
|||||||
var slug = encodeURIComponent(slug);
|
var slug = encodeURIComponent(slug);
|
||||||
var re = new RegExp(serviceURL + '/wikis/' + slug+ '(/.*)');
|
var re = new RegExp(serviceURL + '/wikis/' + slug+ '(/.*)');
|
||||||
var array = re.exec(url);
|
var array = re.exec(url);
|
||||||
var path = decodeURIComponent(array[1]);
|
var path = array[1];
|
||||||
|
try {
|
||||||
|
path = decodeURIComponent(path);
|
||||||
|
} catch(err) {
|
||||||
|
path = path.replace(/%/g, '%25');
|
||||||
|
path = decodeURIComponent(path);
|
||||||
|
}
|
||||||
return path;
|
return path;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -58,7 +58,7 @@ class Wiki extends Component {
|
|||||||
this.showDir('/');
|
this.showDir('/');
|
||||||
} else {
|
} else {
|
||||||
this.setState({pathExist: false});
|
this.setState({pathExist: false});
|
||||||
let fileUrl = siteRoot + 'wikis/' + slug + initialPath;
|
let fileUrl = siteRoot + 'wikis/' + slug + Utils.encodePath(initialPath);
|
||||||
window.history.pushState({url: fileUrl, path: initialPath}, initialPath, fileUrl);
|
window.history.pushState({url: fileUrl, path: initialPath}, initialPath, fileUrl);
|
||||||
}
|
}
|
||||||
} else if (isDir === 'True') {
|
} else if (isDir === 'True') {
|
||||||
@@ -70,20 +70,18 @@ class Wiki extends Component {
|
|||||||
|
|
||||||
loadSidePanel = (initialPath) => {
|
loadSidePanel = (initialPath) => {
|
||||||
if (initialPath === this.homePath || isDir === 'None') {
|
if (initialPath === this.homePath || isDir === 'None') {
|
||||||
seafileAPI.listDir(repoID, '/').then(res => {
|
seafileAPI.listWikiDir(slug, '/').then(res => {
|
||||||
let tree = this.state.treeData;
|
let tree = this.state.treeData;
|
||||||
this.addFirstResponseListToNode(res.data.dirent_list, tree.root);
|
this.addFirstResponseListToNode(res.data.dirent_list, tree.root);
|
||||||
let indexNode = tree.getNodeByPath(this.indexPath);
|
let indexNode = tree.getNodeByPath(this.indexPath);
|
||||||
let homeNode = tree.getNodeByPath(this.homePath);
|
let homeNode = tree.getNodeByPath(this.homePath);
|
||||||
if (homeNode && indexNode) {
|
if (homeNode && indexNode) {
|
||||||
seafileAPI.getFileDownloadLink(repoID, indexNode.path).then(res => {
|
seafileAPI.getWikiFileContent(slug, indexNode.path).then(res => {
|
||||||
seafileAPI.getFileContent(res.data).then(res => {
|
this.setState({
|
||||||
this.setState({
|
treeData: tree,
|
||||||
treeData: tree,
|
indexNode: indexNode,
|
||||||
indexNode: indexNode,
|
indexContent: res.data.content,
|
||||||
indexContent: res.data,
|
isTreeDataLoading: false,
|
||||||
isTreeDataLoading: false,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -104,7 +102,7 @@ class Wiki extends Component {
|
|||||||
this.loadDirentList(dirPath);
|
this.loadDirentList(dirPath);
|
||||||
|
|
||||||
// update location url
|
// update location url
|
||||||
let fileUrl = siteRoot + 'wikis/' + slug + dirPath;
|
let fileUrl = siteRoot + 'wikis/' + slug + Utils.encodePath(dirPath);
|
||||||
window.history.pushState({url: fileUrl, path: dirPath}, dirPath, fileUrl);
|
window.history.pushState({url: fileUrl, path: dirPath}, dirPath, fileUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,29 +113,25 @@ class Wiki extends Component {
|
|||||||
path: filePath,
|
path: filePath,
|
||||||
});
|
});
|
||||||
|
|
||||||
seafileAPI.getFileInfo(repoID, filePath).then(res => {
|
seafileAPI.getWikiFileContent(slug, filePath).then(res => {
|
||||||
let { mtime, permission, last_modifier_name } = res.data;
|
let data = res.data;
|
||||||
seafileAPI.getFileDownloadLink(repoID, filePath).then(res => {
|
this.setState({
|
||||||
seafileAPI.getFileContent(res.data).then(res => {
|
isDataLoading: false,
|
||||||
this.setState({
|
content: data.content,
|
||||||
isDataLoading: false,
|
permission: data.permission,
|
||||||
content: res.data,
|
lastModified: moment.unix(data.last_modified).fromNow(),
|
||||||
permission: permission,
|
latestContributor: data.latest_contributor,
|
||||||
lastModified: moment.unix(mtime).fromNow(),
|
|
||||||
latestContributor: last_modifier_name,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const hash = window.location.hash;
|
const hash = window.location.hash;
|
||||||
let fileUrl = siteRoot + 'wikis/' + slug + filePath + hash;
|
let fileUrl = siteRoot + 'wikis/' + slug + Utils.encodePath(filePath) + hash;
|
||||||
window.history.pushState({url: fileUrl, path: filePath}, filePath, fileUrl);
|
window.history.pushState({url: fileUrl, path: filePath}, filePath, fileUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadDirentList = (dirPath) => {
|
loadDirentList = (dirPath) => {
|
||||||
this.setState({isDataLoading: true});
|
this.setState({isDataLoading: true});
|
||||||
seafileAPI.listDir(repoID, dirPath).then(res => {
|
seafileAPI.listWikiDir(slug, dirPath).then(res => {
|
||||||
let direntList = res.data.dirent_list.map(item => {
|
let direntList = res.data.dirent_list.map(item => {
|
||||||
let dirent = new Dirent(item);
|
let dirent = new Dirent(item);
|
||||||
return dirent;
|
return dirent;
|
||||||
@@ -158,7 +152,7 @@ class Wiki extends Component {
|
|||||||
let tree = this.state.treeData.clone();
|
let tree = this.state.treeData.clone();
|
||||||
let node = tree.getNodeByPath(path);
|
let node = tree.getNodeByPath(path);
|
||||||
if (!node.isLoaded) {
|
if (!node.isLoaded) {
|
||||||
seafileAPI.listDir(repoID, node.path).then(res => {
|
seafileAPI.listWikiDir(slug, node.path).then(res => {
|
||||||
this.addResponseListToNode(res.data.dirent_list, node);
|
this.addResponseListToNode(res.data.dirent_list, node);
|
||||||
let parentNode = tree.getNodeByPath(node.parentNode.path);
|
let parentNode = tree.getNodeByPath(node.parentNode.path);
|
||||||
parentNode.isExpanded = true;
|
parentNode.isExpanded = true;
|
||||||
@@ -179,7 +173,7 @@ class Wiki extends Component {
|
|||||||
if (Utils.isMarkdownFile(path)) {
|
if (Utils.isMarkdownFile(path)) {
|
||||||
path = Utils.getDirName(path);
|
path = Utils.getDirName(path);
|
||||||
}
|
}
|
||||||
seafileAPI.listDir(repoID, path, {with_parents: true}).then(res => {
|
seafileAPI.listWikiDir(slug, path, true).then(res => {
|
||||||
let direntList = res.data.dirent_list;
|
let direntList = res.data.dirent_list;
|
||||||
let results = {};
|
let results = {};
|
||||||
for (let i = 0; i < direntList.length; i++) {
|
for (let i = 0; i < direntList.length; i++) {
|
||||||
@@ -314,7 +308,7 @@ class Wiki extends Component {
|
|||||||
if (!node.isLoaded) {
|
if (!node.isLoaded) {
|
||||||
let tree = this.state.treeData.clone();
|
let tree = this.state.treeData.clone();
|
||||||
node = tree.getNodeByPath(node.path);
|
node = tree.getNodeByPath(node.path);
|
||||||
seafileAPI.listDir(repoID, node.path).then(res => {
|
seafileAPI.listWikiDir(slug, node.path).then(res => {
|
||||||
this.addResponseListToNode(res.data.dirent_list, node);
|
this.addResponseListToNode(res.data.dirent_list, node);
|
||||||
tree.collapseNode(node);
|
tree.collapseNode(node);
|
||||||
this.setState({treeData: tree});
|
this.setState({treeData: tree});
|
||||||
@@ -346,7 +340,7 @@ class Wiki extends Component {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const w = window.open('about:blank');
|
const w = window.open('about:blank');
|
||||||
const url = siteRoot + 'lib/' + repoID + '/file' + node.path;
|
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
|
||||||
w.location.href = url;
|
w.location.href = url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -361,7 +355,7 @@ class Wiki extends Component {
|
|||||||
let tree = this.state.treeData.clone();
|
let tree = this.state.treeData.clone();
|
||||||
node = tree.getNodeByPath(node.path);
|
node = tree.getNodeByPath(node.path);
|
||||||
if (!node.isLoaded) {
|
if (!node.isLoaded) {
|
||||||
seafileAPI.listDir(repoID, node.path).then(res => {
|
seafileAPI.listWikiDir(slug, node.path).then(res => {
|
||||||
this.addResponseListToNode(res.data.dirent_list, node);
|
this.addResponseListToNode(res.data.dirent_list, node);
|
||||||
this.setState({treeData: tree});
|
this.setState({treeData: tree});
|
||||||
});
|
});
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import urllib2
|
import urllib2
|
||||||
|
import posixpath
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
from rest_framework.authentication import SessionAuthentication
|
from rest_framework.authentication import SessionAuthentication
|
||||||
@@ -19,11 +20,11 @@ from seahub.views.file import send_file_access_msg
|
|||||||
from seahub.api2.views import get_dir_file_recursively
|
from seahub.api2.views import get_dir_file_recursively
|
||||||
from seahub.api2.authentication import TokenAuthentication
|
from seahub.api2.authentication import TokenAuthentication
|
||||||
from seahub.api2.throttling import UserRateThrottle
|
from seahub.api2.throttling import UserRateThrottle
|
||||||
from seahub.api2.utils import api_error
|
from seahub.api2.utils import api_error, to_python_boolean
|
||||||
from seahub.wiki.models import Wiki, WikiPageMissing
|
from seahub.wiki.models import Wiki, WikiPageMissing
|
||||||
from seahub.wiki.utils import (clean_page_name, get_wiki_pages, get_inner_file_url,
|
from seahub.wiki.utils import (clean_page_name, get_wiki_pages, get_inner_file_url,
|
||||||
get_wiki_dirent, get_wiki_page_object, get_wiki_dirs_by_path)
|
get_wiki_dirent, get_wiki_page_object, get_wiki_dirs_by_path)
|
||||||
from seahub.utils import gen_inner_file_get_url
|
from seahub.utils import gen_inner_file_get_url, normalize_dir_path
|
||||||
from seahub.base.templatetags.seahub_tags import email2contact_email, email2nickname
|
from seahub.base.templatetags.seahub_tags import email2contact_email, email2nickname
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -219,11 +220,6 @@ class WikiPagesDirView(APIView):
|
|||||||
error_msg = "Wiki not found."
|
error_msg = "Wiki not found."
|
||||||
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
|
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
|
||||||
|
|
||||||
path = request.GET.get("p", '')
|
|
||||||
if not path:
|
|
||||||
error_msg = "Folder not found."
|
|
||||||
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
|
|
||||||
|
|
||||||
# perm check
|
# perm check
|
||||||
if not wiki.has_read_perm(request):
|
if not wiki.has_read_perm(request):
|
||||||
error_msg = "Permission denied"
|
error_msg = "Permission denied"
|
||||||
@@ -238,15 +234,44 @@ class WikiPagesDirView(APIView):
|
|||||||
error_msg = "Internal Server Error"
|
error_msg = "Internal Server Error"
|
||||||
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
|
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
|
||||||
|
|
||||||
dir_id = seafile_api.get_dir_id_by_path(repo.repo_id, path)
|
with_parents = request.GET.get('with_parents', 'false')
|
||||||
|
if with_parents not in ('true', 'false'):
|
||||||
|
error_msg = 'with_parents invalid.'
|
||||||
|
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
||||||
|
|
||||||
|
with_parents = to_python_boolean(with_parents)
|
||||||
|
|
||||||
|
parent_dir = request.GET.get("p", '/')
|
||||||
|
parent_dir = normalize_dir_path(parent_dir)
|
||||||
|
|
||||||
|
dir_id = seafile_api.get_dir_id_by_path(repo.repo_id, parent_dir)
|
||||||
if not dir_id:
|
if not dir_id:
|
||||||
error_msg = 'Folder %s not found.' % path
|
error_msg = 'Folder %s not found.' % parent_dir
|
||||||
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
|
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
|
||||||
|
|
||||||
all_dirs = get_wiki_dirs_by_path(repo.repo_id, path, [])
|
parent_dir_list = []
|
||||||
|
if not with_parents:
|
||||||
|
# only return dirent list in current parent folder
|
||||||
|
parent_dir_list.append(parent_dir)
|
||||||
|
else:
|
||||||
|
# if value of 'p' parameter is '/a/b/c' add with_parents's is 'true'
|
||||||
|
# then return dirent list in '/', '/a', '/a/b' and '/a/b/c'.
|
||||||
|
if parent_dir == '/':
|
||||||
|
parent_dir_list.append(parent_dir)
|
||||||
|
else:
|
||||||
|
tmp_parent_dir = '/'
|
||||||
|
parent_dir_list.append(tmp_parent_dir)
|
||||||
|
for folder_name in parent_dir.strip('/').split('/'):
|
||||||
|
tmp_parent_dir = posixpath.join(tmp_parent_dir, folder_name)
|
||||||
|
parent_dir_list.append(tmp_parent_dir)
|
||||||
|
|
||||||
|
all_dirs_info = []
|
||||||
|
for parent_dir in parent_dir_list:
|
||||||
|
all_dirs = get_wiki_dirs_by_path(repo.repo_id, parent_dir, [])
|
||||||
|
all_dirs_info += all_dirs
|
||||||
|
|
||||||
return Response({
|
return Response({
|
||||||
"dir_file_list": all_dirs
|
"dirent_list": all_dirs_info
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
config: {
|
config: {
|
||||||
repoId: "{{ repo_id }}",
|
repoId: "{{ repo_id }}",
|
||||||
serviceUrl: "{{ service_url}}",
|
serviceUrl: "{{ service_url}}",
|
||||||
initial_path: "{{ initial_path }}",
|
initial_path: "{{ initial_path|escapejs }}",
|
||||||
slug: "{{ repo_name }}",
|
slug: "{{ repo_name }}",
|
||||||
isDir: "{{ is_dir }}",
|
isDir: "{{ is_dir }}",
|
||||||
permission: "{{ permission }}"
|
permission: "{{ permission }}"
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
config: {
|
config: {
|
||||||
slug: "{{ wiki.slug }}",
|
slug: "{{ wiki.slug }}",
|
||||||
repoId: "{{ wiki.repo_id }}",
|
repoId: "{{ wiki.repo_id }}",
|
||||||
initial_path: "{{ file_path }}",
|
initial_path: "{{ file_path|escapejs }}",
|
||||||
permission: "{{ user_can_write }}",
|
permission: "{{ user_can_write }}",
|
||||||
isPublicWiki: "{{ is_public_wiki }}",
|
isPublicWiki: "{{ is_public_wiki }}",
|
||||||
isDir: "{{ is_dir }}",
|
isDir: "{{ is_dir }}",
|
||||||
|
@@ -238,14 +238,11 @@ def get_wiki_dirs_by_path(repo_id, path, all_dirs):
|
|||||||
entry["type"] = 'file'
|
entry["type"] = 'file'
|
||||||
|
|
||||||
entry["parent_dir"] = path
|
entry["parent_dir"] = path
|
||||||
|
entry["id"] = dirent.obj_id
|
||||||
entry["name"] = dirent.obj_name
|
entry["name"] = dirent.obj_name
|
||||||
entry["size"] = dirent.size
|
entry["size"] = dirent.size
|
||||||
entry["last_update_time"] = dirent.mtime
|
entry["mtime"] = dirent.mtime
|
||||||
|
|
||||||
all_dirs.append(entry)
|
all_dirs.append(entry)
|
||||||
|
|
||||||
if stat.S_ISDIR(dirent.mode):
|
|
||||||
sub_path = posixpath.join(path, dirent.obj_name)
|
|
||||||
get_wiki_dirs_by_path(repo_id, sub_path, all_dirs)
|
|
||||||
|
|
||||||
return all_dirs
|
return all_dirs
|
||||||
|
Reference in New Issue
Block a user