Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
51fb80ed
Commit
51fb80ed
authored
Dec 04, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance: FileManager) 编辑文件文件路径改为输入框, 现在可以手动输入文件路径后, 按 Enter 键快速打开文件了
parent
17d2ee41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
CHANGELOG.md
CHANGELOG.md
+4
-0
index.js
source/modules/filemanager/index.js
+28
-2
No files found.
CHANGELOG.md
View file @
51fb80ed
...
@@ -38,6 +38,10 @@ key2=val2
...
@@ -38,6 +38,10 @@ key2=val2
*
新建文件默认内容更改为
`#Halo AntSword!`
*
新建文件默认内容更改为
`#Halo AntSword!`
*
编辑文件文件路径改为输入框, 现在可以手动输入文件路径后, 按 Enter 键快速打开文件了

### 虚拟终端
### 虚拟终端
*
新增
`asenv`
本地指令, 用于手动设置当前终端下的环境变量
*
新增
`asenv`
本地指令, 用于手动设置当前终端下的环境变量
...
...
source/modules/filemanager/index.js
View file @
51fb80ed
...
@@ -871,7 +871,7 @@ class FileManager {
...
@@ -871,7 +871,7 @@ class FileManager {
let codes = '';
let codes = '';
let win;
let win;
let hinttext = '';
let hinttext = '';
let tooltip = `IP:${this.opts['
ip
']} File:
${antSword.noxss(path)}
`;
let tooltip = `IP:${this.opts['
ip
']} File:`;
if (openfileintab == false) {
if (openfileintab == false) {
win = this.createWin({
win = this.createWin({
title: LANG['
editor
']['
title
'](antSword.noxss(path)),
title: LANG['
editor
']['
title
'](antSword.noxss(path)),
...
@@ -894,7 +894,7 @@ class FileManager {
...
@@ -894,7 +894,7 @@ class FileManager {
tmpbuf.write(name, 100 - name.length);
tmpbuf.write(name, 100 - name.length);
hitpath = tmpbuf.toString();
hitpath = tmpbuf.toString();
}
}
hinttext = `IP:${this.opts['
ip
']} File:
${antSword.noxss(hitpath)}
`;
hinttext = `IP:${this.opts['
ip
']} File:`;
}
}
win.progressOn();
win.progressOn();
...
@@ -952,6 +952,12 @@ class FileManager {
...
@@ -952,6 +952,12 @@ class FileManager {
type: '
text
',
type: '
text
',
text: hinttext
text: hinttext
},
},
{
id: '
filepath
',
type: '
buttonInput
',
width: 500,
value: antSword.noxss(path),
},
{
{
type: '
separator
'
type: '
separator
'
},
},
...
@@ -1040,6 +1046,18 @@ class FileManager {
...
@@ -1040,6 +1046,18 @@ class FileManager {
})
})
).then((res) => {
).then((res) => {
win.progressOff();
win.progressOff();
name = path.substr(path.lastIndexOf('
/
') + 1);
if (openfileintab == false) {
win.setText(LANG['
editor
']['
title
'](antSword.noxss(path)));
} else {
win.setText(`<i class="fa fa-file-o"></i> ${antSword.noxss(name)}`);
}
ext = name.substr(name.lastIndexOf('
.
') + 1);
if (!(ext in ext_dict)) {
ext = '
txt
'
};
toolbar.callEvent('
onClick
', [`mode_${ext_dict[ext]}`]);
let ret = antSword.unxss(res['
text
'], false);
let ret = antSword.unxss(res['
text
'], false);
codes = Buffer.from(antSword.unxss(res['
buff
'].toString(), false));
codes = Buffer.from(antSword.unxss(res['
buff
'].toString(), false));
let encoding = res['
encoding
'] || this.opts['
encode
'];
let encoding = res['
encoding
'] || this.opts['
encode
'];
...
@@ -1056,6 +1074,14 @@ class FileManager {
...
@@ -1056,6 +1074,14 @@ class FileManager {
console.info('
toolbar
.
onClick
', id);
console.info('
toolbar
.
onClick
', id);
}
}
});
});
toolbar.attachEvent('
onEnter
', (id, value) => {
switch (id) {
case '
filepath
':
path = toolbar.getInput('
filepath
').value;
toolbar.callEvent('
onClick
', ['
refresh
']);
break;
}
});
// 获取文件代码
// 获取文件代码
this.core.request(
this.core.request(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment