Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Дмитрий Корытько
/
hware
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
9f54c469
...
9f54c469d1d4e6dc2b5d4df5c6c8ddc6f74757ff
authored
2015-08-04 05:54:32 +0300
by
root
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
save
1 parent
db7d888b
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
103 additions
and
91 deletions
DevTools/pom.xml
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.jar
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.jar.md5
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.jar.sha1
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.pom
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.pom.md5
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.pom.sha1
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.jar
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.jar.md5
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.jar.sha1
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.pom
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.pom.md5
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.pom.sha1
DevTools/repo/org/emercit/utilstools/maven-metadata.xml
DevTools/repo/org/emercit/utilstools/maven-metadata.xml.md5
DevTools/repo/org/emercit/utilstools/maven-metadata.xml.sha1
DevTools/src/main/java/org/emercit/devtools/app/ProxyController.java
DevTools/src/main/java/org/emercit/devtools/service/EthService.java
DevTools/src/main/webapp/resources/js/app/controller/Proxy.js
DevTools/src/main/webapp/resources/js/app/view/Proxy.js
UtilsTools/src/main/java/org/emercit/ethmanager/service/EthLinux.java
UtilsTools/src/main/java/org/emercit/proxymanager/model/ProxyBean.java
UtilsTools/src/main/java/org/emercit/proxymanager/service/ProxyLinux.java
UtilsTools/src/main/java/org/emercit/utilstools/config/DefSettings.java
DevTools/pom.xml
View file @
9f54c46
...
...
@@ -135,7 +135,7 @@
<dependency>
<groupId>
org.emercit
</groupId>
<artifactId>
utilstools
</artifactId>
<version>
1.
19
</version>
<version>
1.
21
</version>
</dependency>
<dependency>
...
...
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.jar
0 → 100644
View file @
9f54c46
No preview for this file type
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.jar.md5
0 → 100644
View file @
9f54c46
7018931d960794577dd2bdceca298daa
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.jar.sha1
0 → 100644
View file @
9f54c46
ad98ab874f05a2dcd17c731f07484a9b8bf9cb5c
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.pom
0 → 100644
View file @
9f54c46
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.emercit
</groupId>
<artifactId>
utilstools
</artifactId>
<version>
1.20
</version>
</project>
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.pom.md5
0 → 100644
View file @
9f54c46
3d9fc1e23966dbe0affb0e7b55c2f24b
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.20/utilstools-1.20.pom.sha1
0 → 100644
View file @
9f54c46
b916c18fdcdabbd4fa06c0905962fdab1ac24bbc
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.jar
0 → 100644
View file @
9f54c46
No preview for this file type
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.jar.md5
0 → 100644
View file @
9f54c46
eb2b34eedfed8215eac2dab36e46a6dc
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.jar.sha1
0 → 100644
View file @
9f54c46
09f3ef732de8e1e5e508b943a1edd683eafe83e0
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.pom
0 → 100644
View file @
9f54c46
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.emercit
</groupId>
<artifactId>
utilstools
</artifactId>
<version>
1.21
</version>
</project>
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.pom.md5
0 → 100644
View file @
9f54c46
6d56e7561927517d16e40fb5dababf66
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.21/utilstools-1.21.pom.sha1
0 → 100644
View file @
9f54c46
f9b1e636e351bfc0a62a211932d96c5b9cbe0f2f
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/maven-metadata.xml
View file @
9f54c46
...
...
@@ -3,7 +3,7 @@
<groupId>
org.emercit
</groupId>
<artifactId>
utilstools
</artifactId>
<versioning>
<release>
1.
19
</release>
<release>
1.
21
</release>
<versions>
<version>
1.0
</version>
<version>
1.1
</version>
...
...
@@ -25,7 +25,9 @@
<version>
1.17
</version>
<version>
1.18
</version>
<version>
1.19
</version>
<version>
1.20
</version>
<version>
1.21
</version>
</versions>
<lastUpdated>
2015080
3150448
</lastUpdated>
<lastUpdated>
2015080
4023457
</lastUpdated>
</versioning>
</metadata>
...
...
DevTools/repo/org/emercit/utilstools/maven-metadata.xml.md5
View file @
9f54c46
d34ae0920d262ed8a7e7789704f6bd3f
\ No newline at end of file
c9b18dea54a893e48d929c6b566329b1
\ No newline at end of file
...
...
DevTools/repo/org/emercit/utilstools/maven-metadata.xml.sha1
View file @
9f54c46
8b381d539ac70fc11e401d627b0d6ff9d263d66d
\ No newline at end of file
68228ae65b16d9fbc4558423f27c44a7e54d4b93
\ No newline at end of file
...
...
DevTools/src/main/java/org/emercit/devtools/app/ProxyController.java
View file @
9f54c46
...
...
@@ -56,22 +56,24 @@ public class ProxyController {
@RequestMapping
(
value
=
"proxy/update"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
MsgResult
update
(
@RequestBody
ProxyBean
[]
beans
)
{
Vector
<
ProxyBean
>
dbs
=
new
Vector
<
ProxyBean
>
();
Vector
<
ProxyBean
>
dbs
=
ProxyService
.
INSTANCE
.
getAllProxyBean
();
for
(
ProxyBean
d:
beans
)
{
for
(
int
i
=
0
;
i
<
beans
.
length
;
i
++)
{
for
(
ProxyBean
d:
dbs
)
{
ProxyBean
db
=
new
ProxyBean
();
if
(
d
.
getProtocol
().
equals
(
beans
[
i
].
getProtocol
()))
{
//db.setId(d.getId());
db
.
setProtocol
(
d
.
getProtocol
());
db
.
setHost
(
d
.
getHost
());
db
.
setPort
(
d
.
getPort
());
db
.
setLogin
(
d
.
getLogin
());
db
.
setPass
(
d
.
getPass
());
db
.
setEnabled
(
d
.
getEnabled
());
// db.setAuth(d.getAuth());
dbs
.
add
(
db
);
d
.
setProtocol
(
beans
[
i
].
getProtocol
());
d
.
setHost
(
beans
[
i
].
getHost
());
d
.
setPort
(
beans
[
i
].
getPort
());
d
.
setLogin
(
beans
[
i
].
getLogin
());
d
.
setPass
(
beans
[
i
].
getPass
());
d
.
setEnabled
(
beans
[
i
].
getEnabled
());
d
.
setUseauth
(
beans
[
i
].
getUseauth
());
}
}
}
return
Msg
.
getMsgResultByCode
(
ProxyService
.
INSTANCE
.
Upd
(
dbs
));
}
...
...
DevTools/src/main/java/org/emercit/devtools/service/EthService.java
View file @
9f54c46
...
...
@@ -42,7 +42,5 @@ public enum EthService {
public
int
Reload
(
EthBean
m
)
{
return
ethlinux
.
reload
(
m
.
getName
());
}
}
\ No newline at end of file
...
...
DevTools/src/main/webapp/resources/js/app/controller/Proxy.js
View file @
9f54c46
...
...
@@ -57,19 +57,20 @@ Ext.define('App.controller.Proxy', {
},
saveProxy
:
function
()
{
saveProxy
:
function
(
btn
)
{
//var proxyView = btn.up('mvvm-ProxyView');
//proxyView.mask("Сохранение...");
var
records
=
[];
records
.
push
(
this
.
getModelFromForm
(
0
,
"http"
));
records
.
push
(
this
.
getModelFromForm
(
1
,
"https"
));
records
.
push
(
this
.
getModelFromForm
(
2
,
"ftp"
));
records
.
push
(
this
.
getModelFromForm
(
"http"
));
records
.
push
(
this
.
getModelFromForm
(
"https"
));
records
.
push
(
this
.
getModelFromForm
(
"ftp"
));
var
data
=
Ext
.
util
.
JSON
.
encode
(
records
);
var
data
=
Ext
.
util
.
JSON
.
encode
(
records
);
Ext
.
Ajax
.
request
({
method
:
"POST"
,
url
:
'api/proxy/update'
,
...
...
@@ -79,12 +80,12 @@ Ext.define('App.controller.Proxy', {
},
params
:
data
,
success
:
function
(
response
,
opts
)
{
// proxyView.unmask();
var
result
=
Ext
.
JSON
.
decode
(
response
.
responseText
);
Ext
.
Msg
.
alert
(
result
.
type
+
" "
+
"Код-"
+
result
.
code
,
result
.
message
);
},
failure
:
function
(
response
,
opts
)
{
networksetting
View
.
unmask
();
proxy
View
.
unmask
();
Ext
.
Msg
.
alert
(
'Ошибка'
,
'Сервер недоступен'
);
}
});
...
...
@@ -94,58 +95,45 @@ Ext.define('App.controller.Proxy', {
},
getModelFromForm
:
function
(
id
,
protocol
)
{
var
host
;
var
port
;
var
login
;
var
pass
;
var
enabled
;
var
auth
;
var
proxy
;
getModelFromForm
:
function
(
protocol
)
{
var
formproxy
=
Ext
.
getCmp
(
"formproxy"
);
var
fsHttps
=
formproxy
.
down
(
'#fs'
+
protocol
);
enabled
=
fsHttps
.
checkboxCmp
.
getValue
();
host
=
fsHttps
.
down
(
'#'
+
protocol
+
'Adress'
).
getValue
();
port
=
parseInt
(
fsHttps
.
down
(
'#'
+
protocol
+
'Port'
).
getValue
());
var
enabled
=
fsHttps
.
checkboxCmp
.
getValue
();
if
(
port
==
null
)
{
port
=
0
;
}
var
host
=
fsHttps
.
down
(
'#'
+
protocol
+
'Adress'
).
getValue
();
var
port
=
parseInt
(
fsHttps
.
down
(
'#'
+
protocol
+
'Port'
).
getValue
());
var
fsHttpsAuth
=
fsHttps
.
down
(
'#fs'
+
protocol
+
'Auth'
);
auth
=
fsHttpsAuth
.
checkboxCmp
.
getValue
();
login
=
fsHttpsAuth
.
down
(
'#'
+
protocol
+
'Login'
).
getValue
();
pass
=
fsHttpsAuth
.
down
(
'#'
+
protocol
+
'Password'
).
getValue
();
var
useauth
=
fsHttpsAuth
.
checkboxCmp
.
getValue
();
proxy
=
{
id
:
id
,
var
login
=
fsHttpsAuth
.
down
(
'#'
+
protocol
+
'Login'
).
getValue
();
var
pass
=
fsHttpsAuth
.
down
(
'#'
+
protocol
+
'Password'
).
getValue
();
var
proxy
=
{
protocol
:
protocol
,
host
:
host
,
port
:
0
,
port
:
port
,
login
:
login
,
pass
:
pass
,
enabled
:
enabled
,
auth
:
auth
useauth
:
use
auth
};
return
proxy
;
},
loadProxy
:
function
()
{
loadProxy
:
function
(
btn
)
{
// var proxyView = btn.up('mvvm-ProxyView');
// proxyView.mask("Загрузка...");
Ext
.
Ajax
.
request
({
method
:
"GET"
,
...
...
@@ -156,15 +144,20 @@ Ext.define('App.controller.Proxy', {
},
success
:
function
(
response
,
opts
)
{
var
result
=
Ext
.
JSON
.
decode
(
response
.
responseText
);
// proxyView.unmask();
var
result
=
Ext
.
JSON
.
decode
(
response
.
responseText
);
for
(
var
i
in
result
){
this
.
setModelToForm
(
result
[
i
]);
this
.
setModelToForm
(
result
[
i
]);
}
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'Failure'
,
'Ошибка сохранения'
);
}
Ext
.
Msg
.
alert
(
'Успешно'
,
'Загрузка данных выполнена'
);
},
failure
:
function
(
response
,
opts
)
{
proxyView
.
unmask
();
Ext
.
Msg
.
alert
(
'Ошибка'
,
'Сервер недоступен'
);
}
});
}
...
...
DevTools/src/main/webapp/resources/js/app/view/Proxy.js
View file @
9f54c46
...
...
@@ -30,11 +30,7 @@ Ext.define('App.view.Proxy', {
},
items
:
[
{
xtype
:
'fieldset'
,
checkboxToggle
:
true
,
...
...
UtilsTools/src/main/java/org/emercit/ethmanager/service/EthLinux.java
View file @
9f54c46
...
...
@@ -20,13 +20,9 @@ public class EthLinux implements IEth {
private
CmdExec
cmdexec
=
new
CmdExec
();
private
Vector
<
EthBean
>
ebs
=
new
Vector
<
EthBean
>();
private
Db
db
=
new
Db
(
Paths
.
BEAN_ETH
);
private
Vector
<
String
>
extinfo
;
private
String
mac
;
private
EthBean
emp
;
public
EthLinux
()
{
...
...
@@ -38,8 +34,6 @@ public class EthLinux implements IEth {
public
int
reload
(
String
name
)
{
try
{
Vector
<
String
>
buff
=
cmdexec
.
Run
(
"ifdown"
+
" "
+
name
);
Thread
.
sleep
(
5000
);
...
...
@@ -54,7 +48,6 @@ public class EthLinux implements IEth {
log
.
error
(
e
.
getMessage
());
return
Msg
.
RestartEthErr
.
getCode
();
}
}
...
...
UtilsTools/src/main/java/org/emercit/proxymanager/model/ProxyBean.java
View file @
9f54c46
...
...
@@ -21,6 +21,10 @@ public class ProxyBean implements Serializable {
private
boolean
useauth
;
public
ProxyBean
()
{
...
...
@@ -56,7 +60,7 @@ public class ProxyBean implements Serializable {
this
.
enabled
=
value
;
}
public
void
setUse
A
uth
(
boolean
value
)
{
public
void
setUse
a
uth
(
boolean
value
)
{
this
.
useauth
=
value
;
}
...
...
@@ -66,32 +70,32 @@ public class ProxyBean implements Serializable {
*/
public
String
getProtocol
()
{
return
this
.
protocol
;
return
protocol
;
}
public
String
getHost
()
{
return
this
.
host
;
return
host
;
}
public
int
getPort
()
{
return
this
.
port
;
return
port
;
}
public
String
getLogin
()
{
return
this
.
login
;
return
login
;
}
public
String
getPass
()
{
return
this
.
pass
;
return
pass
;
}
public
boolean
getEnabled
()
{
return
this
.
enabled
;
return
enabled
;
}
public
boolean
getUse
A
uth
()
{
return
this
.
useauth
;
public
boolean
getUse
a
uth
()
{
return
useauth
;
}
...
...
UtilsTools/src/main/java/org/emercit/proxymanager/service/ProxyLinux.java
View file @
9f54c46
...
...
@@ -59,7 +59,7 @@ public class ProxyLinux implements IProxy {
for
(
ProxyBean
pb:
pbs
)
{
if
(
pb
.
getEnabled
())
{
if
(
pb
.
getUse
A
uth
())
{
if
(
pb
.
getUse
a
uth
())
{
bw
.
write
(
pb
.
getProtocol
()+
"_proxy"
+
"='"
+
"http://"
+
pb
.
getLogin
()+
":"
+
pb
.
getPass
()+
"@"
+
pb
.
getHost
()+
":"
+
pb
.
getPort
()+
"'\n"
);
}
else
{
bw
.
write
(
pb
.
getProtocol
()+
"_proxy"
+
"='"
+
"http://"
+
pb
.
getHost
()+
":"
+
pb
.
getPort
()+
"'\n"
);
...
...
@@ -90,7 +90,7 @@ public class ProxyLinux implements IProxy {
pmp
.
setPort
(
DefSettings
.
Proxy_http_port
);
pmp
.
setLogin
(
DefSettings
.
Proxy_http_login
);
pmp
.
setPass
(
DefSettings
.
Proxy_http_pass
);
pmp
.
setUse
A
uth
(
DefSettings
.
Proxy_http_useauth
);
pmp
.
setUse
a
uth
(
DefSettings
.
Proxy_http_useauth
);
pbs
.
add
(
pmp
);
//HTTPS PROXY
pmp
=
new
ProxyBean
();
...
...
@@ -100,7 +100,7 @@ public class ProxyLinux implements IProxy {
pmp
.
setPort
(
DefSettings
.
Proxy_https_port
);
pmp
.
setLogin
(
DefSettings
.
Proxy_https_login
);
pmp
.
setPass
(
DefSettings
.
Proxy_https_pass
);
pmp
.
setUse
A
uth
(
DefSettings
.
Proxy_https_useauth
);
pmp
.
setUse
a
uth
(
DefSettings
.
Proxy_https_useauth
);
pbs
.
add
(
pmp
);
//FTP PROXY
pmp
=
new
ProxyBean
();
...
...
@@ -110,7 +110,7 @@ public class ProxyLinux implements IProxy {
pmp
.
setPort
(
DefSettings
.
Proxy_ftp_port
);
pmp
.
setLogin
(
DefSettings
.
Proxy_ftp_login
);
pmp
.
setPass
(
DefSettings
.
Proxy_ftp_pass
);
pmp
.
setUse
A
uth
(
DefSettings
.
Proxy_ftp_useauth
);
pmp
.
setUse
a
uth
(
DefSettings
.
Proxy_ftp_useauth
);
pbs
.
add
(
pmp
);
return
Config
(
pbs
);
...
...
UtilsTools/src/main/java/org/emercit/utilstools/config/DefSettings.java
View file @
9f54c46
...
...
@@ -64,7 +64,7 @@ public class DefSettings {
public
static
final
String
Server_name
=
"Локальный сервер"
;
public
static
final
String
Server_ip
=
"127.0.0.1"
;
public
static
final
int
Server_port
=
80
;
public
static
final
String
Server_type
=
"
СЗС
"
;
public
static
final
String
Server_type
=
"
szs
"
;
public
static
final
String
Server_title
=
""
;
//JETTY
public
static
final
int
jetty_id
=
0
;
...
...
Please
register
or
sign in
to post a comment