mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 22:53:37 +08:00
1 line
38 KiB
Plaintext
Executable File
1 line
38 KiB
Plaintext
Executable File
{"version":3,"sources":["webpack://@sycho/flarum-package-manager/webpack/bootstrap","webpack://@sycho/flarum-package-manager/./admin.js","webpack://@sycho/flarum-package-manager/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@sycho/flarum-package-manager/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@sycho/flarum-package-manager/./src/admin/components/ComposerFailureModal.tsx","webpack://@sycho/flarum-package-manager/./src/admin/components/Installer.tsx","webpack://@sycho/flarum-package-manager/./src/admin/components/MajorUpdater.tsx","webpack://@sycho/flarum-package-manager/./src/admin/components/Updater.tsx","webpack://@sycho/flarum-package-manager/./src/admin/index.js","webpack://@sycho/flarum-package-manager/./src/admin/utils/errorHandler.ts","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['admin/app']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['admin/components/LoadingModal']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['admin/utils/isExtensionEnabled']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/Component']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/components/Alert']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/components/Button']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/components/Modal']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/components/Tooltip']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/extend']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/utils/Stream']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/utils/classList']\""],"names":["_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","setPrototypeOf","_setPrototypeOf","o","p","__proto__","ComposerFailureModal","oninit","vnode","attrs","error","guessed_cause","alertAttrs","type","content","app","translator","trans","className","title","output","Modal","Installer","packageName","isLoading","Stream","view","extiverse","onsubmit","bind","data","modal","show","LoadingModal","request","method","url","forum","attribute","body","errorHandler","then","response","extensionId","id","alerts","extension","window","location","href","reload","m","redraw","Component","MajorUpdater","version","coreUpdate","Updater","lastUpdateCheck","extensions","getExtensionUpdates","getCoreUpdate","core","settings","icon","backgroundImage","newPackageUpdate","keys","length","humanTime","checkedAt","checkForUpdates","updateGlobally","extensionItem","map","isCore","classList","name","extra","updateCoreMinor","updateExtension","v","replace","updates","installed","filter","composerPackage","safeToUpdate","includes","values","pop","initializers","add","extensionData","registerSetting","isRequiredDirectoriesWritable","extend","ExtensionPage","items","isExtensionEnabled","close","e","errors","code"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA,wC;;;;;;;;;;;;ACAA;AAAA;AA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AA,0E;;;;;;;;;;;ACAA,+D;;;;;;;;;;;ACAA,iE;;;;;;;;;;;ACAA,qD;;;;;;;;;;;ACAA,gE;;;;;;;;;;;ACAA,2D;;;;;;;;;;;ACAA,2D;;;;;;;;;;;ACAA,8D","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./admin.js\");\n","export * from './src/admin';","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport { ComponentAttrs } from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport Mithril from 'mithril';\n\ninterface Attrs extends ComponentAttrs {\n output: string;\n}\n\nexport default class ComposerFailureModal<T extends Attrs = Attrs> extends Modal<T> {\n oninit(vnode: Mithril.Vnode<T, this>) {\n super.oninit(vnode);\n\n if (this.attrs.error.guessed_cause) {\n this.alertAttrs = {\n type: 'error',\n content: app.translator.trans(`sycho-package-manager.admin.failure_modal.guessed_cause.${this.attrs.error.guessed_cause}`),\n };\n }\n }\n\n className() {\n return 'Modal--large ComposerFailureModal';\n }\n\n title() {\n return app.translator.trans('sycho-package-manager.admin.failure_modal.title');\n }\n\n content() {\n return (\n <div className=\"Modal-body\">\n <details>\n <summary>{app.translator.trans('sycho-package-manager.admin.failure_modal.show_composer_output')}</summary>\n <pre className=\"ComposerFailureModal-output\">{this.attrs.error.output}</pre>\n </details>\n </div>\n );\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport ComposerFailureModal from './ComposerFailureModal';\nimport errorHandler from '../utils/errorHandler';\n\nexport default class Installer extends Component {\n packageName!: Stream<string>;\n isLoading: boolean = false;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.packageName = Stream('');\n }\n\n view(): Mithril.Children {\n return (\n <div className=\"Form-group\">\n <label htmlFor=\"install-extension\">{app.translator.trans('sycho-package-manager.admin.extensions.install')}</label>\n <p className=\"helpText\">\n {app.translator.trans('sycho-package-manager.admin.extensions.install_help', {\n extiverse: <a href=\"https://extiverse.com\">extiverse.com</a>,\n })}\n </p>\n <div className=\"FormControl-container\">\n <input className=\"FormControl\" id=\"install-extension\" placeholder=\"vendor/package-name\" bidi={this.packageName} />\n <Button className=\"Button\" icon=\"fas fa-download\" onclick={this.onsubmit.bind(this)} loading={this.isLoading}>\n {app.translator.trans('sycho-package-manager.admin.extensions.proceed')}\n </Button>\n </div>\n </div>\n );\n }\n\n data(): any {\n return {\n package: this.packageName(),\n };\n }\n\n onsubmit(): void {\n this.isLoading = true;\n app.modal.show(LoadingModal);\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions`,\n body: {\n data: this.data(),\n },\n errorHandler,\n })\n .then((response) => {\n const extensionId = response.id;\n app.alerts.show(\n { type: 'success' },\n app.translator.trans('sycho-package-manager.admin.extensions.successful_install', { extension: extensionId })\n );\n window.location.href = `${app.forum.attribute('adminUrl')}#/extension/${extensionId}`;\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = false;\n m.redraw();\n });\n }\n}\n","import app from 'flarum/admin/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Mithril from 'mithril';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { UpdatedPackage } from './Updater';\n\ninterface MajorUpdaterAttrs extends ComponentAttrs {\n coreUpdate: UpdatedPackage;\n}\n\nexport default class MajorUpdater<T extends MajorUpdaterAttrs = MajorUpdaterAttrs> extends Component<T> {\n view(vnode: Mithril.Vnode<ComponentAttrs, this>): Mithril.Children {\n return (\n <div className=\"Form-group PackageManager-majorUpdate\">\n <img alt=\"flarum logo\" src={app.forum.attribute('baseUrl') + '/assets/extensions/sycho-package-manager/flarum.svg'} />\n <label>{app.translator.trans('sycho-package-manager.admin.major_updater.title', { version: this.attrs.coreUpdate['latest-major'] })}</label>\n <p className=\"helpText\">{app.translator.trans('sycho-package-manager.admin.major_updater.description')}</p>\n <div className=\"PackageManager-updaterControls\">\n <Tooltip text={app.translator.trans('sycho-package-manager.admin.major_updater.dry_run_help')}>\n <Button className=\"Button\" icon=\"fas fa-vial\">\n {app.translator.trans('sycho-package-manager.admin.major_updater.dry_run')}\n </Button>\n </Tooltip>\n <Button className=\"Button\" icon=\"fas fa-play\">\n {app.translator.trans('sycho-package-manager.admin.major_updater.update')}\n </Button>\n </div>\n </div>\n );\n }\n}\n","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Button from 'flarum/common/components/Button';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport errorHandler from '../utils/errorHandler';\nimport classList from 'flarum/common/utils/classList';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport MajorUpdater from './MajorUpdater';\n\nexport type UpdatedPackage = {\n name: string;\n version: string;\n latest: string;\n 'latest-minor': string | null;\n 'latest-major': string | null;\n 'latest-status': string;\n description: string;\n};\n\ntype ComposerUpdates = {\n installed: UpdatedPackage[];\n};\n\ntype LastUpdateCheck = {\n checkedAt: Date;\n updates: ComposerUpdates;\n};\n\nexport default class Updater extends Component {\n isLoading: string | null = null;\n lastUpdateCheck: LastUpdateCheck = app.data.lastUpdateCheck || {};\n\n oninit(vnode) {\n super.oninit(vnode);\n }\n\n view() {\n const extensions: any = this.getExtensionUpdates();\n const coreUpdate: UpdatedPackage | undefined = this.getCoreUpdate();\n let core = null;\n\n if (coreUpdate) {\n core = {\n title: app.translator.trans('sycho-package-manager.admin.updater.flarum'),\n version: app.data.settings.version,\n icon: {\n backgroundImage: `url(${app.forum.attribute('baseUrl')}/assets/extensions/sycho-package-manager/flarum.svg`,\n },\n newPackageUpdate: coreUpdate,\n };\n }\n\n return [\n <div className=\"Form-group\">\n <label>{app.translator.trans('sycho-package-manager.admin.updater.updater_title')}</label>\n <p className=\"helpText\">{app.translator.trans('sycho-package-manager.admin.updater.updater_help')}</p>\n {Object.keys(this.lastUpdateCheck).length ? (\n <p className=\"PackageManager-lastUpdatedAt\">\n <span className=\"PackageManager-lastUpdatedAt-label\">\n {app.translator.trans('sycho-package-manager.admin.updater.last_update_checked_at')}\n </span>\n <span className=\"PackageManager-lastUpdatedAt-value\">{humanTime(this.lastUpdateCheck?.checkedAt)}</span>\n </p>\n ) : null}\n <div className=\"PackageManager-updaterControls\">\n <Button\n className=\"Button\"\n icon=\"fas fa-sync-alt\"\n onclick={this.checkForUpdates.bind(this)}\n loading={this.isLoading === 'check'}\n disabled={this.isLoading !== null && this.isLoading !== 'check'}\n >\n {app.translator.trans('sycho-package-manager.admin.updater.check_for_updates')}\n </Button>\n <Button\n className=\"Button\"\n icon=\"fas fa-play\"\n onclick={this.updateGlobally.bind(this)}\n loading={this.isLoading === 'global-update'}\n disabled={this.isLoading !== null && this.isLoading !== 'global-update'}\n >\n {app.translator.trans('sycho-package-manager.admin.updater.run_global_update')}\n </Button>\n </div>\n {this.isLoading !== null ? (\n <div className=\"PackageManager-extensions\">\n <LoadingIndicator />\n </div>\n ) : extensions.length || core ? (\n <div className=\"PackageManager-extensions\">\n <div className=\"PackageManager-extensions-grid\">\n {core ? this.extensionItem(core, true) : null}\n {extensions.map((extension: any) => this.extensionItem(extension))}\n </div>\n </div>\n ) : null}\n </div>,\n coreUpdate && coreUpdate['latest-major'] ? <MajorUpdater coreUpdate={coreUpdate} /> : null,\n ];\n }\n\n extensionItem(extension: any, isCore: boolean = false) {\n return (\n <div\n className={classList({\n 'PackageManager-extension': true,\n 'PackageManager-extension--core': isCore,\n })}\n >\n <div className=\"PackageManager-extension-icon ExtensionIcon\" style={extension.icon}>\n {extension.icon ? icon(extension.icon.name) : ''}\n </div>\n <div className=\"PackageManager-extension-info\">\n <div className=\"PackageManager-extension-name\">{extension.title || extension.extra['flarum-extension'].title}</div>\n <div className=\"PackageManager-extension-version\">\n <span className=\"PackageManager-extension-version-current\">{this.version(extension.version)}</span>\n {extension.newPackageUpdate['latest-minor'] ? (\n <span className=\"PackageManager-extension-version-latest PackageManager-extension-version-latest--minor\">\n {this.version(extension.newPackageUpdate['latest-minor'])}\n </span>\n ) : null}\n {extension.newPackageUpdate['latest-major'] && !isCore ? (\n <span className=\"PackageManager-extension-version-latest PackageManager-extension-version-latest--major\">\n {this.version(extension.newPackageUpdate['latest-major'])}\n </span>\n ) : null}\n </div>\n </div>\n <div className=\"PackageManager-extension-controls\">\n <Tooltip text={app.translator.trans('sycho-package-manager.admin.extensions.update')}>\n <Button\n icon=\"fas fa-arrow-alt-circle-up\"\n className=\"Button Button--icon Button--flat\"\n onclick={isCore ? this.updateCoreMinor.bind(this) : this.updateExtension.bind(this, extension)}\n aria-label={app.translator.trans('sycho-package-manager.admin.extensions.update')}\n />\n </Tooltip>\n </div>\n </div>\n );\n }\n\n version(v: string) {\n return 'v' + v.replace('v', '');\n }\n\n getExtensionUpdates() {\n this.lastUpdateCheck?.updates?.installed?.filter((composerPackage: UpdatedPackage) => {\n const extension = app.data.extensions[composerPackage.name.replace('/', '-').replace(/(flarum-ext-)|(flarum-)/, '')];\n const safeToUpdate = ['semver-safe-update', 'update-possible'].includes(composerPackage['latest-status']);\n\n if (extension && safeToUpdate) {\n extension.newPackageUpdate = composerPackage;\n }\n\n return extension && safeToUpdate;\n });\n\n return Object.values(app.data.extensions).filter((extension: any) => extension.newPackageUpdate);\n }\n\n getCoreUpdate(): UpdatedPackage | undefined {\n return this.lastUpdateCheck?.updates?.installed?.filter((composerPackage: UpdatedPackage) => composerPackage.name === 'flarum/core').pop();\n }\n\n checkForUpdates() {\n this.isLoading = 'check';\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/check-for-updates`,\n errorHandler,\n })\n .then((response) => {\n this.lastUpdateCheck = response as LastUpdateCheck;\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n\n updateCoreMinor() {\n app.modal.show(LoadingModal);\n this.isLoading = 'minor-update';\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/minor-update`,\n errorHandler,\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('sycho-package-manager.admin.updater.minor_update_successful'));\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n\n updateExtension(extension: any) {\n app.modal.show(LoadingModal);\n this.isLoading = 'extension-update';\n\n app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions/${extension.id}`,\n errorHandler,\n })\n .then(() => {\n app.alerts.show(\n { type: 'success' },\n app.translator.trans('sycho-package-manager.admin.extensions.successful_update', { extension: extension.extra['flarum-extension'].title })\n );\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n\n updateGlobally() {\n app.modal.show(LoadingModal);\n this.isLoading = 'global-update';\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/global-update`,\n errorHandler,\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('sycho-package-manager.admin.updater.global_update_successful'));\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\nimport Alert from 'flarum/common/components/Alert';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport Installer from './components/Installer';\nimport Updater from './components/Updater';\nimport isExtensionEnabled from 'flarum/admin/utils/isExtensionEnabled';\nimport MajorUpdater from './components/MajorUpdater';\n\napp.initializers.add('sycho-package-manager', (app) => {\n app.extensionData\n .for('sycho-package-manager')\n .registerSetting(() => {\n if (!app.data.isRequiredDirectoriesWritable) {\n return (\n <div className=\"Form-group\">\n <Alert type=\"warning\" dismissible={false}>\n {app.translator.trans('sycho-package-manager.admin.file_permissions')}\n </Alert>\n </div>\n );\n }\n })\n .registerSetting(() => {\n if (app.data.isRequiredDirectoriesWritable) {\n return <Installer />;\n }\n })\n .registerSetting(() => {\n if (app.data.isRequiredDirectoriesWritable) {\n return <Updater />;\n }\n });\n\n extend(ExtensionPage.prototype, 'topItems', function (items) {\n if (this.extension.id === 'sycho-package-manager' || isExtensionEnabled(this.extension.id)) {\n return;\n }\n\n items.add(\n 'remove',\n <Button\n className=\"Button Button--danger\"\n icon=\"fas fa-times\"\n onclick={() => {\n app.modal.show(LoadingModal);\n\n app\n .request({\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions/${this.extension.id}`,\n method: 'DELETE',\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('sycho-package-manager.admin.extensions.successful_remove'));\n window.location = app.forum.attribute('adminUrl');\n })\n .finally(() => {\n app.modal.close();\n });\n }}\n >\n Remove\n </Button>\n );\n });\n});\n","import app from 'flarum/admin/app';\nimport ComposerFailureModal from '../components/ComposerFailureModal';\n\nexport default function (e: any) {\n const error = e.response.errors[0];\n\n if (!['composer_command_failure', 'extension_already_installed', 'extension_not_installed'].includes(error.code)) {\n throw e;\n }\n\n switch (error.code) {\n case 'composer_command_failure':\n app.modal.show(ComposerFailureModal, { error });\n break;\n\n case 'extension_already_installed':\n app.alerts.show({ type: 'error' }, app.translator.trans('sycho-package-manager.admin.exceptions.extension_already_installed'));\n app.modal.close();\n break;\n\n case 'extension_not_installed':\n app.alerts.show({ type: 'error' }, app.translator.trans('sycho-package-manager.admin.exceptions.extension_not_installed'));\n app.modal.close();\n }\n}\n","module.exports = flarum.core.compat['admin/app'];","module.exports = flarum.core.compat['admin/components/ExtensionPage'];","module.exports = flarum.core.compat['admin/components/LoadingModal'];","module.exports = flarum.core.compat['admin/utils/isExtensionEnabled'];","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['common/components/Alert'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['common/components/LoadingIndicator'];","module.exports = flarum.core.compat['common/components/Modal'];","module.exports = flarum.core.compat['common/components/Tooltip'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/helpers/humanTime'];","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['common/utils/Stream'];","module.exports = flarum.core.compat['common/utils/classList'];"],"sourceRoot":""} |