add gateway reload
This commit is contained in:
parent
226cdd6cce
commit
f60a0d129e
Binary file not shown.
13
cms/pom.xml
13
cms/pom.xml
@ -77,10 +77,23 @@
|
|||||||
<groupId>com.wacai.tigon</groupId>
|
<groupId>com.wacai.tigon</groupId>
|
||||||
<artifactId>tigon-web-controller</artifactId>
|
<artifactId>tigon-web-controller</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.pudonghot.yo</groupId>
|
||||||
|
<artifactId>yo-fsesl-api</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.dubbo</groupId>
|
||||||
|
<artifactId>dubbo-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.dubbo</groupId>
|
||||||
|
<artifactId>dubbo-dependencies-zookeeper</artifactId>
|
||||||
|
<type>pom</type>
|
||||||
|
</dependency>
|
||||||
<!-- Provided Dependencies -->
|
<!-- Provided Dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
|
@ -1,19 +1,26 @@
|
|||||||
package com.pudonghot.yo.cms.controller;
|
package com.pudonghot.yo.cms.controller;
|
||||||
|
|
||||||
import com.pudonghot.yo.cms.form.create.CreateFormGateway;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.wacai.tigon.form.FormList;
|
import com.wacai.tigon.form.FormList;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
import com.pudonghot.yo.model.domain.Gateway;
|
import com.pudonghot.yo.model.domain.Gateway;
|
||||||
import com.wacai.tigon.web.annotation.ListApi;
|
import com.wacai.tigon.web.annotation.ListApi;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.freeswitch.esl.client.EslClientApi;
|
||||||
import com.wacai.tigon.web.annotation.FilterCol;
|
import com.wacai.tigon.web.annotation.FilterCol;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
import com.wacai.tigon.web.controller.BaseCrudController;
|
import com.wacai.tigon.web.controller.BaseCrudController;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.pudonghot.yo.cms.form.create.CreateFormGateway;
|
||||||
import com.pudonghot.yo.cms.form.update.UpdateFormGateway;
|
import com.pudonghot.yo.cms.form.update.UpdateFormGateway;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.freeswitch.esl.client.transport.message.Message;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Donghuang <br>
|
* @author Donghuang <br>
|
||||||
* Nov 01, 2019 22:53:11
|
* Nov 01, 2019 22:53:11
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Controller
|
@Controller
|
||||||
@ListApi(searchCols = {
|
@ListApi(searchCols = {
|
||||||
Gateway.NAME,
|
Gateway.NAME,
|
||||||
@ -29,4 +36,17 @@ public class GatewayController
|
|||||||
FormList,
|
FormList,
|
||||||
CreateFormGateway,
|
CreateFormGateway,
|
||||||
UpdateFormGateway> {
|
UpdateFormGateway> {
|
||||||
|
@Autowired
|
||||||
|
private EslClientApi clientApi;
|
||||||
|
|
||||||
|
@PostMapping("/reload-mod-sofia")
|
||||||
|
public void reloadModSofia() {
|
||||||
|
final Message resp = clientApi.api("reload", "mod_sofia");
|
||||||
|
Assert.state(resp.isReplyOk(),
|
||||||
|
() -> {
|
||||||
|
log.error("Reload mod sofia failed [{}] [{}].",
|
||||||
|
resp.getHeaders(), resp.getBody());
|
||||||
|
return "Reload mod_sofia failed";
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,6 @@ spring.servlet.multipart.max-file-size=256MB
|
|||||||
spring.servlet.multipart.max-request-size=256MB
|
spring.servlet.multipart.max-request-size=256MB
|
||||||
site.context-path=
|
site.context-path=
|
||||||
|
|
||||||
# Feign
|
|
||||||
feign.client.config.default.logger-level=full
|
|
||||||
|
|
||||||
# Datasource
|
# Datasource
|
||||||
yo.datasource.url=jdbc:mysql://localhost/yoqw?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
|
yo.datasource.url=jdbc:mysql://localhost/yoqw?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
|
||||||
yo.datasource.username=yoqw
|
yo.datasource.username=yoqw
|
||||||
@ -42,3 +39,9 @@ tigon.shiro.filter-chain=${site.context-path}/auth/login=anon \
|
|||||||
yo.cms.sound.store-dir=/Users/chyxion/cms-sound
|
yo.cms.sound.store-dir=/Users/chyxion/cms-sound
|
||||||
yo.cms.sound.base-path=http://localhost:8180/sound/file/
|
yo.cms.sound.base-path=http://localhost:8180/sound/file/
|
||||||
|
|
||||||
|
# Dubbo
|
||||||
|
|
||||||
|
## Dubbo Registry
|
||||||
|
dubbo.registry.address=zookeeper://localhost:2181
|
||||||
|
dubbo.registry.file=${user.home}/dubbo-cache/${spring.application.name}/dubbo.cache
|
||||||
|
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
|
http://dubbo.apache.org/schema/dubbo
|
||||||
|
http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
|
||||||
|
|
||||||
|
<dubbo:reference id="eslClientApi"
|
||||||
|
interface="org.freeswitch.esl.client.EslClientApi"
|
||||||
|
cluster="broadcast"
|
||||||
|
/>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
@ -3,4 +3,15 @@ import BaseListRoute from './../base-list';
|
|||||||
export default BaseListRoute.extend({
|
export default BaseListRoute.extend({
|
||||||
perm: 'PERM_VIEW_GATEWAY_LIST',
|
perm: 'PERM_VIEW_GATEWAY_LIST',
|
||||||
breadcrumbs: [{text: '网关列表'}],
|
breadcrumbs: [{text: '网关列表'}],
|
||||||
|
actions: {
|
||||||
|
reloadModSofia() {
|
||||||
|
const me = this;
|
||||||
|
me.get('dialog').confirm('确认要重新加载网关配置么,请谨慎操作!', () => {
|
||||||
|
me.get('service').ajaxPost('reload-mod-sofia')
|
||||||
|
.then(() => {
|
||||||
|
me.get('message').alert('重新加载网关配置成功');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
@ -8,6 +8,14 @@
|
|||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
{{/has-perm}}
|
{{/has-perm}}
|
||||||
|
{{#has-perm 'PERM_VIEW_GATEWAY_RELOAD'}}
|
||||||
|
<li>
|
||||||
|
{{#a-btn click=(route-action 'reloadModSofia')}}
|
||||||
|
<i class="ace-icon fa fa-gears bigger-120"></i>
|
||||||
|
重新加载网关
|
||||||
|
{{/a-btn}}
|
||||||
|
</li>
|
||||||
|
{{/has-perm}}
|
||||||
{{/grid-header}}
|
{{/grid-header}}
|
||||||
|
|
||||||
<div class="widget-body">
|
<div class="widget-body">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user