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
47a62f31
Commit
47a62f31
authored
Jul 13, 2022
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade(Aproxy): aproxy 设置后不需要再重启了
parent
21859b77
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
185 additions
and
249 deletions
+185
-249
request.js
modules/request.js
+144
-219
app.entry.js
source/app.entry.js
+11
-0
aproxy.js
source/modules/settings/aproxy.js
+23
-11
index.js
source/modules/shellmanager/index.js
+6
-18
index.js
source/modules/shellmanager/list/index.js
+1
-1
No files found.
modules/request.js
View file @
47a62f31
This diff is collapsed.
Click to expand it.
source/app.entry.js
View file @
47a62f31
...
@@ -362,6 +362,17 @@ ipcRenderer
...
@@ -362,6 +362,17 @@ ipcRenderer
.
setWidth
(
222
);
.
setWidth
(
222
);
},
555
);
},
555
);
})
})
.
on
(
'aproxy-update'
,
(
e
,
opt
)
=>
{
antSword
[
'aproxyauth'
]
=
(
!
opt
[
'aproxyusername'
]
||
!
opt
[
'aproxypassword'
])
?
''
:
`
${
opt
[
'aproxyusername'
]}
:
${
opt
[
'aproxypassword'
]}
`
;
antSword
[
'aproxyuri'
]
=
`
${
opt
[
'aproxyprotocol'
]}
:\/\/
${
antSword
[
'aproxyauth'
]}${
antSword
[
'aproxyauth'
]
===
''
?
''
:
'@'
}${
opt
[
'aproxyserver'
]}
:
${
opt
[
'aproxyport'
]}
`
;
antSword
[
'aproxymode'
]
=
opt
[
'aproxymode'
];
// antSword.modules.shellmanager.list.updateHeader();
antSword
.
modules
.
shellmanager
.
reloadData
({
category
:
antSword
.
modules
.
shellmanager
.
category
.
sidebar
.
getActiveItem
(),
});
})
/**
/**
* 通知提示 Loader 更新
* 通知提示 Loader 更新
* @param {[type]} 'notification-loader-update' [description]
* @param {[type]} 'notification-loader-update' [description]
...
...
source/modules/settings/aproxy.js
View file @
47a62f31
...
@@ -116,7 +116,7 @@ class AProxy {
...
@@ -116,7 +116,7 @@ class AProxy {
}]
}]
}],
true
);
}],
true
);
form
.
enableLiveValidation
(
true
);
form
.
enableLiveValidation
(
true
);
form
.
attachEvent
(
"onChange"
,
function
(
name
,
value
,
is_checked
)
{
form
.
attachEvent
(
"onChange"
,
function
(
name
,
value
,
is_checked
)
{
if
(
name
==
"aproxymode"
)
{
if
(
name
==
"aproxymode"
)
{
if
(
value
==
"manualproxy"
)
{
if
(
value
==
"manualproxy"
)
{
toolbar
.
enableItem
(
'test'
);
toolbar
.
enableItem
(
'test'
);
...
@@ -140,15 +140,27 @@ class AProxy {
...
@@ -140,15 +140,27 @@ class AProxy {
localStorage
.
setItem
(
'aproxyusername'
,
formvals
[
'username'
]);
localStorage
.
setItem
(
'aproxyusername'
,
formvals
[
'username'
]);
localStorage
.
setItem
(
'aproxypassword'
,
formvals
[
'password'
]);
localStorage
.
setItem
(
'aproxypassword'
,
formvals
[
'password'
]);
let
aproxyauth
=
(
!
formvals
[
'username'
]
||
!
formvals
[
'password'
])
?
''
:
`
${
formvals
[
'username'
]}
:
${
formvals
[
'password'
]}
`
;
let
aproxyuri
=
`
${
formvals
[
'protocol'
]}
:\/\/
${
aproxyauth
}${
aproxyauth
===
''
?
''
:
'@'
}${
formvals
[
'server'
]}
:
${
formvals
[
'port'
]}
`
;
antSword
[
'ipcRenderer'
].
send
(
'aproxy'
,
{
aproxymode
:
formvals
[
'aproxymode'
],
aproxyuri
:
aproxyuri
,
aproxyprotocol
:
formvals
[
'protocol'
],
aproxyserver
:
formvals
[
'server'
],
aproxyport
:
formvals
[
'port'
],
aproxyusername
:
formvals
[
'username'
],
aproxypassword
:
formvals
[
'password'
],
});
toastr
.
success
(
LANG
[
'success'
],
LANG_T
[
'success'
]);
toastr
.
success
(
LANG
[
'success'
],
LANG_T
[
'success'
]);
// 重启应用
// 重启应用
layer
.
confirm
(
LANG
[
'confirm'
][
'content'
],
{
//
layer.confirm(LANG['confirm']['content'], {
icon
:
2
,
//
icon: 2,
shift
:
6
,
//
shift: 6,
title
:
LANG
[
'confirm'
][
'title'
]
//
title: LANG['confirm']['title']
},
(
_
)
=>
{
//
}, (_) => {
location
.
reload
();
//
location.reload();
});
//
});
}
else
{
}
else
{
toastr
.
error
(
LANG
[
'error'
],
LANG_T
[
'error'
]);
toastr
.
error
(
LANG
[
'error'
],
LANG_T
[
'error'
]);
}
}
...
@@ -158,9 +170,9 @@ class AProxy {
...
@@ -158,9 +170,9 @@ class AProxy {
layer
layer
.
prompt
({
.
prompt
({
title
:
LANG
[
'prompt'
][
'title'
],
title
:
LANG
[
'prompt'
][
'title'
],
value
:
'http
://uyu.us
'
,
value
:
'http
s://encrypted.google.com/
'
,
formType
:
0
formType
:
0
},
function
(
testurl
,
index
)
{
},
function
(
testurl
,
index
)
{
layer
.
close
(
index
);
layer
.
close
(
index
);
var
loadindex
=
layer
.
load
(
2
,
{
var
loadindex
=
layer
.
load
(
2
,
{
time
:
6
*
1000
time
:
6
*
1000
...
@@ -188,7 +200,7 @@ class AProxy {
...
@@ -188,7 +200,7 @@ class AProxy {
toastr
.
success
(
LANG
[
'prompt'
][
'success'
],
LANG_T
[
'success'
]);
toastr
.
success
(
LANG
[
'prompt'
][
'success'
],
LANG_T
[
'success'
]);
}).
send
(
'aproxytest'
,
{
}).
send
(
'aproxytest'
,
{
hash
:
hash
,
hash
:
hash
,
url
:
testurl
||
'http
://uyu.us
'
,
url
:
testurl
||
'http
s://encrypted.google.com/
'
,
aproxyuri
:
_aproxyuri
aproxyuri
:
_aproxyuri
});
});
});
});
...
...
source/modules/shellmanager/index.js
View file @
47a62f31
...
@@ -51,9 +51,7 @@ class ShellManager {
...
@@ -51,9 +51,7 @@ class ShellManager {
*/
*/
reloadData
(
arg
=
{})
{
reloadData
(
arg
=
{})
{
if
(
this
.
searchPop
.
isVisible
())
{
if
(
this
.
searchPop
.
isVisible
())
{
let
sdata
=
this
let
sdata
=
this
.
searchForm
.
getValues
();
.
searchForm
.
getValues
();
try
{
try
{
RegExp
(
sdata
[
'searchtext'
]);
RegExp
(
sdata
[
'searchtext'
]);
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -94,16 +92,10 @@ class ShellManager {
...
@@ -94,16 +92,10 @@ class ShellManager {
}
}
const
_data
=
Data
.
get
(
arg
);
const
_data
=
Data
.
get
(
arg
);
// 刷新UI::数据
// 刷新UI::数据
this
this
.
list
.
grid
.
clearAll
();
.
list
this
.
list
.
grid
.
parse
({
.
grid
'rows'
:
_data
[
'data'
]
.
clearAll
();
},
'json'
);
this
.
list
.
grid
.
parse
({
'rows'
:
_data
[
'data'
]
},
'json'
);
// 刷新UI::分类
// 刷新UI::分类
for
(
let
_
in
_data
[
'category'
])
{
for
(
let
_
in
_data
[
'category'
])
{
// 目录存在,则更新bubble
// 目录存在,则更新bubble
...
@@ -124,11 +116,7 @@ class ShellManager {
...
@@ -124,11 +116,7 @@ class ShellManager {
});
});
}
}
// 加载分类数据
// 加载分类数据
this
this
.
category
.
sidebar
.
items
(
arg
[
'category'
]
||
'default'
).
setActive
(
true
);
.
category
.
sidebar
.
items
(
arg
[
'category'
]
||
'default'
)
.
setActive
(
true
);
// 更新标题
// 更新标题
this
this
.
category
.
category
...
...
source/modules/shellmanager/list/index.js
View file @
47a62f31
...
@@ -31,7 +31,7 @@ class List {
...
@@ -31,7 +31,7 @@ class List {
*/
*/
updateHeader
(
num
=
0
)
{
updateHeader
(
num
=
0
)
{
let
proxyhint
=
""
;
let
proxyhint
=
""
;
if
(
antSword
.
aproxymode
===
"manualproxy"
)
{
if
(
antSword
.
aproxymode
===
"manualproxy"
)
{
proxyhint
=
` <i class="fa fa-paper-plane"></i> <span style="color:green;">Proxy On</span>`
;
proxyhint
=
` <i class="fa fa-paper-plane"></i> <span style="color:green;">Proxy On</span>`
;
}
}
this
this
...
...
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