mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-22 06:56:35 +00:00
Feat/plugin instance actions (#2209)
* feat(shared): scope plugin action descriptors * feat(plugin-sdk): instance-scoped settings actions * feat(plugins): run instance-scoped actions from the admin settings dialog * feat(admin): instance-scoped plugin actions in the settings dialog * fix(plugins): surface instance actions without instance fields and harden the action gate * docs(plugin-sdk): note that hosts before 4.2.0 ignore action scope * fix(admin): open the dialog for instance actions, explain inactive 404s, guard the save window * docs(wiki): plugin pages for instance actions and the admin panel changes
This commit is contained in:
@@ -4226,6 +4226,16 @@ function runMigrations(db: Database.Database): void {
|
||||
db.exec('ALTER TABLE plugin_settings_fields ADD COLUMN default_value TEXT');
|
||||
}
|
||||
},
|
||||
|
||||
// Settings-form actions gain a scope (#plugins): 'user' renders on the user Settings
|
||||
// tab, 'instance' in the admin instance-settings dialog. Existing rows predate the
|
||||
// column and were all user-tab buttons, so the default keeps them where they were.
|
||||
() => {
|
||||
const cols = db.prepare("SELECT name FROM pragma_table_info('plugin_actions')").all() as Array<{ name: string }>;
|
||||
if (cols.length > 0 && !cols.some((c) => c.name === 'scope')) {
|
||||
db.exec("ALTER TABLE plugin_actions ADD COLUMN scope TEXT NOT NULL DEFAULT 'user'");
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
if (currentVersion < migrations.length) {
|
||||
|
||||
Reference in New Issue
Block a user