Commit 3a8d7501 3a8d7501d9ad6e83ff8477277cb6fa70b18c02c6 by root

save

1 parent 63205f6a
eclipse.preferences.version=1
encoding//src/main/webapp/WEB-INF/views/login.jsp=UTF-8
......@@ -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>
......
......@@ -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
......
<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
<%@ 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
<%@ 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>
......
<%@ 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
......@@ -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'
}
]
}
]
}
......
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) {
}
});
*/
}
});
......@@ -19,11 +19,8 @@ Ext.define('App.controller.MainConfig', {
},
onLoadButtonClick:function() {
Ext.Ajax.request({
method: "GET",
url: 'api/devinfo/',
......
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