mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: generic frontend resource handler (usable for CE and PRO)
parent
7ba1b2bb12
commit
7f1fd28438
|
@ -43,7 +43,7 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"build": "./node_modules/@angular/cli/bin/ng build --base-href /dashboard/ --output-path ../main/resources/static/dashboard",
|
||||
"build-prod": "./node_modules/@angular/cli/bin/ng build --base-href /dashboard/ --prod --output-path ../main/resources/static/dashboard",
|
||||
"build-prod": "./node_modules/@angular/cli/bin/ng build --prod --base-href /dashboard/ --output-path ../main/resources/static/dashboard",
|
||||
"e2e": "ng e2e",
|
||||
"lint": "ng lint",
|
||||
"ng": "ng",
|
||||
|
|
|
@ -352,7 +352,7 @@ public class OpenviduConfig {
|
|||
return !"/opt/openvidu/custom-layout".equals(path);
|
||||
}
|
||||
|
||||
public String getOpenViduRecordingDefaultLayoutsPath() {
|
||||
public String getOpenViduFrontendDefaultPath() {
|
||||
return "dashboard";
|
||||
}
|
||||
|
||||
|
|
|
@ -539,7 +539,7 @@ public class ComposedRecordingService extends RecordingService {
|
|||
log.error(e.getMessage());
|
||||
}
|
||||
String defaultPathForDefaultLayout = recordingComposedUrlDefined ? ""
|
||||
: ("/" + openviduConfig.getOpenViduRecordingDefaultLayoutsPath());
|
||||
: ("/" + openviduConfig.getOpenViduFrontendDefaultPath());
|
||||
finalUrl = (startsWithHttp ? "http" : "https") + "://OPENVIDUAPP:" + secret + "@" + recordingUrl
|
||||
+ defaultPathForDefaultLayout + "/#/layout-" + layout + "/" + recording.getSessionId() + "/"
|
||||
+ secret + "/" + port + "/" + !recording.hasAudio();
|
||||
|
|
|
@ -17,23 +17,35 @@
|
|||
|
||||
package io.openvidu.server.resources;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import io.openvidu.server.config.OpenviduConfig;
|
||||
|
||||
/**
|
||||
* This class changes the path where static files are served from / to
|
||||
* /dashboard. Entrypoint file index.html must have tag <base href="/dashboard/">
|
||||
* /NEW_FRONTEND_PATH. Entrypoint file index.html must have tag
|
||||
* <base href="/NEW_FRONTEND_PATH/">
|
||||
*
|
||||
* By default in OpenVidu CE this path is /dashbaord and in OpenVidu PRO is
|
||||
* /inspector
|
||||
*
|
||||
* @author Pablo Fuente (pablofuenteperez@gmail.com)
|
||||
*/
|
||||
@Configuration
|
||||
public class DashboardResourceHandler extends WebMvcConfigurerAdapter {
|
||||
public class FrontendResourceHandler extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Autowired
|
||||
OpenviduConfig openviduConfig;
|
||||
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/dashboard").setViewName("redirect:/dashboard/");
|
||||
registry.addViewController("/dashboard/").setViewName("forward:/dashboard/index.html");
|
||||
registry.addViewController("/" + openviduConfig.getOpenViduFrontendDefaultPath())
|
||||
.setViewName("redirect:/" + openviduConfig.getOpenViduFrontendDefaultPath() + "/");
|
||||
registry.addViewController("/" + openviduConfig.getOpenViduFrontendDefaultPath() + "/")
|
||||
.setViewName("forward:/" + openviduConfig.getOpenViduFrontendDefaultPath() + "/index.html");
|
||||
super.addViewControllers(registry);
|
||||
}
|
||||
|
Loading…
Reference in New Issue