diff --git a/src/main/java/com/rekoe/service/ProjectConfigService.java b/src/main/java/com/rekoe/service/ProjectConfigService.java new file mode 100644 index 0000000..e7a09bf --- /dev/null +++ b/src/main/java/com/rekoe/service/ProjectConfigService.java @@ -0,0 +1,37 @@ +package com.rekoe.service; + +import org.nutz.dao.Dao; +import org.nutz.ioc.loader.annotation.IocBean; + +import com.rekoe.domain.ProjectConfig; + +/** + * @author 科技㊣²º¹³
+ * 2016年3月24日 下午4:48:45
+ * http://www.rekoe.com
+ * QQ:5382211 + */ +@IocBean(args = { "refer:dao" }, create = "init") +public class ProjectConfigService extends BaseService { + + public ProjectConfigService(Dao dao) { + super(dao); + } + + public ProjectConfig get() { + ProjectConfig conf = dao().fetch(getEntityClass()); + return conf; + } + + public boolean update(String repoPath, String domainPath) { + ProjectConfig conf = get(); + conf.setDomainPath(domainPath); + conf.setRepositoryPath(repoPath); + dao().update(conf); + return true; + } + + public void init() { + get(); + } +} diff --git a/src/main/webapp/WEB-INF/template/admin/project/list.ftl b/src/main/webapp/WEB-INF/template/admin/project/list.ftl index 7bbfbb3..56db0a5 100644 --- a/src/main/webapp/WEB-INF/template/admin/project/list.ftl +++ b/src/main/webapp/WEB-INF/template/admin/project/list.ftl @@ -30,9 +30,9 @@ function getTableForm() { <@p.column title="描述" align="center">${user.des}<#t/> <@p.column title="设置用户组" align="center">设置用户组<#t/> <@p.column title="设置权限" align="center">设置权限<#t/> - <@shiro.hasPermission name="svn.user:edit"> + <@shiro.hasPermission name="svn.project:auth.manager"> <@p.column title="编辑" align="center"> - 删除<#rt/> + 删除<#rt/> <#t/> diff --git a/src/main/webapp/res/cms/js/admin.js b/src/main/webapp/res/cms/js/admin.js index c1a7bdf..d7978ce 100644 --- a/src/main/webapp/res/cms/js/admin.js +++ b/src/main/webapp/res/cms/js/admin.js @@ -165,4 +165,29 @@ Cms.updateAll = function(url,back){ } }); return false; +} +Cms.deleted = function(id){ + $.dialog({ + type: "warn", + content: '确定要删除此记录?', + ok: 'Ok', + cancel: 'Cancel', + onOk: function() { + $.ajax({ + url: "delete.rk", + type: "POST", + data: {"id":id}, + dataType: "json", + cache: false, + success: function(message) { + $.message(message); + if (message.type == "success") + { + window.location.href = back; + } + } + }); + } + }); + return false; } \ No newline at end of file