我正在尝试使用 Highcharts Javascript 图表引擎绘制一些图表,我已经设置好了,它在我的本地开发环境中运行良好,但是当我将它部署到 Gitlab 并访问它时,它给了我以下错误:
ERROR TypeError: Cannot set property 'proceed' of undefined
at t.<computed> (main-es2015.7538dcc357c548058d75.js:1)
at Object.<anonymous> (main-es2015.7538dcc357c548058d75.js:1)
at Object.t.<computed> [as arc] (main-es2015.7538dcc357c548058d75.js:1)
at A.getPlotBandPath (main-es2015.7538dcc357c548058d75.js:1)
at s.renderBackground (main-es2015.7538dcc357c548058d75.js:1)
at s.render (main-es2015.7538dcc357c548058d75.js:1)
at main-es2015.7538dcc357c548058d75.js:1
at Array.forEach (<anonymous>)
at t.each (main-es2015.7538dcc357c548058d75.js:1)
at t.Chart.<anonymous> (main-es2015.7538dcc357c548058d75.js:1)
Run Code Online (Sandbox Code Playgroud)
我试图从我的公共项目中获取我的 Gitlab 提交,以便分析来自特定语言或库的提交数量并将它们放在图表中,以便用户可以看到差异。
我用谷歌搜索了这个错误,我发现了非常相似的错误,但没有一个是我问题的解决方案。我也尝试proceed在我的平台中寻找该属性,但看起来它是 highcharts 在执行时正在运行或调用的东西。
我正在使用它来构建组件:
if (this.data.gitlab) {
this.seriesData.push({
name: 'GitLab',
y: this.data.gitlab,
color: '#e24329',
radius: `${radius}%`,
innerRadius: `${radius - 7}%`
});
this.seriesBackgrounds.push({
outerRadius: `${radius}%`,
innerRadius: `${radius - 7}%`,
borderWidth: 0 …Run Code Online (Sandbox Code Playgroud) 我正在尝试修复在我的页面上搜索时遇到的错误。我有一个组件可以在我的所有设置中进行搜索,如下所示:
一切正常,搜索正在返回它应该返回的值,但是当我删除搜索条件时,我注意到条件的第一个字母仍然显示并且不会消失,即使搜索设置字段为空,像这样:
经过两个小时的代码检查,我可以看到代码中的问题所在,但我不知道如何修复它。
这是我的组件的 html:
<mat-form-field appearance="standard">
<input matInput
pageSearch
placeholder="{{'searchSettings'|translate}}">
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)
如您所见,我正在使用一个名为的指令pageSearch,该指令定义如下,并包含一个valueChange每次释放键盘键时执行的方法:
ngAfterViewInit() {
const subscription = this.router.events
.pipe(filter(e => e instanceof NavigationStart))
.subscribe(event => {
if (event) {
this.pageSearchService.term.next('');
}
}
);
this.subscriptionsManager.add(subscription);
}
@HostListener('keyup')
valueChange() {
this.pageSearchService.term.next(
this.elementRef.nativeElement.value
);
}
Run Code Online (Sandbox Code Playgroud)
该指令使用pageSearchService, 定义如下:
@Injectable()
export class PageSearchService {
/**
* Current search term.
*/
term: BehaviorSubject<string>;
/**
* Event to emit when visibility should change in the searchable.
*/
searchableMatch: EventEmitter<any> = …Run Code Online (Sandbox Code Playgroud) 我正在我的平台中实现 WebSockets 连接。我在前端使用 Angular 10,并在 SockJS Client 1.5.0 上使用 StompJS 2.3.3 来建立与后端的连接。
我创建了一个 WebSockets 服务来管理连接,它正在连接并且工作正常。
这是我创建的服务:
export class WebSocketsService implements OnDestroy {
/**
* The authentication service to get the token from.
*/
private authenticationService: AuthenticationService;
private serverUrl = environment['ceNotificationsServer'];
private socket;
private state: BehaviorSubject<SocketClientState>;
public constructor(authenticationService: AuthenticationService) {
this.authenticationService = authenticationService;
const client_id = environment['ceNotificationsClientId'];
const token = this.authenticationService.getToken();
const url = this.serverUrl + '/websocket' + '?clientId=' + client_id + '&Authorization=' + token;
const ws = new SockJS(url);
this.socket …Run Code Online (Sandbox Code Playgroud) 我正在构建一个视图,然后我意识到我需要在里面放太多信息,所以它不适合窗口。所以我决定创建一个 JScrollPane 来把所有元素放在里面,如果需要,继续包含新元素,能够在我的窗口中看到它。
这是我的滚动窗格的代码:
public JPanel getActionsPane() {
if (Objects.isNull(actionsPane)){
actionsPane = new JPanel();
actionsPane.setLayout(null);
actionsPane.setBounds(0, 29, 1580, 1450);
addComponents();
}
return actionsPane;
}
public JScrollPane getActionsScrollPane() {
if (Objects.isNull(actionsScrollPane)){
actionsScrollPane = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
actionsScrollPane.add(getActionsPane());
actionsScrollPane.setLayout(new ScrollPaneLayout());
actionsScrollPane.setBounds(0, 29, 593, 400);
actionsScrollPane.setViewportView(getActionsPane());
}
return actionsScrollPane;
}
Run Code Online (Sandbox Code Playgroud)
但是当我编译时,我只能看到这个:
[![运行时的 JScrollPane]](https://i.stack.imgur.com/RUm5k.png)
如您所见,未显示滚动条。过去我没有经常使用 JScrollPane,也许我缺少一些启用滚动的属性?
angular ×2
gitlab ×1
highcharts ×1
java ×1
javascript ×1
jscrollpane ×1
sockjs ×1
stomp ×1
swing ×1
typescript ×1
websocket ×1