Bugfix: Admin extensions page didn't refresh after install/update

This commit is contained in:
the-djmaze 2022-02-28 17:26:23 +01:00
parent eeb289ea44
commit 2e8497dc01
6 changed files with 12 additions and 24 deletions

View file

@ -4,7 +4,7 @@ import Remote from 'Remote/Admin/Fetch';
export class AboutAdminSettings /*extends AbstractViewSettings*/ {
constructor() {
this.version = ko.observable(Settings.app('version'));
this.version = Settings.app('version');
this.phpextensions = ko.observableArray();
}

View file

@ -21,9 +21,9 @@ export class PackagesAdminSettings /*extends AbstractViewSettings*/ {
this.packages = PackageAdminStore;
addComputablesTo(this, {
packagesCurrent: () => PackageAdminStore.filter(item => item && item.installed && !item.canBeUpdated),
packagesAvailableForUpdate: () => PackageAdminStore.filter(item => item && item.installed && !!item.canBeUpdated),
packagesAvailableForInstallation: () => PackageAdminStore.filter(item => item && !item.installed),
packagesCurrent: () => PackageAdminStore().filter(item => item && item.installed && !item.canBeUpdated),
packagesUpdate: () => PackageAdminStore().filter(item => item && item.installed && item.canBeUpdated),
packagesAvailable: () => PackageAdminStore().filter(item => item && !item.installed),
visibility: () => (PackageAdminStore.loading() ? 'visible' : 'hidden')
});

View file

@ -64,6 +64,7 @@
h4 {
flex-grow: 1;
margin: 8px;
}
}
}

View file

@ -1,28 +1,16 @@
import ko from 'ko';
import { koComputable } from 'External/ko';
import Remote from 'Remote/Admin/Fetch';
import { PackageAdminStore } from 'Stores/Admin/Package';
import { AbstractViewRight } from 'Knoin/AbstractViews';
import { leftPanelDisabled, Settings } from 'Common/Globals';
import { leftPanelDisabled } from 'Common/Globals';
class PaneSettingsAdminView extends AbstractViewRight {
export class PaneSettingsAdminView extends AbstractViewRight {
constructor() {
super('AdminPane');
this.version = ko.observable(Settings.app('version'));
this.leftPanelDisabled = leftPanelDisabled;
this.adminManLoadingVisibility = koComputable(() => PackageAdminStore.loading() ? 'visible' : 'hidden');
}
logoutClick() {
Remote.request('AdminLogout', () => rl.logoutReload());
}
}
export { PaneSettingsAdminView };

View file

@ -1,6 +1,5 @@
<div class="b-toolbar g-ui-user-select-none">
<a class="btn btn-thin fontastic toggleLeft" data-bind="click: leftPanelDisabled.toggle, text: leftPanelDisabled() ? '' : ''"></a>
<i class="icon-spinner" style="margin: 10px" data-bind="style: {'visibility': adminManLoadingVisibility }"></i>
<h4>SnappyMail - <span data-i18n="TOP_PANEL/LABEL_ADMIN_PANEL"></span></h4>
<a class="btn btn-logout fontastic" data-bind="click: logoutClick"></a>
</div>

View file

@ -20,12 +20,12 @@
<br>
<div data-bind="visible: packagesAvailableForUpdate().length">
<div data-bind="visible: packagesUpdate().length">
<div class="legend">
<span data-i18n="TAB_PACKAGES/LEGEND_AVAILABLE_FOR_UPDATE"></span>&nbsp;
(<span data-bind="text: packagesAvailableForUpdate().length"></span>)
(<span data-bind="text: packagesUpdate().length"></span>)
</div>
<div data-bind="template: { name: 'AdminSettingsPackagesTable', data: {f: packagesAvailableForUpdate} }"></div>
<div data-bind="template: { name: 'AdminSettingsPackagesTable', data: {f: packagesUpdate} }"></div>
</div>
<div id="packages-installed" data-bind="visible: packagesCurrent().length, css: {'disabled': !enabledPlugins()}">
@ -33,7 +33,7 @@
<div data-bind="template: { name: 'AdminSettingsPackagesTable', data: {f: packagesCurrent} }"></div>
</div>
<div data-bind="visible: packagesAvailableForInstallation().length">
<div data-bind="visible: packagesAvailable().length">
<div class="legend" data-i18n="TAB_PACKAGES/LEGEND_AVAILABLE_FOR_INSTALLATION"></div>
<div data-bind="template: { name: 'AdminSettingsPackagesTable', data: {f: packagesAvailableForInstallation} }"></div>
<div data-bind="template: { name: 'AdminSettingsPackagesTable', data: {f: packagesAvailable} }"></div>
</div>