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
3a8d7501
...
3a8d7501d9ad6e83ff8477277cb6fa70b18c02c6
authored
2015-07-21 18:22:21 +0400
by
root
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
save
1 parent
63205f6a
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
284 additions
and
6 deletions
DevTools/.settings/org.eclipse.core.resources.prefs
DevTools/pom.xml
DevTools/src/main/webapp/WEB-INF/spring/root-context.xml
DevTools/src/main/webapp/WEB-INF/spring/security.xml
DevTools/src/main/webapp/WEB-INF/views/anonymous.jsp
DevTools/src/main/webapp/WEB-INF/views/home.jsp
DevTools/src/main/webapp/WEB-INF/views/login.jsp
DevTools/src/main/webapp/resources/img/off.png
DevTools/src/main/webapp/resources/js/app.js
DevTools/src/main/webapp/resources/js/app/controller/DeviceControl.js
DevTools/src/main/webapp/resources/js/app/controller/MainConfig.js
DevTools/src/main/webapp/resources/js/app/view/DeviceControl.js
DevTools/.settings/org.eclipse.core.resources.prefs
0 → 100644
View file @
3a8d750
eclipse.preferences.version=1
encoding//src/main/webapp/WEB-INF/views/login.jsp=UTF-8
DevTools/pom.xml
View file @
3a8d750
...
...
@@ -55,6 +55,10 @@
<version>
${org.aspectj-version}
</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>
org.slf4j
</groupId>
...
...
@@ -123,6 +127,20 @@
<artifactId>
jstl
</artifactId>
<version>
1.2
</version>
</dependency>
<!-- Test -->
<dependency>
...
...
@@ -176,6 +194,9 @@
</dependency>
</dependencies>
...
...
DevTools/src/main/webapp/WEB-INF/spring/root-context.xml
View file @
3a8d750
...
...
@@ -3,4 +3,9 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
>
<!-- Файл с настройками безопасности -->
<import
resource=
"security.xml"
/>
</beans>
\ No newline at end of file
...
...
DevTools/src/main/webapp/WEB-INF/spring/security.xml
0 → 100644
View file @
3a8d750
<beans:beans
xmlns=
"http://www.springframework.org/schema/security"
xmlns:beans=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.xsd"
>
<http
access-denied-page=
"/error403.jsp"
>
<intercept-url
pattern=
"/"
access=
"ROLE_USER,ROLE_ANONYMOUS"
/>
<intercept-url
pattern=
"/add*"
access=
"ROLE_USER"
/>
<intercept-url
pattern=
"/delete/*"
access=
"ROLE_ADMIN"
/>
<form-login
login-page=
"/login.jsp"
default-target-url=
"/index"
authentication-failure-url=
"/login.jsp?error=true"
/>
<logout
logout-url=
"/logout"
logout-success-url=
"/index"
/>
<anonymous
username=
"guest"
granted-authority=
"ROLE_ANONYMOUS"
/>
<remember-me
/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user
name=
"admin"
password=
"pass"
authorities=
"ROLE_ADMIN,ROLE_USER"
/>
<user
name=
"user1"
password=
"1111"
authorities=
"ROLE_USER"
/>
<user
name=
"user2"
password=
"2222"
disabled=
"true"
authorities=
"ROLE_USER"
/>
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
\ No newline at end of file
DevTools/src/main/webapp/WEB-INF/views/anonymous.jsp
0 → 100755
View file @
3a8d750
<
%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head></head>
<body>
<h1>
Anonymous page
</h1>
<a
href=
"<c:url value="
/
login
.
html
"
/>
">To Login
</a>
</body>
</html>
\ No newline at end of file
DevTools/src/main/webapp/WEB-INF/views/home.jsp
View file @
3a8d750
<
%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<
%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
/>
...
...
@@ -40,11 +43,34 @@
}
.off
{
background-image
:
url(resources/img/off.png)
!important
;
}
</style>
</head>
<body>
<h1>
This is the body of the sample view
</h1>
<security:authorize
access=
"hasRole('ROLE_USER')"
>
This text is only visible to a user
<br/>
</security:authorize>
<security:authorize
access=
"hasRole('ROLE_ADMIN')"
>
This text is only visible to an admin
<br/>
</security:authorize>
<a
href=
"<c:url value="
/
perform_logout
"
/>
">Logout
</a>
</body>
</html>
...
...
DevTools/src/main/webapp/WEB-INF/views/login.jsp
0 → 100755
View file @
3a8d750
<
%@ page language="java" contentType="text/html; charset=utf8"
pageEncoding="utf8"%>
<
%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<
%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf8"
>
<title><spring:message
code=
"label.title"
/></title>
</head>
<body>
<a
href=
"<c:url value="
/
index
"
/>
">
<spring:message
code=
"label.contacts"
/>
</a><br/>
<c:if
test=
"${not empty param.error}"
>
<font
color=
"red"
>
<spring:message
code=
"label.loginerror"
/>
: ${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
</font>
</c:if>
<form
method=
"POST"
action=
"<c:url value="
/
j_spring_security_check
"
/>
">
<table>
<tr>
<td
align=
"right"
><spring:message
code=
"label.login"
/></td>
<td><input
type=
"text"
name=
"j_username"
/></td>
</tr>
<tr>
<td
align=
"right"
><spring:message
code=
"label.password"
/></td>
<td><input
type=
"password"
name=
"j_password"
/></td>
</tr>
<tr>
<td
align=
"right"
><spring:message
code=
"label.remember"
/></td>
<td><input
type=
"checkbox"
name=
"_spring_security_remember_me"
/></td>
</tr>
<tr>
<td
colspan=
"2"
align=
"right"
><input
type=
"submit"
value=
"Login"
/>
<input
type=
"reset"
value=
"Reset"
/></td>
</tr>
</table>
</form>
</body>
</html>
\ No newline at end of file
DevTools/src/main/webapp/resources/img/off.png
0 → 100644
View file @
3a8d750
688 Bytes
DevTools/src/main/webapp/resources/js/app.js
View file @
3a8d750
...
...
@@ -11,7 +11,8 @@ Ext.application({
'Proxy'
,
'DetailDns'
,
'DetailProxy'
,
'RemoteServer'
'RemoteServer'
,
'DeviceControl'
...
...
@@ -23,7 +24,8 @@ Ext.application({
'DetailDns'
,
'Dns'
,
'Proxy'
,
'RemoteServer'
'RemoteServer'
,
'DeviceControl'
],
...
...
@@ -117,7 +119,14 @@ Ext.application({
{
title
:
'Управление'
,
items
:[]
items
:[
{
xtype
:
'mvvm-DeviceControlView'
,
id
:
'formdevicecontrol'
}
]
}
]
}
...
...
DevTools/src/main/webapp/resources/js/app/controller/DeviceControl.js
0 → 100644
View file @
3a8d750
Ext
.
define
(
'App.controller.DeviceControl'
,
{
extend
:
'Ext.app.Controller'
,
init
:
function
()
{
this
.
control
({
'toolbar button[action=DcOff]'
:
{
click
:
this
.
DcOffClick
},
'toolbar button[action=DcReboot]'
:
{
click
:
this
.
DcRebootClick
}
});
},
DcOffClick
:
function
()
{
Ext
.
getBody
().
mask
(
'Выключение устройства ...'
);
/*
Ext.Ajax.request({
method: "GET",
url: 'api/devinfo/',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
success: function(response, opts) {
var result = Ext.JSON.decode(response.responseText);
Ext.getCmp('guid').setValue(result.guid);
Ext.getCmp('title').setValue(result.description);
}, failure: function(response, opts) {
}
});
*/
},
DcRebootClick
:
function
(
btn
)
{
Ext
.
getBody
().
mask
(
'Перезагрузка устройства ...'
);
/*
Ext.Ajax.request({
method: "GET",
url: 'api/devinfo/',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
success: function(response, opts) {
//var result = Ext.JSON.decode(response.responseText);
Ext.getBody('Перезагрузка устройства ...');
// Ext.getCmp('guid').setValue(result.guid);
// Ext.getCmp('title').setValue(result.description);
}, failure: function(response, opts) {
}
});
*/
}
});
DevTools/src/main/webapp/resources/js/app/controller/MainConfig.js
View file @
3a8d750
...
...
@@ -19,11 +19,8 @@ Ext.define('App.controller.MainConfig', {
},
onLoadButtonClick
:
function
()
{
Ext
.
Ajax
.
request
({
method
:
"GET"
,
url
:
'api/devinfo/'
,
...
...
DevTools/src/main/webapp/resources/js/app/view/DeviceControl.js
0 → 100644
View file @
3a8d750
Ext
.
define
(
'App.view.DeviceControl'
,
{
extend
:
'Ext.form.Panel'
,
xtype
:
'mvvm-DeviceControlView'
,
requires
:
[
],
frame
:
true
,
padding
:
10
,
bind
:
{
},
bbar
:
{
items
:
[{
xtype
:
'button'
,
iconCls
:
'off'
,
itemId
:
'btnOffDc'
,
text
:
'Выключить'
,
action
:
'DcOff'
,
disabled
:
false
},
{
xtype
:
'button'
,
iconCls
:
'restart'
,
itemId
:
'btnRebootDc'
,
text
:
'Перезагрузить'
,
action
:
'DcReboot'
,
disabled
:
false
}]
},
items
:
[]
});
\ No newline at end of file
Please
register
or
sign in
to post a comment