提交 6131f511 编写于 作者: B Boris Sekachev

Fixed interaction with the server share in the auto annotation plugin

上级 0408756c
...@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ...@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.4.2] - 2019-06-03
### Fixed
- Fixed interaction with the server share in the auto annotation plugin
## [0.4.1] - 2019-05-14 ## [0.4.1] - 2019-05-14
### Fixed ### Fixed
- JavaScript syntax incompatibility with Google Chrome versions less than 72 - JavaScript syntax incompatibility with Google Chrome versions less than 72
......
...@@ -300,10 +300,25 @@ class AutoAnnotationModelManagerView { ...@@ -300,10 +300,25 @@ class AutoAnnotationModelManagerView {
this.shareSelector.removeClass('hidden'); this.shareSelector.removeClass('hidden');
this.shareBrowseTree.jstree({ this.shareBrowseTree.jstree({
core: { core: {
data: { data: async function (obj, callback) {
url: 'get_share_nodes', let url = '/api/v1/server/share';
data: node => ({ id: node.id }),
}, if (obj.id != '#') {
url += `?directory=${obj.id.substr(2)}`;
}
const response = await $.get(url);
const files = Array.from(response, (element) => {
return {
id: `${obj.id}/${element.name}`,
children: element.type === 'DIR',
text: element.name,
icon: element.type === 'DIR' ? 'jstree-folder' : 'jstree-file',
}
});
callback.call(this, files);
}
}, },
plugins: ['checkbox', 'sort'], plugins: ['checkbox', 'sort'],
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册