mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-03 05:09:48 +01:00
feat: add support for saas_plan
This commit is contained in:
@@ -54,5 +54,6 @@
|
|||||||
|
|
||||||
"license.title": "Plugin License Information",
|
"license.title": "Plugin License Information",
|
||||||
"license.intro": "The plugin <strong>%1</strong> is licensed under the %2. Please read and understand the license terms prior to activating this plugin.",
|
"license.intro": "The plugin <strong>%1</strong> is licensed under the %2. Please read and understand the license terms prior to activating this plugin.",
|
||||||
"license.cta": "Do you wish to continue with activating this plugin?"
|
"license.cta": "Do you wish to continue with activating this plugin?",
|
||||||
|
"starter-plan-warning": "Plugins page is disabled on \"Starter\" plans, if you wish to upgrade your plan please contact us at <a href=\"mailto:support@nodebb.org\">support@nodebb.org</a>"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ define('admin/extend/plugins', [
|
|||||||
pluginsList.on('click', 'button[data-action="toggleActive"]', function () {
|
pluginsList.on('click', 'button[data-action="toggleActive"]', function () {
|
||||||
const pluginEl = $(this).parents('li');
|
const pluginEl = $(this).parents('li');
|
||||||
pluginID = pluginEl.attr('data-plugin-id');
|
pluginID = pluginEl.attr('data-plugin-id');
|
||||||
// const btn = $('[id="' + pluginID + '"] [data-action="toggleActive"]');
|
|
||||||
const btn = $(this);
|
const btn = $(this);
|
||||||
|
|
||||||
const pluginData = ajaxify.data.installed[pluginEl.attr('data-plugin-index')];
|
const pluginData = ajaxify.data.installed[pluginEl.attr('data-plugin-index')];
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ pluginsController.get = async function (req, res) {
|
|||||||
trending: trendingPlugins,
|
trending: trendingPlugins,
|
||||||
submitPluginUsage: meta.config.submitPluginUsage,
|
submitPluginUsage: meta.config.submitPluginUsage,
|
||||||
version: nconf.get('version'),
|
version: nconf.get('version'),
|
||||||
|
isStarterPlan: nconf.get('saas_plan') === 'starter',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -199,6 +199,11 @@ async function completeConfigSetup(config) {
|
|||||||
if (nconf.get('package_manager')) {
|
if (nconf.get('package_manager')) {
|
||||||
config.package_manager = nconf.get('package_manager');
|
config.package_manager = nconf.get('package_manager');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (install.values.hasOwnProperty('saas_plan')) {
|
||||||
|
config.saas_plan = install.values.saas_plan;
|
||||||
|
}
|
||||||
|
|
||||||
nconf.overrides(config);
|
nconf.overrides(config);
|
||||||
const db = require('./database');
|
const db = require('./database');
|
||||||
await db.init();
|
await db.init();
|
||||||
@@ -619,7 +624,10 @@ install.save = async function (server_conf) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await fs.promises.writeFile(serverConfigPath, JSON.stringify({ ...currentConfig, ...server_conf }, null, 4));
|
await fs.promises.writeFile(serverConfigPath, JSON.stringify({
|
||||||
|
...currentConfig,
|
||||||
|
...server_conf,
|
||||||
|
}, null, 4));
|
||||||
console.log('Configuration Saved OK');
|
console.log('Configuration Saved OK');
|
||||||
nconf.file({
|
nconf.file({
|
||||||
file: serverConfigPath,
|
file: serverConfigPath,
|
||||||
|
|||||||
@@ -1,15 +1,22 @@
|
|||||||
|
{{{ if isStarterPlan}}}
|
||||||
|
<div class="px-lg-4">
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
[[admin/extend/plugins:starter-plan-warning]]
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{{ end }}}
|
||||||
|
|
||||||
<div class="tags d-flex flex-column gap-2 px-lg-4">
|
<div class="d-flex flex-column gap-2 px-lg-4 {{{ if isStarterPlan }}}opacity-75 pe-none{{{ end }}}">
|
||||||
<div class="d-flex border-bottom py-2 m-0 sticky-top acp-page-main-header align-items-center justify-content-between flex-wrap gap-2">
|
<div class="d-flex border-bottom py-2 m-0 sticky-top acp-page-main-header align-items-center justify-content-between flex-wrap gap-2">
|
||||||
<div class="">
|
<div class="">
|
||||||
<h4 class="fw-bold tracking-tight mb-0">[[admin/extend/plugins:plugins]]</h4>
|
<h4 class="fw-bold tracking-tight mb-0">[[admin/extend/plugins:plugins]]</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex align-items-center gap-1">
|
<div class="d-flex align-items-center gap-1">
|
||||||
<input autofocus class="form-control form-control-sm" type="text" id="plugin-search" placeholder="[[admin/extend/plugins:plugin-search-placeholder]]"/><br/>
|
<input {{{ if !isStarterPlan}}} autofocus{{{ end}}} class="form-control form-control-sm" type="text" id="plugin-search" placeholder="[[admin/extend/plugins:plugin-search-placeholder]]"/><br/>
|
||||||
<button class="btn btn-primary btn-sm text-nowrap" id="plugin-order">[[admin/extend/plugins:order-active]]</button>
|
<button class="btn btn-primary btn-sm text-nowrap" id="plugin-order">[[admin/extend/plugins:order-active]]</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="">
|
<div>
|
||||||
{{{ if !canChangeState }}}
|
{{{ if !canChangeState }}}
|
||||||
<div class="alert alert-warning">[[error:plugins-set-in-configuration]]</div>
|
<div class="alert alert-warning">[[error:plugins-set-in-configuration]]</div>
|
||||||
{{{ end }}}
|
{{{ end }}}
|
||||||
|
|||||||
Reference in New Issue
Block a user