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
0786dc41
Commit
0786dc41
authored
Jul 13, 2022
by
Medicean
Committed by
Medicean
Jul 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade(Aproxy): aproxy 设置后不需要再重启了
parent
dc810641
Changes
5
Expand all
Show 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 @
0786dc41
This diff is collapsed.
Click to expand it.
source/app.entry.js
View file @
0786dc41
...
...
@@ -362,6 +362,17 @@ ipcRenderer
.
setWidth
(
222
);
},
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 更新
* @param {[type]} 'notification-loader-update' [description]
...
...
source/modules/settings/aproxy.js
View file @
0786dc41
...
...
@@ -116,7 +116,7 @@ class AProxy {
}]
}],
true
);
form
.
enableLiveValidation
(
true
);
form
.
attachEvent
(
"onChange"
,
function
(
name
,
value
,
is_checked
)
{
form
.
attachEvent
(
"onChange"
,
function
(
name
,
value
,
is_checked
)
{
if
(
name
==
"aproxymode"
)
{
if
(
value
==
"manualproxy"
)
{
toolbar
.
enableItem
(
'test'
);
...
...
@@ -140,15 +140,27 @@ class AProxy {
localStorage
.
setItem
(
'aproxyusername'
,
formvals
[
'username'
]);
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'
]);
// 重启应用
layer
.
confirm
(
LANG
[
'confirm'
][
'content'
],
{
icon
:
2
,
shift
:
6
,
title
:
LANG
[
'confirm'
][
'title'
]
},
(
_
)
=>
{
location
.
reload
();
});
//
layer.confirm(LANG['confirm']['content'], {
//
icon: 2,
//
shift: 6,
//
title: LANG['confirm']['title']
//
}, (_) => {
//
location.reload();
//
});
}
else
{
toastr
.
error
(
LANG
[
'error'
],
LANG_T
[
'error'
]);
}
...
...
@@ -158,9 +170,9 @@ class AProxy {
layer
.
prompt
({
title
:
LANG
[
'prompt'
][
'title'
],
value
:
'http
://uyu.us
'
,
value
:
'http
s://encrypted.google.com/
'
,
formType
:
0
},
function
(
testurl
,
index
)
{
},
function
(
testurl
,
index
)
{
layer
.
close
(
index
);
var
loadindex
=
layer
.
load
(
2
,
{
time
:
6
*
1000
...
...
@@ -188,7 +200,7 @@ class AProxy {
toastr
.
success
(
LANG
[
'prompt'
][
'success'
],
LANG_T
[
'success'
]);
}).
send
(
'aproxytest'
,
{
hash
:
hash
,
url
:
testurl
||
'http
://uyu.us
'
,
url
:
testurl
||
'http
s://encrypted.google.com/
'
,
aproxyuri
:
_aproxyuri
});
});
...
...
source/modules/shellmanager/index.js
View file @
0786dc41
...
...
@@ -51,9 +51,7 @@ class ShellManager {
*/
reloadData
(
arg
=
{})
{
if
(
this
.
searchPop
.
isVisible
())
{
let
sdata
=
this
.
searchForm
.
getValues
();
let
sdata
=
this
.
searchForm
.
getValues
();
try
{
RegExp
(
sdata
[
'searchtext'
]);
}
catch
(
e
)
{
...
...
@@ -94,14 +92,8 @@ class ShellManager {
}
const
_data
=
Data
.
get
(
arg
);
// 刷新UI::数据
this
.
list
.
grid
.
clearAll
();
this
.
list
.
grid
.
parse
({
this
.
list
.
grid
.
clearAll
();
this
.
list
.
grid
.
parse
({
'rows'
:
_data
[
'data'
]
},
'json'
);
// 刷新UI::分类
...
...
@@ -124,11 +116,7 @@ class ShellManager {
});
}
// 加载分类数据
this
.
category
.
sidebar
.
items
(
arg
[
'category'
]
||
'default'
)
.
setActive
(
true
);
this
.
category
.
sidebar
.
items
(
arg
[
'category'
]
||
'default'
).
setActive
(
true
);
// 更新标题
this
.
category
...
...
source/modules/shellmanager/list/index.js
View file @
0786dc41
...
...
@@ -31,7 +31,7 @@ class List {
*/
updateHeader
(
num
=
0
)
{
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>`
;
}
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