mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-29 11:01:34 +08:00
Bugfix: Admin extensions page didn't refresh after install/update
This commit is contained in:
parent
eeb289ea44
commit
2e8497dc01
6 changed files with 12 additions and 24 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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')
|
||||
});
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
|
||||
h4 {
|
||||
flex-grow: 1;
|
||||
margin: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
(<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>
|
||||
|
|
Loading…
Reference in a new issue