mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 00:20:07 +00:00
new admin devices page;
This commit is contained in:
@@ -4,21 +4,30 @@ define([
|
||||
'backbone',
|
||||
'common',
|
||||
'sysadmin-app/views/side-nav',
|
||||
'sysadmin-app/views/dashboard'
|
||||
], function($, Backbone, Common, SideNavView, DashboardView) {
|
||||
'sysadmin-app/views/dashboard',
|
||||
'sysadmin-app/views/desktop-devices',
|
||||
'sysadmin-app/views/mobile-devices',
|
||||
'sysadmin-app/views/device-errors'
|
||||
], function($, Backbone, Common, SideNavView, DashboardView,
|
||||
DesktopDevicesView, MobileDevicesView, DeviceErrorsView) {
|
||||
"use strict";
|
||||
|
||||
var Router = Backbone.Router.extend({
|
||||
routes: {
|
||||
'': 'showDashboard',
|
||||
'dashboard/': 'showDashboard',
|
||||
'desktop-devices/': 'showDesktopDevices',
|
||||
'mobile-devices/': 'showMobileDevices',
|
||||
'device-errors/': 'showDeviceErrors',
|
||||
// Default
|
||||
'*actions': 'showDashboard'
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
$('#initial-loading-view').hide();
|
||||
|
||||
Common.prepareApiCsrf();
|
||||
Common.initAccountPopup();
|
||||
Common.initLocale();
|
||||
|
||||
this.sideNavView = new SideNavView();
|
||||
app.ui = {
|
||||
@@ -26,6 +35,10 @@ define([
|
||||
};
|
||||
|
||||
this.dashboardView = new DashboardView();
|
||||
this.desktopDevicesView = new DesktopDevicesView();
|
||||
this.mobileDevicesView = new MobileDevicesView();
|
||||
this.deviceErrorsView = new DeviceErrorsView();
|
||||
|
||||
this.currentView = this.dashboardView;
|
||||
|
||||
$('#info-bar .close').click(Common.closeTopNoticeBar);
|
||||
@@ -42,6 +55,38 @@ define([
|
||||
this.switchCurrentView(this.dashboardView);
|
||||
this.sideNavView.setCurTab('dashboard');
|
||||
this.dashboardView.show();
|
||||
},
|
||||
|
||||
showDesktopDevices: function(current_page) {
|
||||
var url = window.location.href;
|
||||
var page = url.match(/.*?page=(\d+)/);
|
||||
if (page) {
|
||||
current_page = page[1];
|
||||
} else {
|
||||
current_page = null;
|
||||
}
|
||||
this.switchCurrentView(this.desktopDevicesView);
|
||||
this.sideNavView.setCurTab('devices');
|
||||
this.desktopDevicesView.show({'current_page': current_page});
|
||||
},
|
||||
|
||||
showMobileDevices: function(current_page) {
|
||||
var url = window.location.href;
|
||||
var page = url.match(/.*?page=(\d+)/);
|
||||
if (page) {
|
||||
current_page = page[1];
|
||||
} else {
|
||||
current_page = null;
|
||||
}
|
||||
this.switchCurrentView(this.mobileDevicesView);
|
||||
this.sideNavView.setCurTab('devices');
|
||||
this.mobileDevicesView.show({'current_page': current_page});
|
||||
},
|
||||
|
||||
showDeviceErrors: function() {
|
||||
this.switchCurrentView(this.deviceErrorsView);
|
||||
this.sideNavView.setCurTab('devices');
|
||||
this.deviceErrorsView.show();
|
||||
}
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user