Skip to content

Commit

Permalink
Move GP index into its own directory
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKolarik committed Aug 14, 2024
1 parent 9eff9b5 commit 1a87576
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/assets/js/app-globalping.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('./polyfills');
const http = require('./utils/http');

const _ = require('./_');
const cGlobalping = require('../../views/pages/globalping.html');
const cGlobalping = require('../../views/pages/globalping/index.html');
const cGlobalpingCli = require('../../views/pages/globalping/cli.html');
const cGlobalpingSlack = require('../../views/pages/globalping/slack.html');
const cGlobalpingNetworkTools = require('../../views/pages/globalping/network-tools.html');
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ koaElasticUtils.addRoutes(router, [
};

try {
ctx.body = await ctx.render('pages/' + (ctx.path === '/' ? '_index' : ctx.path) + '.html', data);
ctx.body = await ctx.render('pages/' + (ctx.path === '/' ? '_index' : ctx.path === '/globalping' ? 'globalping/index' : ctx.path) + '.html', data);
ctx.maxAge = 5 * 60;
} catch (e) {
if (app.env === 'development') {
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/sitemap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let packagesPromise = updatePackages();

module.exports = async (ctx) => {
ctx.params.page = ctx.params.page.replace(/\.xml$/, '');
let pages = (await readDirRecursive(viewsPath + '/pages', [ '_*' ])).map(p => path.relative(viewsPath + '/pages', p).replace(/\\/g, '/').slice(0, -5));
let pages = (await readDirRecursive(viewsPath + '/pages', [ '_*' ])).map(p => path.relative(viewsPath + '/pages', p).replace(/\\/g, '/').slice(0, -5).replace(/\/index$/, ''));
let packages = await packagesPromise;
let maxPage = Math.ceil(packages.length / 50000);
let page = Number(ctx.params.page);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<link rel="ractive" href="../r-page-globalping.html" name="r-page">
<link rel="ractive" href="../components/header.html" name="c-header">
<link rel="ractive" href="../components/footer.html" name="c-footer">
<link rel="ractive" href="../components/notification.html" name="c-notification">
<link rel="ractive" href="../components/controlled-input.html" name="c-controlled-input">
<link rel="ractive" href="../components/controlled-textarea.html" name="c-controlled-textarea">
<link rel="ractive" href="../components/tags-input.html" name="c-tags-input">
<link rel="ractive" href="../components/gp-results-controls.html" name="c-gp-results-controls">
<link rel="ractive" href="../components/gp-results-raw-output.html" name="c-gp-results-raw-output">
<link rel="ractive" href="../components/gp-results-table-output.html" name="c-gp-results-table-output">
<link rel="ractive" href="../components/gp-credits-message.html" name="c-gp-credits-message">
<link rel="ractive" href="../components/gp-top-navigation.html" name="c-gp-top-navigation">
<link rel="ractive" href="../components/gp-credits.html" name="c-gp-credits">
<link rel="ractive" href="../components/gp-jumbotron.html" name="c-gp-jumbotron">
<link rel="ractive" href="../../r-page-globalping.html" name="r-page">
<link rel="ractive" href="../../components/header.html" name="c-header">
<link rel="ractive" href="../../components/footer.html" name="c-footer">
<link rel="ractive" href="../../components/notification.html" name="c-notification">
<link rel="ractive" href="../../components/controlled-input.html" name="c-controlled-input">
<link rel="ractive" href="../../components/controlled-textarea.html" name="c-controlled-textarea">
<link rel="ractive" href="../../components/tags-input.html" name="c-tags-input">
<link rel="ractive" href="../../components/gp-results-controls.html" name="c-gp-results-controls">
<link rel="ractive" href="../../components/gp-results-raw-output.html" name="c-gp-results-raw-output">
<link rel="ractive" href="../../components/gp-results-table-output.html" name="c-gp-results-table-output">
<link rel="ractive" href="../../components/gp-credits-message.html" name="c-gp-credits-message">
<link rel="ractive" href="../../components/gp-top-navigation.html" name="c-gp-top-navigation">
<link rel="ractive" href="../../components/gp-credits.html" name="c-gp-credits">
<link rel="ractive" href="../../components/gp-jumbotron.html" name="c-gp-jumbotron">

<r-page
noYield="{{noYield}}"
Expand Down Expand Up @@ -1186,14 +1186,14 @@
</r-page>

<script>
const _ = require('../../assets/js/_.js');
const ipRegex = require('../../assets/js/utils/ip-regex');
const debounce = require('../../assets/js/utils/debounce');
const throttle = require('../../assets/js/utils/throttle');
const INITIAL_MAP_STYLES = require('../../assets/js/map/styles.json');
const clipboard = require('../../assets/js/decorators/clipboard');
const http = require('../../assets/js/utils/http');
const has = require('../../assets/js/utils/has');
const _ = require('../../../assets/js/_.js');
const ipRegex = require('../../../assets/js/utils/ip-regex');
const debounce = require('../../../assets/js/utils/debounce');
const throttle = require('../../../assets/js/utils/throttle');
const INITIAL_MAP_STYLES = require('../../../assets/js/map/styles.json');
const clipboard = require('../../../assets/js/decorators/clipboard');
const http = require('../../../assets/js/utils/http');
const has = require('../../../assets/js/utils/has');
const CLIENT_DEFAULT_PING_OPTS = {};
const API_DEFAULT_PING_OPTS = {};
const CLIENT_DEFAULT_TRACEROUTE_OPTS = {
Expand Down

0 comments on commit 1a87576

Please sign in to comment.