|
@@ -4,6 +4,7 @@ import React from 'react';
|
|
|
import * as url from 'url';
|
|
import * as url from 'url';
|
|
|
|
|
|
|
|
import { pathUtils } from '@growi/core';
|
|
import { pathUtils } from '@growi/core';
|
|
|
|
|
+import axios from 'axios';
|
|
|
import PropTypes from 'prop-types';
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -58,12 +59,16 @@ export class Lsx extends React.Component {
|
|
|
const pagePath = pathUtils.addTrailingSlash(lsxContext.pagePath);
|
|
const pagePath = pathUtils.addTrailingSlash(lsxContext.pagePath);
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.props.appContainer.apiGet('/plugins/lsx', { pagePath, options: lsxContext.options });
|
|
|
|
|
-
|
|
|
|
|
- lsxContext.toppageViewersCount = res.toppageViewersCount;
|
|
|
|
|
|
|
+ const res = await axios.get('/_api/plugins/lsx', {
|
|
|
|
|
+ params: {
|
|
|
|
|
+ pagePath,
|
|
|
|
|
+ options: lsxContext.options,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- if (res.ok) {
|
|
|
|
|
- const nodeTree = this.generatePageNodeTree(pagePath, res.pages);
|
|
|
|
|
|
|
+ if (res.data.ok) {
|
|
|
|
|
+ lsxContext.toppageViewersCount = res.data.toppageViewersCount;
|
|
|
|
|
+ const nodeTree = this.generatePageNodeTree(pagePath, res.data.pages);
|
|
|
this.setState({ nodeTree });
|
|
this.setState({ nodeTree });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|