diff --git a/app/Checkers/OpenGraph.php b/app/Checkers/OpenGraph.php new file mode 100644 index 0000000..5abe566 --- /dev/null +++ b/app/Checkers/OpenGraph.php @@ -0,0 +1,37 @@ +website = $website; + } + + public function run() + { + $this->fetch(); + } + + private function fetch() + { + $info = Embed::create($this->website->url); + + $scan = new OpenGraphScan([ + 'title' => $info->title, + 'description' => $info->description, + 'image' => $info->image, + 'url' => $info->url, + 'icon' => $info->providerIcon, + ]); + + $this->website->openGraph()->save($scan); + } +} diff --git a/app/Checkers/Robots.php b/app/Checkers/Robots.php index 7da2dba..99d9e1f 100644 --- a/app/Checkers/Robots.php +++ b/app/Checkers/Robots.php @@ -8,7 +8,6 @@ use SebastianBergmann\Diff\Differ; use App\Notifications\RobotsHasChanged; - class Robots { private $website; diff --git a/app/Checkers/Uptime.php b/app/Checkers/Uptime.php index f4f3b9d..4e10743 100644 --- a/app/Checkers/Uptime.php +++ b/app/Checkers/Uptime.php @@ -10,7 +10,6 @@ use App\Notifications\WebsiteIsDown; use App\Notifications\WebsiteIsBackUp; - class Uptime { private $website; diff --git a/app/Console/Commands/OpenGraphCheckCommand.php b/app/Console/Commands/OpenGraphCheckCommand.php new file mode 100644 index 0000000..02ee7d1 --- /dev/null +++ b/app/Console/Commands/OpenGraphCheckCommand.php @@ -0,0 +1,49 @@ +argument('website'); + + OpenGraphCheck::dispatchNow( + Website::findOrFail($websiteId) + ); + } +} diff --git a/app/Console/Commands/ScanCertificateCommand.php b/app/Console/Commands/ScanCertificateCommand.php index 0e31865..4b9ed15 100644 --- a/app/Console/Commands/ScanCertificateCommand.php +++ b/app/Console/Commands/ScanCertificateCommand.php @@ -2,6 +2,11 @@ namespace App\Console\Commands; +use App\Jobs\CertificateCheck; +use App\Jobs\DnsCheck; +use App\Jobs\RobotsCheck; +use App\Jobs\UptimeCheck; +use App\Website; use Illuminate\Console\Command; class ScanCertificateCommand extends Command @@ -11,7 +16,7 @@ class ScanCertificateCommand extends Command * * @var string */ - protected $signature = 'command:name'; + protected $signature = 'scan:certificate'; /** * The console command description. @@ -37,6 +42,9 @@ public function __construct() */ public function handle() { - // + Website::all()->each(function (Website $website) { + CertificateCheck::dispatch($website); + dump('Certificate check queued for ' . $website->url); + }); } } diff --git a/app/Console/Commands/ScanDnsCommand.php b/app/Console/Commands/ScanDnsCommand.php index 682337a..24c1b7b 100644 --- a/app/Console/Commands/ScanDnsCommand.php +++ b/app/Console/Commands/ScanDnsCommand.php @@ -2,6 +2,9 @@ namespace App\Console\Commands; +use App\Jobs\CertificateCheck; +use App\Jobs\DnsCheck; +use App\Website; use Illuminate\Console\Command; class ScanDnsCommand extends Command @@ -11,7 +14,7 @@ class ScanDnsCommand extends Command * * @var string */ - protected $signature = 'command:name'; + protected $signature = 'scan:dns'; /** * The console command description. @@ -37,6 +40,9 @@ public function __construct() */ public function handle() { - // + Website::all()->each(function (Website $website) { + DnsCheck::dispatch($website); + dump('DNS check queued for ' . $website->url); + }); } } diff --git a/app/Console/Commands/ScanOpenGraphCommand.php b/app/Console/Commands/ScanOpenGraphCommand.php new file mode 100644 index 0000000..c89c9ad --- /dev/null +++ b/app/Console/Commands/ScanOpenGraphCommand.php @@ -0,0 +1,48 @@ +each(function (Website $website) { + OpenGraphCheck::dispatch($website); + dump('Open Graph check queued for ' . $website->url); + }); + } +} diff --git a/app/Console/Commands/ScanRobotsCommand.php b/app/Console/Commands/ScanRobotsCommand.php index d2d2c7e..9ed93ee 100644 --- a/app/Console/Commands/ScanRobotsCommand.php +++ b/app/Console/Commands/ScanRobotsCommand.php @@ -2,6 +2,9 @@ namespace App\Console\Commands; +use App\Jobs\CertificateCheck; +use App\Jobs\RobotsCheck; +use App\Website; use Illuminate\Console\Command; class ScanRobotsCommand extends Command @@ -11,7 +14,7 @@ class ScanRobotsCommand extends Command * * @var string */ - protected $signature = 'command:name'; + protected $signature = 'scan:robots'; /** * The console command description. @@ -37,6 +40,9 @@ public function __construct() */ public function handle() { - // + Website::all()->each(function (Website $website) { + RobotsCheck::dispatch($website); + dump('Robots check queued for ' . $website->url); + }); } } diff --git a/app/Console/Commands/ScanUptimeCommand.php b/app/Console/Commands/ScanUptimeCommand.php index 203cec0..793c71b 100644 --- a/app/Console/Commands/ScanUptimeCommand.php +++ b/app/Console/Commands/ScanUptimeCommand.php @@ -2,6 +2,9 @@ namespace App\Console\Commands; +use App\Jobs\CertificateCheck; +use App\Jobs\UptimeCheck; +use App\Website; use Illuminate\Console\Command; class ScanUptimeCommand extends Command @@ -11,7 +14,7 @@ class ScanUptimeCommand extends Command * * @var string */ - protected $signature = 'command:name'; + protected $signature = 'scan:uptime'; /** * The console command description. @@ -37,6 +40,9 @@ public function __construct() */ public function handle() { - // + Website::all()->each(function (Website $website) { + UptimeCheck::dispatch($website); + dump('Uptime check queued for ' . $website->url); + }); } } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 87a6db7..19aa82e 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -33,6 +33,7 @@ protected function schedule(Schedule $schedule) $schedule->command('scan:robots')->hourly()->withoutOverlapping()->runInBackground(); $schedule->command('scan:dns')->hourly()->withoutOverlapping()->runInBackground(); $schedule->command('scan:certificate')->dailyAt('08:00:00')->withoutOverlapping()->runInBackground(); + $schedule->command('scan:opengraph')->dailyAt('08:00:00')->withoutOverlapping()->runInBackground(); } /** diff --git a/app/HasOpenGraph.php b/app/HasOpenGraph.php new file mode 100644 index 0000000..bd3beb8 --- /dev/null +++ b/app/HasOpenGraph.php @@ -0,0 +1,11 @@ +hasMany(OpenGraphScan::class); + } +} diff --git a/app/Http/Controllers/OpenGraphController.php b/app/Http/Controllers/OpenGraphController.php new file mode 100644 index 0000000..0e405d5 --- /dev/null +++ b/app/Http/Controllers/OpenGraphController.php @@ -0,0 +1,25 @@ +has('refresh')) { + OpenGraphCheck::dispatchNow($website); + } + + return $website->openGraph()->latest()->first(); + } +} diff --git a/app/Jobs/OpenGraphCheck.php b/app/Jobs/OpenGraphCheck.php new file mode 100644 index 0000000..d551fe9 --- /dev/null +++ b/app/Jobs/OpenGraphCheck.php @@ -0,0 +1,42 @@ +website = $website; + } + + /** + * Execute the job. + * + * @return void + */ + public function handle() + { + $checker = new OpenGraph($this->website); + $checker->run(); + } +} diff --git a/app/OpenGraphScan.php b/app/OpenGraphScan.php new file mode 100644 index 0000000..29356e5 --- /dev/null +++ b/app/OpenGraphScan.php @@ -0,0 +1,15 @@ +bigIncrements('id'); + $table->bigInteger('website_id'); + $table->string('icon')->nullable(); + $table->string('title')->nullable(); + $table->string('description')->nullable(); + $table->string('url')->nullable(); + $table->string('image')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('open_graph_scans'); + } +} diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index e69de29..0000000 diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000..9a3dd48 Binary files /dev/null and b/public/favicon.png differ diff --git a/public/js/maelstrom.js b/public/js/maelstrom.js index 344b202..333d813 100644 --- a/public/js/maelstrom.js +++ b/public/js/maelstrom.js @@ -12957,7 +12957,7 @@ function (_Component) { }); } }, - loading: this.state.loading, + loading: this.state.loading || undefined, type: "primary", htmlType: "submit", icon: "save" @@ -20568,7 +20568,7 @@ function (_React$Component) { onClick: this.update, type: "default", icon: "save", - loading: this.state.busy, + loading: this.state.busy || undefined, disabled: !this.state.name }, this.state.busy ? 'Saving' : 'Save'), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(antd__WEBPACK_IMPORTED_MODULE_3__["Popconfirm"], { placement: "left", @@ -62521,10 +62521,10 @@ var _package_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpac /*!****************************************!*\ !*** ./node_modules/antd/package.json ***! \****************************************/ -/*! exports provided: _args, _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _spec, _where, browserslist, bugs, contributors, dependencies, description, devDependencies, files, homepage, husky, keywords, license, main, module, name, peerDependencies, publishConfig, repository, scripts, sideEffects, title, typings, version, default */ +/*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, browserslist, bugs, bundleDependencies, contributors, dependencies, deprecated, description, devDependencies, files, homepage, husky, keywords, license, main, module, name, peerDependencies, publishConfig, repository, scripts, sideEffects, title, typings, version, default */ /***/ (function(module) { -module.exports = JSON.parse("{\"_args\":[[\"antd@3.21.4\",\"/Users/storm/Documents/Websites/odin\"]],\"_from\":\"antd@3.21.4\",\"_id\":\"antd@3.21.4\",\"_inBundle\":false,\"_integrity\":\"sha512-ZtX2UAEewrWUepl4sT6TeJw91A98bgl4VGTjRIKfwzNW1GKGKKf4iI9bA6oCyMt/C4QEFsSsmkBwfBqT+N+Xzg==\",\"_location\":\"/antd\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"antd@3.21.4\",\"name\":\"antd\",\"escapedName\":\"antd\",\"rawSpec\":\"3.21.4\",\"saveSpec\":null,\"fetchSpec\":\"3.21.4\"},\"_requiredBy\":[\"/\",\"/@maelstrom-cms/toolkit\"],\"_resolved\":\"https://registry.npmjs.org/antd/-/antd-3.21.4.tgz\",\"_spec\":\"3.21.4\",\"_where\":\"/Users/storm/Documents/Websites/odin\",\"browserslist\":[\"last 2 version\",\"Firefox ESR\",\"> 1%\",\"ie >= 9\"],\"bugs\":{\"url\":\"https://github.com/ant-design/ant-design/issues\"},\"contributors\":[{\"name\":\"ant\"}],\"dependencies\":{\"@ant-design/create-react-context\":\"^0.2.4\",\"@ant-design/icons\":\"~2.1.1\",\"@ant-design/icons-react\":\"~2.0.1\",\"@types/react-slick\":\"^0.23.4\",\"array-tree-filter\":\"^2.1.0\",\"babel-runtime\":\"6.x\",\"classnames\":\"~2.2.6\",\"copy-to-clipboard\":\"^3.2.0\",\"css-animation\":\"^1.5.0\",\"dom-closest\":\"^0.2.0\",\"enquire.js\":\"^2.1.6\",\"lodash\":\"^4.17.13\",\"moment\":\"^2.24.0\",\"omit.js\":\"^1.0.2\",\"prop-types\":\"^15.7.2\",\"raf\":\"^3.4.1\",\"rc-animate\":\"^2.8.3\",\"rc-calendar\":\"~9.15.5\",\"rc-cascader\":\"~0.17.4\",\"rc-checkbox\":\"~2.1.6\",\"rc-collapse\":\"~1.11.3\",\"rc-dialog\":\"~7.5.2\",\"rc-drawer\":\"~2.0.1\",\"rc-dropdown\":\"~2.4.1\",\"rc-editor-mention\":\"^1.1.13\",\"rc-form\":\"^2.4.5\",\"rc-input-number\":\"~4.4.5\",\"rc-mentions\":\"~0.3.1\",\"rc-menu\":\"~7.4.23\",\"rc-notification\":\"~3.3.1\",\"rc-pagination\":\"~1.20.5\",\"rc-progress\":\"~2.5.0\",\"rc-rate\":\"~2.5.0\",\"rc-select\":\"~9.2.0\",\"rc-slider\":\"~8.6.11\",\"rc-steps\":\"~3.4.1\",\"rc-switch\":\"~1.9.0\",\"rc-table\":\"~6.7.0\",\"rc-tabs\":\"~9.6.4\",\"rc-time-picker\":\"~3.7.1\",\"rc-tooltip\":\"~3.7.3\",\"rc-tree\":\"~2.1.0\",\"rc-tree-select\":\"~2.9.1\",\"rc-trigger\":\"^2.6.2\",\"rc-upload\":\"~2.7.0\",\"rc-util\":\"^4.6.0\",\"react-lazy-load\":\"^3.0.13\",\"react-lifecycles-compat\":\"^3.0.4\",\"react-slick\":\"~0.24.0\",\"resize-observer-polyfill\":\"^1.5.1\",\"shallowequal\":\"^1.1.0\",\"warning\":\"~4.0.3\"},\"description\":\"An enterprise-class UI design language and React components implementation\",\"devDependencies\":{\"@ant-design/colors\":\"^3.1.0\",\"@ant-design/tools\":\"^8.0.4\",\"@packtracker/webpack-plugin\":\"^2.0.1\",\"@sentry/browser\":\"^5.4.0\",\"@types/classnames\":\"^2.2.8\",\"@types/prop-types\":\"^15.7.1\",\"@types/react\":\"^16.9.0\",\"@types/react-dom\":\"^16.8.4\",\"@types/warning\":\"^3.0.0\",\"@typescript-eslint/eslint-plugin\":\"^1.13.0\",\"@typescript-eslint/parser\":\"^1.13.0\",\"@yesmeck/offline-plugin\":\"^5.0.5\",\"antd-theme-generator\":\"^1.1.6\",\"babel-eslint\":\"^10.0.1\",\"babel-plugin-add-react-displayname\":\"^0.0.5\",\"bisheng\":\"^1.3.0\",\"bisheng-plugin-antd\":\"^1.0.2\",\"bisheng-plugin-description\":\"^0.1.4\",\"bisheng-plugin-react\":\"^1.0.0\",\"bisheng-plugin-toc\":\"^0.4.4\",\"chalk\":\"^2.4.2\",\"cross-env\":\"^5.2.0\",\"css-split-webpack-plugin\":\"^0.2.6\",\"dekko\":\"^0.2.1\",\"docsearch.js\":\"^2.6.3\",\"enquire-js\":\"^0.2.1\",\"enzyme\":\"^3.10.0\",\"enzyme-adapter-react-16\":\"^1.14.0\",\"enzyme-to-json\":\"^3.3.5\",\"eslint\":\"^6.1.0\",\"eslint-config-airbnb\":\"^17.1.0\",\"eslint-config-prettier\":\"^6.0.0\",\"eslint-plugin-babel\":\"^5.3.0\",\"eslint-plugin-import\":\"^2.17.3\",\"eslint-plugin-jest\":\"^22.6.4\",\"eslint-plugin-jsx-a11y\":\"^6.2.1\",\"eslint-plugin-markdown\":\"^1.0.0\",\"eslint-plugin-react\":\"^7.14.2\",\"eslint-tinker\":\"^0.5.0\",\"fetch-jsonp\":\"^1.1.3\",\"glob\":\"^7.1.4\",\"husky\":\"^3.0.2\",\"immutability-helper\":\"^3.0.0\",\"intersection-observer\":\"^0.7.0\",\"jest\":\"^24.8.0\",\"jsdom\":\"^15.1.1\",\"jsonml.js\":\"^0.1.0\",\"logrocket\":\"^1.0.0\",\"logrocket-react\":\"^3.0.0\",\"lz-string\":\"^1.4.4\",\"mockdate\":\"^2.0.2\",\"node-fetch\":\"^2.6.0\",\"preact\":\"^8.4.2\",\"preact-compat\":\"^3.18.5\",\"prettier\":\"^1.17.1\",\"pretty-quick\":\"^1.11.0\",\"querystring\":\"^0.2.0\",\"rc-queue-anim\":\"^1.6.12\",\"rc-scroll-anim\":\"^2.5.8\",\"rc-tween-one\":\"^2.4.1\",\"react\":\"^16.5.2\",\"react-color\":\"^2.17.3\",\"react-copy-to-clipboard\":\"^5.0.1\",\"react-dnd\":\"^9.0.0\",\"react-dnd-html5-backend\":\"^9.0.0\",\"react-document-title\":\"^2.0.3\",\"react-dom\":\"^16.5.2\",\"react-github-button\":\"^0.1.11\",\"react-highlight-words\":\"^0.16.0\",\"react-infinite-scroller\":\"^1.2.4\",\"react-intl\":\"^3.1.1\",\"react-resizable\":\"^1.8.0\",\"react-router\":\"^3.2.3\",\"react-router-dom\":\"^5.0.1\",\"react-sticky\":\"^6.0.3\",\"react-test-renderer\":\"^16.8.6\",\"react-virtualized\":\"~9.21.1\",\"reqwest\":\"^2.0.5\",\"rimraf\":\"^2.6.3\",\"scrollama\":\"^2.0.0\",\"simple-git\":\"^1.113.0\",\"stylelint\":\"^10.0.1\",\"stylelint-config-prettier\":\"^5.2.0\",\"stylelint-config-rational-order\":\"^0.1.2\",\"stylelint-config-standard\":\"^18.3.0\",\"stylelint-declaration-block-no-ignored-properties\":\"^2.1.0\",\"stylelint-order\":\"^3.0.0\",\"typescript\":\"~3.5.1\",\"xhr-mock\":\"^2.4.1\",\"xhr2\":\"^0.2.0\"},\"files\":[\"dist\",\"lib\",\"es\"],\"homepage\":\"http://ant.design/\",\"husky\":{\"hooks\":{\"pre-commit\":\"pretty-quick --staged\"}},\"keywords\":[\"ant\",\"design\",\"react\",\"react-component\",\"component\",\"components\",\"ui\",\"framework\",\"frontend\"],\"license\":\"MIT\",\"main\":\"lib/index.js\",\"module\":\"es/index.js\",\"name\":\"antd\",\"peerDependencies\":{\"react\":\">=16.0.0\",\"react-dom\":\">=16.0.0\"},\"publishConfig\":{\"registry\":\"https://registry.npmjs.org/\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/ant-design/ant-design.git\"},\"scripts\":{\"api-collection\":\"antd-tools run api-collection\",\"authors\":\"git log --format='%aN <%aE>' | sort -u | grep -v 'users.noreply.github.com' | grep -v 'gitter.im' | grep -v '.local>' | grep -v 'alibaba-inc.com' | grep -v 'alipay.com' | grep -v 'taobao.com' > AUTHORS.txt\",\"check-commit\":\"node ./scripts/check-commit.js\",\"compile\":\"antd-tools run compile\",\"deploy\":\"bisheng gh-pages --push-only\",\"deploy:china-mirror\":\"git checkout gh-pages && git pull origin gh-pages && git push git@gitee.com:ant-design/ant-design.git gh-pages\",\"dist\":\"antd-tools run dist\",\"lint\":\"npm run lint:ts && npm run lint:ts:with-eslint && npm run lint:es && npm run lint:demo && npm run lint:style && npm run lint:deps\",\"lint-fix\":\"npm run lint-fix:code && npm run lint-fix:demo && npm run lint-fix:style\",\"lint-fix:code\":\"eslint --fix tests site scripts components ./.*.js ./webpack.config.js --ext '.js,.jsx'\",\"lint-fix:demo\":\"eslint-tinker ./components/*/demo/*.md\",\"lint-fix:style\":\"stylelint --fix '{site,components}/**/*.less' --syntax less\",\"lint-fix:ts\":\"npm run tsc && antd-tools run ts-lint-fix\",\"lint:demo\":\"cross-env RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md' --rule 'import/no-unresolved: 0'\",\"lint:deps\":\"antd-tools run deps-lint\",\"lint:es\":\"eslint tests site scripts components ./.*.js ./webpack.config.js --ext '.js,.jsx'\",\"lint:md\":\"remark components/\",\"lint:style\":\"stylelint '{site,components}/**/*.less' --syntax less\",\"lint:ts\":\"npm run tsc && antd-tools run ts-lint\",\"lint:ts:with-eslint\":\"eslint components/**/*.tsx\",\"pre-publish\":\"npm run check-commit && npm run test-all\",\"predeploy\":\"antd-tools run clean && npm run site && cp netlify.toml CNAME _site && cp .circleci/config.yml _site\",\"prepublish\":\"antd-tools run guard\",\"prettier\":\"prettier -c --write '**/*'\",\"pretty-quick\":\"pretty-quick\",\"pub\":\"antd-tools run pub\",\"site\":\"bisheng build --ssr -c ./site/bisheng.config.js && node ./scripts/generateColorLess.js\",\"sort-api\":\"antd-tools run sort-api-table\",\"start\":\"rimraf _site && mkdir _site && node ./scripts/generateColorLess.js && cross-env NODE_ENV=development bisheng start -c ./site/bisheng.config.js\",\"start:preact\":\"node ./scripts/generateColorLess.js && cross-env NODE_ENV=development REACT_ENV=preact bisheng start -c ./site/bisheng.config.js\",\"test\":\"jest --config .jest.js --no-cache\",\"test-all\":\"./scripts/test-all.sh\",\"test-node\":\"jest --config .jest.node.js --no-cache\",\"tsc\":\"tsc\"},\"sideEffects\":[\"dist/*\",\"es/**/style/*\",\"lib/**/style/*\",\"*.less\"],\"title\":\"Ant Design\",\"typings\":\"lib/index.d.ts\",\"version\":\"3.21.4\"}"); +module.exports = JSON.parse("{\"_from\":\"antd\",\"_id\":\"antd@3.21.4\",\"_inBundle\":false,\"_integrity\":\"sha512-ZtX2UAEewrWUepl4sT6TeJw91A98bgl4VGTjRIKfwzNW1GKGKKf4iI9bA6oCyMt/C4QEFsSsmkBwfBqT+N+Xzg==\",\"_location\":\"/antd\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"tag\",\"registry\":true,\"raw\":\"antd\",\"name\":\"antd\",\"escapedName\":\"antd\",\"rawSpec\":\"\",\"saveSpec\":null,\"fetchSpec\":\"latest\"},\"_requiredBy\":[\"#USER\",\"/\",\"/@maelstrom-cms/toolkit\"],\"_resolved\":\"https://registry.npmjs.org/antd/-/antd-3.21.4.tgz\",\"_shasum\":\"6e5e8c6edde25ddce0aa1c666f0d6ef8d04e821e\",\"_spec\":\"antd\",\"_where\":\"/Users/owen/Sites/odin\",\"browserslist\":[\"last 2 version\",\"Firefox ESR\",\"> 1%\",\"ie >= 9\"],\"bugs\":{\"url\":\"https://github.com/ant-design/ant-design/issues\"},\"bundleDependencies\":false,\"contributors\":[{\"name\":\"ant\"}],\"dependencies\":{\"@ant-design/create-react-context\":\"^0.2.4\",\"@ant-design/icons\":\"~2.1.1\",\"@ant-design/icons-react\":\"~2.0.1\",\"@types/react-slick\":\"^0.23.4\",\"array-tree-filter\":\"^2.1.0\",\"babel-runtime\":\"6.x\",\"classnames\":\"~2.2.6\",\"copy-to-clipboard\":\"^3.2.0\",\"css-animation\":\"^1.5.0\",\"dom-closest\":\"^0.2.0\",\"enquire.js\":\"^2.1.6\",\"lodash\":\"^4.17.13\",\"moment\":\"^2.24.0\",\"omit.js\":\"^1.0.2\",\"prop-types\":\"^15.7.2\",\"raf\":\"^3.4.1\",\"rc-animate\":\"^2.8.3\",\"rc-calendar\":\"~9.15.5\",\"rc-cascader\":\"~0.17.4\",\"rc-checkbox\":\"~2.1.6\",\"rc-collapse\":\"~1.11.3\",\"rc-dialog\":\"~7.5.2\",\"rc-drawer\":\"~2.0.1\",\"rc-dropdown\":\"~2.4.1\",\"rc-editor-mention\":\"^1.1.13\",\"rc-form\":\"^2.4.5\",\"rc-input-number\":\"~4.4.5\",\"rc-mentions\":\"~0.3.1\",\"rc-menu\":\"~7.4.23\",\"rc-notification\":\"~3.3.1\",\"rc-pagination\":\"~1.20.5\",\"rc-progress\":\"~2.5.0\",\"rc-rate\":\"~2.5.0\",\"rc-select\":\"~9.2.0\",\"rc-slider\":\"~8.6.11\",\"rc-steps\":\"~3.4.1\",\"rc-switch\":\"~1.9.0\",\"rc-table\":\"~6.7.0\",\"rc-tabs\":\"~9.6.4\",\"rc-time-picker\":\"~3.7.1\",\"rc-tooltip\":\"~3.7.3\",\"rc-tree\":\"~2.1.0\",\"rc-tree-select\":\"~2.9.1\",\"rc-trigger\":\"^2.6.2\",\"rc-upload\":\"~2.7.0\",\"rc-util\":\"^4.6.0\",\"react-lazy-load\":\"^3.0.13\",\"react-lifecycles-compat\":\"^3.0.4\",\"react-slick\":\"~0.24.0\",\"resize-observer-polyfill\":\"^1.5.1\",\"shallowequal\":\"^1.1.0\",\"warning\":\"~4.0.3\"},\"deprecated\":false,\"description\":\"An enterprise-class UI design language and React components implementation\",\"devDependencies\":{\"@ant-design/colors\":\"^3.1.0\",\"@ant-design/tools\":\"^8.0.4\",\"@packtracker/webpack-plugin\":\"^2.0.1\",\"@sentry/browser\":\"^5.4.0\",\"@types/classnames\":\"^2.2.8\",\"@types/prop-types\":\"^15.7.1\",\"@types/react\":\"^16.9.0\",\"@types/react-dom\":\"^16.8.4\",\"@types/warning\":\"^3.0.0\",\"@typescript-eslint/eslint-plugin\":\"^1.13.0\",\"@typescript-eslint/parser\":\"^1.13.0\",\"@yesmeck/offline-plugin\":\"^5.0.5\",\"antd-theme-generator\":\"^1.1.6\",\"babel-eslint\":\"^10.0.1\",\"babel-plugin-add-react-displayname\":\"^0.0.5\",\"bisheng\":\"^1.3.0\",\"bisheng-plugin-antd\":\"^1.0.2\",\"bisheng-plugin-description\":\"^0.1.4\",\"bisheng-plugin-react\":\"^1.0.0\",\"bisheng-plugin-toc\":\"^0.4.4\",\"chalk\":\"^2.4.2\",\"cross-env\":\"^5.2.0\",\"css-split-webpack-plugin\":\"^0.2.6\",\"dekko\":\"^0.2.1\",\"docsearch.js\":\"^2.6.3\",\"enquire-js\":\"^0.2.1\",\"enzyme\":\"^3.10.0\",\"enzyme-adapter-react-16\":\"^1.14.0\",\"enzyme-to-json\":\"^3.3.5\",\"eslint\":\"^6.1.0\",\"eslint-config-airbnb\":\"^17.1.0\",\"eslint-config-prettier\":\"^6.0.0\",\"eslint-plugin-babel\":\"^5.3.0\",\"eslint-plugin-import\":\"^2.17.3\",\"eslint-plugin-jest\":\"^22.6.4\",\"eslint-plugin-jsx-a11y\":\"^6.2.1\",\"eslint-plugin-markdown\":\"^1.0.0\",\"eslint-plugin-react\":\"^7.14.2\",\"eslint-tinker\":\"^0.5.0\",\"fetch-jsonp\":\"^1.1.3\",\"glob\":\"^7.1.4\",\"husky\":\"^3.0.2\",\"immutability-helper\":\"^3.0.0\",\"intersection-observer\":\"^0.7.0\",\"jest\":\"^24.8.0\",\"jsdom\":\"^15.1.1\",\"jsonml.js\":\"^0.1.0\",\"logrocket\":\"^1.0.0\",\"logrocket-react\":\"^3.0.0\",\"lz-string\":\"^1.4.4\",\"mockdate\":\"^2.0.2\",\"node-fetch\":\"^2.6.0\",\"preact\":\"^8.4.2\",\"preact-compat\":\"^3.18.5\",\"prettier\":\"^1.17.1\",\"pretty-quick\":\"^1.11.0\",\"querystring\":\"^0.2.0\",\"rc-queue-anim\":\"^1.6.12\",\"rc-scroll-anim\":\"^2.5.8\",\"rc-tween-one\":\"^2.4.1\",\"react\":\"^16.5.2\",\"react-color\":\"^2.17.3\",\"react-copy-to-clipboard\":\"^5.0.1\",\"react-dnd\":\"^9.0.0\",\"react-dnd-html5-backend\":\"^9.0.0\",\"react-document-title\":\"^2.0.3\",\"react-dom\":\"^16.5.2\",\"react-github-button\":\"^0.1.11\",\"react-highlight-words\":\"^0.16.0\",\"react-infinite-scroller\":\"^1.2.4\",\"react-intl\":\"^3.1.1\",\"react-resizable\":\"^1.8.0\",\"react-router\":\"^3.2.3\",\"react-router-dom\":\"^5.0.1\",\"react-sticky\":\"^6.0.3\",\"react-test-renderer\":\"^16.8.6\",\"react-virtualized\":\"~9.21.1\",\"reqwest\":\"^2.0.5\",\"rimraf\":\"^2.6.3\",\"scrollama\":\"^2.0.0\",\"simple-git\":\"^1.113.0\",\"stylelint\":\"^10.0.1\",\"stylelint-config-prettier\":\"^5.2.0\",\"stylelint-config-rational-order\":\"^0.1.2\",\"stylelint-config-standard\":\"^18.3.0\",\"stylelint-declaration-block-no-ignored-properties\":\"^2.1.0\",\"stylelint-order\":\"^3.0.0\",\"typescript\":\"~3.5.1\",\"xhr-mock\":\"^2.4.1\",\"xhr2\":\"^0.2.0\"},\"files\":[\"dist\",\"lib\",\"es\"],\"homepage\":\"http://ant.design/\",\"husky\":{\"hooks\":{\"pre-commit\":\"pretty-quick --staged\"}},\"keywords\":[\"ant\",\"design\",\"react\",\"react-component\",\"component\",\"components\",\"ui\",\"framework\",\"frontend\"],\"license\":\"MIT\",\"main\":\"lib/index.js\",\"module\":\"es/index.js\",\"name\":\"antd\",\"peerDependencies\":{\"react\":\">=16.0.0\",\"react-dom\":\">=16.0.0\"},\"publishConfig\":{\"registry\":\"https://registry.npmjs.org/\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/ant-design/ant-design.git\"},\"scripts\":{\"api-collection\":\"antd-tools run api-collection\",\"authors\":\"git log --format='%aN <%aE>' | sort -u | grep -v 'users.noreply.github.com' | grep -v 'gitter.im' | grep -v '.local>' | grep -v 'alibaba-inc.com' | grep -v 'alipay.com' | grep -v 'taobao.com' > AUTHORS.txt\",\"check-commit\":\"node ./scripts/check-commit.js\",\"compile\":\"antd-tools run compile\",\"deploy\":\"bisheng gh-pages --push-only\",\"deploy:china-mirror\":\"git checkout gh-pages && git pull origin gh-pages && git push git@gitee.com:ant-design/ant-design.git gh-pages\",\"dist\":\"antd-tools run dist\",\"lint\":\"npm run lint:ts && npm run lint:ts:with-eslint && npm run lint:es && npm run lint:demo && npm run lint:style && npm run lint:deps\",\"lint-fix\":\"npm run lint-fix:code && npm run lint-fix:demo && npm run lint-fix:style\",\"lint-fix:code\":\"eslint --fix tests site scripts components ./.*.js ./webpack.config.js --ext '.js,.jsx'\",\"lint-fix:demo\":\"eslint-tinker ./components/*/demo/*.md\",\"lint-fix:style\":\"stylelint --fix '{site,components}/**/*.less' --syntax less\",\"lint-fix:ts\":\"npm run tsc && antd-tools run ts-lint-fix\",\"lint:demo\":\"cross-env RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md' --rule 'import/no-unresolved: 0'\",\"lint:deps\":\"antd-tools run deps-lint\",\"lint:es\":\"eslint tests site scripts components ./.*.js ./webpack.config.js --ext '.js,.jsx'\",\"lint:md\":\"remark components/\",\"lint:style\":\"stylelint '{site,components}/**/*.less' --syntax less\",\"lint:ts\":\"npm run tsc && antd-tools run ts-lint\",\"lint:ts:with-eslint\":\"eslint components/**/*.tsx\",\"pre-publish\":\"npm run check-commit && npm run test-all\",\"predeploy\":\"antd-tools run clean && npm run site && cp netlify.toml CNAME _site && cp .circleci/config.yml _site\",\"prepublish\":\"antd-tools run guard\",\"prettier\":\"prettier -c --write '**/*'\",\"pretty-quick\":\"pretty-quick\",\"pub\":\"antd-tools run pub\",\"site\":\"bisheng build --ssr -c ./site/bisheng.config.js && node ./scripts/generateColorLess.js\",\"sort-api\":\"antd-tools run sort-api-table\",\"start\":\"rimraf _site && mkdir _site && node ./scripts/generateColorLess.js && cross-env NODE_ENV=development bisheng start -c ./site/bisheng.config.js\",\"start:preact\":\"node ./scripts/generateColorLess.js && cross-env NODE_ENV=development REACT_ENV=preact bisheng start -c ./site/bisheng.config.js\",\"test\":\"jest --config .jest.js --no-cache\",\"test-all\":\"./scripts/test-all.sh\",\"test-node\":\"jest --config .jest.node.js --no-cache\",\"tsc\":\"tsc\"},\"sideEffects\":[\"dist/*\",\"es/**/style/*\",\"lib/**/style/*\",\"*.less\"],\"title\":\"Ant Design\",\"typings\":\"lib/index.d.ts\",\"version\":\"3.21.4\"}"); /***/ }), @@ -112526,10 +112526,10 @@ module.exports = JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\ /*!*******************************************!*\ !*** ./node_modules/cheerio/package.json ***! \*******************************************/ -/*! exports provided: _args, _development, _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _spec, _where, author, bugs, dependencies, description, devDependencies, engines, files, homepage, keywords, license, main, name, repository, scripts, version, default */ +/*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, dependencies, deprecated, description, devDependencies, engines, files, homepage, keywords, license, main, name, repository, scripts, version, default */ /***/ (function(module) { -module.exports = JSON.parse("{\"_args\":[[\"cheerio@0.22.0\",\"/Users/storm/Documents/Websites/odin\"]],\"_development\":true,\"_from\":\"cheerio@0.22.0\",\"_id\":\"cheerio@0.22.0\",\"_inBundle\":false,\"_integrity\":\"sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=\",\"_location\":\"/cheerio\",\"_phantomChildren\":{\"boolbase\":\"1.0.0\",\"css-what\":\"2.1.3\",\"domelementtype\":\"1.3.1\",\"nth-check\":\"1.0.2\"},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"cheerio@0.22.0\",\"name\":\"cheerio\",\"escapedName\":\"cheerio\",\"rawSpec\":\"0.22.0\",\"saveSpec\":null,\"fetchSpec\":\"0.22.0\"},\"_requiredBy\":[\"/prettify-html\"],\"_resolved\":\"https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz\",\"_spec\":\"0.22.0\",\"_where\":\"/Users/storm/Documents/Websites/odin\",\"author\":{\"name\":\"Matt Mueller\",\"email\":\"mattmuelle@gmail.com\",\"url\":\"mat.io\"},\"bugs\":{\"url\":\"https://github.com/cheeriojs/cheerio/issues\"},\"dependencies\":{\"css-select\":\"~1.2.0\",\"dom-serializer\":\"~0.1.0\",\"entities\":\"~1.1.1\",\"htmlparser2\":\"^3.9.1\",\"lodash.assignin\":\"^4.0.9\",\"lodash.bind\":\"^4.1.4\",\"lodash.defaults\":\"^4.0.1\",\"lodash.filter\":\"^4.4.0\",\"lodash.flatten\":\"^4.2.0\",\"lodash.foreach\":\"^4.3.0\",\"lodash.map\":\"^4.4.0\",\"lodash.merge\":\"^4.4.0\",\"lodash.pick\":\"^4.2.1\",\"lodash.reduce\":\"^4.4.0\",\"lodash.reject\":\"^4.4.0\",\"lodash.some\":\"^4.4.0\"},\"description\":\"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server\",\"devDependencies\":{\"benchmark\":\"^2.1.0\",\"coveralls\":\"^2.11.9\",\"expect.js\":\"~0.3.1\",\"istanbul\":\"^0.4.3\",\"jquery\":\"^3.0.0\",\"jsdom\":\"^9.2.1\",\"jshint\":\"^2.9.2\",\"mocha\":\"^2.5.3\",\"xyz\":\"~0.5.0\"},\"engines\":{\"node\":\">= 0.6\"},\"files\":[\"index.js\",\"lib\"],\"homepage\":\"https://github.com/cheeriojs/cheerio#readme\",\"keywords\":[\"htmlparser\",\"jquery\",\"selector\",\"scraper\",\"parser\",\"html\"],\"license\":\"MIT\",\"main\":\"./index.js\",\"name\":\"cheerio\",\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/cheeriojs/cheerio.git\"},\"scripts\":{\"test\":\"make test\"},\"version\":\"0.22.0\"}"); +module.exports = JSON.parse("{\"_from\":\"cheerio@^0.22.0\",\"_id\":\"cheerio@0.22.0\",\"_inBundle\":false,\"_integrity\":\"sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=\",\"_location\":\"/cheerio\",\"_phantomChildren\":{\"boolbase\":\"1.0.0\",\"css-what\":\"2.1.3\",\"domelementtype\":\"1.3.1\",\"nth-check\":\"1.0.2\"},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"cheerio@^0.22.0\",\"name\":\"cheerio\",\"escapedName\":\"cheerio\",\"rawSpec\":\"^0.22.0\",\"saveSpec\":null,\"fetchSpec\":\"^0.22.0\"},\"_requiredBy\":[\"/prettify-html\"],\"_resolved\":\"https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz\",\"_shasum\":\"a9baa860a3f9b595a6b81b1a86873121ed3a269e\",\"_spec\":\"cheerio@^0.22.0\",\"_where\":\"/Users/owen/Sites/odin/node_modules/prettify-html\",\"author\":{\"name\":\"Matt Mueller\",\"email\":\"mattmuelle@gmail.com\",\"url\":\"mat.io\"},\"bugs\":{\"url\":\"https://github.com/cheeriojs/cheerio/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"css-select\":\"~1.2.0\",\"dom-serializer\":\"~0.1.0\",\"entities\":\"~1.1.1\",\"htmlparser2\":\"^3.9.1\",\"lodash.assignin\":\"^4.0.9\",\"lodash.bind\":\"^4.1.4\",\"lodash.defaults\":\"^4.0.1\",\"lodash.filter\":\"^4.4.0\",\"lodash.flatten\":\"^4.2.0\",\"lodash.foreach\":\"^4.3.0\",\"lodash.map\":\"^4.4.0\",\"lodash.merge\":\"^4.4.0\",\"lodash.pick\":\"^4.2.1\",\"lodash.reduce\":\"^4.4.0\",\"lodash.reject\":\"^4.4.0\",\"lodash.some\":\"^4.4.0\"},\"deprecated\":false,\"description\":\"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server\",\"devDependencies\":{\"benchmark\":\"^2.1.0\",\"coveralls\":\"^2.11.9\",\"expect.js\":\"~0.3.1\",\"istanbul\":\"^0.4.3\",\"jquery\":\"^3.0.0\",\"jsdom\":\"^9.2.1\",\"jshint\":\"^2.9.2\",\"mocha\":\"^2.5.3\",\"xyz\":\"~0.5.0\"},\"engines\":{\"node\":\">= 0.6\"},\"files\":[\"index.js\",\"lib\"],\"homepage\":\"https://github.com/cheeriojs/cheerio#readme\",\"keywords\":[\"htmlparser\",\"jquery\",\"selector\",\"scraper\",\"parser\",\"html\"],\"license\":\"MIT\",\"main\":\"./index.js\",\"name\":\"cheerio\",\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/cheeriojs/cheerio.git\"},\"scripts\":{\"test\":\"make test\"},\"version\":\"0.22.0\"}"); /***/ }), @@ -322790,6 +322790,347 @@ function (_React$Component) { +/***/ }), + +/***/ "./resources/js/components/OpenGraph.js": +/*!**********************************************!*\ + !*** ./resources/js/components/OpenGraph.js ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RobotsReport; }); +/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); +/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ "./node_modules/antd/es/index.js"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers */ "./resources/js/helpers.js"); +function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } + + + +function _typeof(obj) { + if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); + }; + } + + return _typeof(obj); +} + +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; +} + +function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(source, true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(source).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; +} + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} + +function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + + _next(undefined); + }); + }; +} + +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } + + return _assertThisInitialized(self); +} + +function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} + +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} + +function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); +} + +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +} + + + + + +var RobotsReport = +/*#__PURE__*/ +function (_React$Component) { + _inherits(RobotsReport, _React$Component); + + function RobotsReport() { + var _getPrototypeOf2; + + var _this; + + _classCallCheck(this, RobotsReport); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RobotsReport)).call.apply(_getPrototypeOf2, [this].concat(args))); + + _defineProperty(_assertThisInitialized(_this), "state", { + website: JSON.parse(_this.props.website), + loading: true, + icon: '/favicon.png', + title: '', + description: '', + url: '', + image: '' + }); + + _defineProperty(_assertThisInitialized(_this), "update", + /*#__PURE__*/ + _asyncToGenerator( + /*#__PURE__*/ + _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() { + var refresh, + endpoint, + response, + _args = arguments; + return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + refresh = _args.length > 0 && _args[0] !== undefined ? _args[0] : false; + _context.next = 3; + return _this.setState({ + loading: true + }); + + case 3: + endpoint = window.location.href + '/opengraph'; + + if (refresh) { + endpoint += '?refresh=1'; + } + + _context.next = 7; + return window.axios.get(endpoint); + + case 7: + response = _context.sent.data; + + _this.setState(_objectSpread({}, response, { + loading: false + }), function () { + if (_this.state.icon) { + document.getElementById('favicon').href = _this.state.icon; + } + }); + + case 9: + case "end": + return _context.stop(); + } + } + }, _callee); + }))); + + _defineProperty(_assertThisInitialized(_this), "forceUpdate", function () { + return _this.update(true); + }); + + _defineProperty(_assertThisInitialized(_this), "renderReport", function () { + var _this$state = _this.state, + title = _this$state.title, + description = _this$state.description, + image = _this$state.image, + url = _this$state.url; + + if (!title) { + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_helpers__WEBPACK_IMPORTED_MODULE_3__["NoData"], null); + } + + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { + className: "flex flex-wrap items-center" + }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { + className: "w-1/2 pr-8" + }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("img", { + className: "w-full h-auto shadow-lg", + src: image, + alt: title + })), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", { + className: "w-1/2" + }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("h2", null, title), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("p", null, description), react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("a", { + href: url, + rel: "noreferrer noopener", + target: "_blank" + }, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("small", null, url)))); + }); + + _defineProperty(_assertThisInitialized(_this), "renderBusy", function () { + var _this$state2 = _this.state, + now = _this$state2.now, + previous = _this$state2.previous; + + if (now && previous) { + return _this.renderReport(); + } + + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(antd__WEBPACK_IMPORTED_MODULE_2__["Spin"], null); + }); + + return _this; + } + + _createClass(RobotsReport, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.update(); + } + }, { + key: "render", + value: function render() { + var loading = this.state.loading; + return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(antd__WEBPACK_IMPORTED_MODULE_2__["Card"], { + title: "Open Graph", + extra: react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(antd__WEBPACK_IMPORTED_MODULE_2__["Button"], { + loading: loading, + onClick: this.forceUpdate + }, "Refresh") + }, !loading ? this.renderReport() : this.renderBusy())); + } + }]); + + return RobotsReport; +}(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component); + + + /***/ }), /***/ "./resources/js/components/RobotsReport.js": @@ -323808,6 +324149,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _components_DnsReport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/DnsReport */ "./resources/js/components/DnsReport.js"); /* harmony import */ var _components_RobotsReport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/RobotsReport */ "./resources/js/components/RobotsReport.js"); /* harmony import */ var _components_UptimeReport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/UptimeReport */ "./resources/js/components/UptimeReport.js"); +/* harmony import */ var _components_OpenGraph__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/OpenGraph */ "./resources/js/components/OpenGraph.js"); + @@ -323819,8 +324162,9 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; var token = document.head.querySelector('meta[name="csrf-token"]'); window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; _maelstrom_cms_toolkit_js_support_Registry__WEBPACK_IMPORTED_MODULE_0__["default"].register({ - ButtonColumn: _components_ButtonColumn__WEBPACK_IMPORTED_MODULE_1__["default"], + OpenGraph: _components_OpenGraph__WEBPACK_IMPORTED_MODULE_6__["default"], DnsReport: _components_DnsReport__WEBPACK_IMPORTED_MODULE_3__["default"], + ButtonColumn: _components_ButtonColumn__WEBPACK_IMPORTED_MODULE_1__["default"], RobotsReport: _components_RobotsReport__WEBPACK_IMPORTED_MODULE_4__["default"], UptimeReport: _components_UptimeReport__WEBPACK_IMPORTED_MODULE_5__["default"], CertificateReport: _components_CertificateReport__WEBPACK_IMPORTED_MODULE_2__["default"] @@ -323848,8 +324192,8 @@ __webpack_require__(/*! @maelstrom-cms/toolkit */ "./node_modules/@maelstrom-cms /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(/*! /Users/storm/Documents/Websites/odin/resources/js/maelstrom.js */"./resources/js/maelstrom.js"); -module.exports = __webpack_require__(/*! /Users/storm/Documents/Websites/odin/resources/sass/maelstrom.css */"./resources/sass/maelstrom.css"); +__webpack_require__(/*! /Users/owen/Sites/odin/resources/js/maelstrom.js */"./resources/js/maelstrom.js"); +module.exports = __webpack_require__(/*! /Users/owen/Sites/odin/resources/sass/maelstrom.css */"./resources/sass/maelstrom.css"); /***/ }), diff --git a/resources/js/components/OpenGraph.js b/resources/js/components/OpenGraph.js new file mode 100644 index 0000000..9e7a048 --- /dev/null +++ b/resources/js/components/OpenGraph.js @@ -0,0 +1,93 @@ +import React from 'react'; +import { Card, Button, Spin } from 'antd'; +import { NoData } from '../helpers' + +export default class RobotsReport extends React.Component { + + state = { + website: JSON.parse(this.props.website), + loading: true, + icon: '/favicon.png', + title: '', + description: '', + url: '', + image: '', + }; + + componentDidMount() { + this.update(); + }; + + update = async(refresh = false) => { + await this.setState({ + loading: true + }); + + let endpoint = window.location.href + '/opengraph'; + + if (refresh) { + endpoint += '?refresh=1'; + } + + const response = (await window.axios.get(endpoint)).data; + + this.setState({ + ...response, + loading: false, + }, () => { + if (this.state.icon) { + document.getElementById('favicon').href = this.state.icon + } + }); + }; + + forceUpdate = () => { + return this.update(true); + }; + + renderReport = () => { + const { title, description, image, url } = this.state; + + if (!title) { + return + } + + return ( +
+
+ { +
+
+

{ title }

+

{ description }

+ { url } +
+
+ ) + }; + + renderBusy = () => { + const { now, previous } = this.state; + + if (now && previous) { + return this.renderReport() + } + + return + }; + + render() { + const { loading } = this.state; + + return ( +
+ Refresh } + > + { !loading ? this.renderReport() : this.renderBusy() } + +
+ ) + } +} diff --git a/resources/js/maelstrom.js b/resources/js/maelstrom.js index 76c2499..363c49d 100644 --- a/resources/js/maelstrom.js +++ b/resources/js/maelstrom.js @@ -4,6 +4,7 @@ import CertificateReport from './components/CertificateReport'; import DnsReport from './components/DnsReport'; import RobotsReport from './components/RobotsReport'; import UptimeReport from './components/UptimeReport'; +import OpenGraph from './components/OpenGraph'; window.axios = require('axios'); window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; @@ -12,8 +13,9 @@ let token = document.head.querySelector('meta[name="csrf-token"]'); window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; Registry.register({ - ButtonColumn, + OpenGraph, DnsReport, + ButtonColumn, RobotsReport, UptimeReport, CertificateReport, diff --git a/resources/views/vendor/maelstrom/layouts/wrapper.blade.php b/resources/views/vendor/maelstrom/layouts/wrapper.blade.php index 738d222..751ff99 100644 --- a/resources/views/vendor/maelstrom/layouts/wrapper.blade.php +++ b/resources/views/vendor/maelstrom/layouts/wrapper.blade.php @@ -2,6 +2,7 @@ @yield('title') :: {{ config('maelstrom.title_prefix', config('maelstrom.title')) }} + @include('maelstrom::partials.head-meta') diff --git a/resources/views/websites-show.blade.php b/resources/views/websites-show.blade.php index 3066db8..dc8eb32 100644 --- a/resources/views/websites-show.blade.php +++ b/resources/views/websites-show.blade.php @@ -16,6 +16,8 @@ @section('content') +
+ @if ($website->uptime_enabled)
@endif @@ -32,6 +34,8 @@
@endif + + @endsection @section('footer') diff --git a/routes/web.php b/routes/web.php index b848685..6ed252f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,4 +23,5 @@ Route::get('websites/{website}/uptime', 'UptimeReportController'); Route::get('websites/{website}/ssl', 'CertificateReportController'); Route::get('websites/{website}/dns', 'DnsCompareController'); + Route::get('websites/{website}/opengraph', 'OpenGraphController'); });