mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-01 01:28:26 +02:00
feat(core): admin system control panel client side routs, policy, controllers, services, menu
This commit is contained in:
3
config/env/torrents.js
vendored
3
config/env/torrents.js
vendored
@@ -1,6 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
|
||||
//[!config_content]//
|
||||
meanTorrentConfig: {
|
||||
/**
|
||||
* @app
|
||||
@@ -1218,4 +1220,5 @@ module.exports = {
|
||||
]
|
||||
}
|
||||
}
|
||||
//[!config_content]//
|
||||
};
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
MENU_ADMIN_MESSAGES: 'System Messages',
|
||||
MENU_ADMIN_TRACE: 'System Traces',
|
||||
MENU_ADMIN_FORUMS_CONFIGURE: 'Forums Configure',
|
||||
MENU_ADMIN_SYSTEMS: 'System control panel',
|
||||
MENU_USERS_ADMIN: 'Manage User',
|
||||
MENU_UPLOAD: 'Upload',
|
||||
MENU_FORUMS: 'Forums',
|
||||
@@ -223,6 +224,7 @@
|
||||
ADMIN_FORUMS_MANAGEMENT: 'Forums Management',
|
||||
ADMIN_OFFICIAL_INVITATION: 'Official invitations',
|
||||
ADMIN_BACKUP: 'System Backup Files Manager',
|
||||
ADMIN_SYSTEMS: 'System Control Panel',
|
||||
PASSWORD_FORGOT: 'Password forgot',
|
||||
PASSWORD_RESET: 'Password reset',
|
||||
MESSAGES_BOX: 'Message Box',
|
||||
@@ -1254,6 +1256,12 @@
|
||||
PAGE_NOT_FOUND: 'Page Or Resources Not Found'
|
||||
},
|
||||
|
||||
//systems control panel
|
||||
SYSTEMS: {
|
||||
TORRENTS_CONFIG: 'System configure',
|
||||
TEMPLATE_EDIT: 'Template editor'
|
||||
},
|
||||
|
||||
/////////////////////////resources tag fields///////////////////////////////////
|
||||
RESOURCESTAGS: {
|
||||
TYPE: {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
MENU_ADMIN_MESSAGES: '系统消息',
|
||||
MENU_ADMIN_TRACE: '系统日志',
|
||||
MENU_ADMIN_FORUMS_CONFIGURE: '论坛配置管理',
|
||||
MENU_ADMIN_SYSTEMS: '系统控制面板',
|
||||
MENU_USERS_ADMIN: '用户管理',
|
||||
MENU_UPLOAD: '发布',
|
||||
MENU_FORUMS: '论坛',
|
||||
@@ -223,6 +224,7 @@
|
||||
ADMIN_FORUMS_MANAGEMENT: '论坛管理',
|
||||
ADMIN_OFFICIAL_INVITATION: '官方邀请',
|
||||
ADMIN_BACKUP: '系统备份文件管理',
|
||||
ADMIN_SYSTEMS: '系统控制面板',
|
||||
PASSWORD_FORGOT: '找回密码',
|
||||
PASSWORD_RESET: '重设密码',
|
||||
MESSAGES_BOX: '站内消息',
|
||||
@@ -1254,6 +1256,12 @@
|
||||
PAGE_NOT_FOUND: '没有找到页面或资源'
|
||||
},
|
||||
|
||||
//systems control panel
|
||||
SYSTEMS: {
|
||||
TORRENTS_CONFIG: '系统配置调整',
|
||||
TEMPLATE_EDIT: '模板在线编辑'
|
||||
},
|
||||
|
||||
/////////////////////////resources tag fields///////////////////////////////////
|
||||
RESOURCESTAGS: {
|
||||
TYPE: {
|
||||
|
||||
20
modules/systems/client/config/systems-admin.client.menu.js
Normal file
20
modules/systems/client/config/systems-admin.client.menu.js
Normal file
@@ -0,0 +1,20 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// Configuring the Articles Admin module
|
||||
angular
|
||||
.module('systems.admin')
|
||||
.run(menuConfig);
|
||||
|
||||
menuConfig.$inject = ['menuService'];
|
||||
|
||||
function menuConfig(menuService) {
|
||||
menuService.addSubMenuItem('topbar', 'admin', {
|
||||
title: 'MENU_ADMIN_SYSTEMS',
|
||||
state: 'admin.systems.config',
|
||||
position: 1000,
|
||||
roles: ['admin'],
|
||||
divider: true
|
||||
});
|
||||
}
|
||||
}());
|
||||
32
modules/systems/client/config/systems-admin.client.routes.js
Normal file
32
modules/systems/client/config/systems-admin.client.routes.js
Normal file
@@ -0,0 +1,32 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// Setting up route
|
||||
angular
|
||||
.module('systems.admin.routes')
|
||||
.config(routeConfig);
|
||||
|
||||
routeConfig.$inject = ['$stateProvider'];
|
||||
|
||||
function routeConfig($stateProvider) {
|
||||
$stateProvider
|
||||
.state('admin.systems', {
|
||||
url: '/systems',
|
||||
abstract: true,
|
||||
templateUrl: '/modules/systems/client/views/panel.client.view.html',
|
||||
data: {
|
||||
pageTitle: 'PAGETITLE.ADMIN_SYSTEMS',
|
||||
roles: ['admin']
|
||||
}
|
||||
})
|
||||
.state('admin.systems.config', {
|
||||
url: '/config',
|
||||
templateUrl: '/modules/systems/client/views/config.client.view.html'
|
||||
})
|
||||
.state('admin.systems.template', {
|
||||
url: '/template',
|
||||
templateUrl: '/modules/systems/client/views/template.client.view.html'
|
||||
});
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('systems')
|
||||
.controller('SystemConfigController', SystemConfigController);
|
||||
|
||||
SystemConfigController.$inject = ['$scope', '$state', '$timeout', '$translate', 'Authentication', 'SystemsService'];
|
||||
|
||||
function SystemConfigController($scope, $state, $timeout, $translate, Authentication, SystemsService) {
|
||||
var vm = this;
|
||||
vm.user = Authentication.user;
|
||||
|
||||
/**
|
||||
* getConfigFile
|
||||
*/
|
||||
vm.getConfigFile = function () {
|
||||
SystemsService.getSystemConfig(function (res) {
|
||||
vm.systemConfigContent = res.configContent;
|
||||
}, function (err) {
|
||||
|
||||
});
|
||||
};
|
||||
}
|
||||
}());
|
||||
25
modules/systems/client/less/systems.less
Normal file
25
modules/systems/client/less/systems.less
Normal file
@@ -0,0 +1,25 @@
|
||||
@import (reference) "../../../core/client/less/mt-var.less";
|
||||
|
||||
.system-panel {
|
||||
.panel-heading {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
small {
|
||||
color: #888;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
.panel-desc {
|
||||
border-bottom: solid 1px #ddd;
|
||||
background-color: #fafbfc;
|
||||
height: 100px;
|
||||
}
|
||||
.panel-body {
|
||||
padding: 5px;
|
||||
.config-content {
|
||||
min-height: 400px;
|
||||
max-height: 800px;
|
||||
resize: vertical;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
modules/systems/client/services/systems.client.service.js
Normal file
23
modules/systems/client/services/systems.client.service.js
Normal file
@@ -0,0 +1,23 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('systems.services')
|
||||
.factory('SystemsService', SystemsService);
|
||||
|
||||
SystemsService.$inject = ['$resource'];
|
||||
|
||||
function SystemsService($resource) {
|
||||
return $resource('/api/systems/:systemId', {
|
||||
requestId: '@_id'
|
||||
}, {
|
||||
update: {
|
||||
method: 'PUT'
|
||||
},
|
||||
getSystemConfig: {
|
||||
method: 'GET',
|
||||
url: '/api/systems/systemConfig'
|
||||
}
|
||||
});
|
||||
}
|
||||
}());
|
||||
9
modules/systems/client/systems.client.module.js
Normal file
9
modules/systems/client/systems.client.module.js
Normal file
@@ -0,0 +1,9 @@
|
||||
(function (app) {
|
||||
'use strict';
|
||||
|
||||
app.registerModule('systems', ['core']);// The core module is required for special route handling; see /core/client/config/core.client.routes
|
||||
app.registerModule('systems.admin', ['core.admin']);
|
||||
app.registerModule('systems.admin.routes', ['core.admin.routes']);
|
||||
app.registerModule('systems.services');
|
||||
app.registerModule('systems.routes', ['ui.router', 'core.routes', 'systems.services']);
|
||||
}(ApplicationConfiguration));
|
||||
14
modules/systems/client/views/config.client.view.html
Normal file
14
modules/systems/client/views/config.client.view.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<div class="panel panel-default system-panel" ng-controller="SystemConfigController as vm" ng-init="vm.getConfigFile()">
|
||||
<div class="panel-heading">{{'SYSTEMS.TORRENTS_CONFIG' | translate}} - <small>/config/env/torrent.js</small></div>
|
||||
<div class="panel-desc">
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control config-content" id="configContent" name="configContent" ng-model="vm.systemConfigContent"></textarea>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<div class="text-right">
|
||||
<button class="btn btn-success btn-width-100">{{'BUTTON_SAVE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
13
modules/systems/client/views/panel.client.view.html
Normal file
13
modules/systems/client/views/panel.client.view.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<section class="container padding-top-30">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-md-3">
|
||||
<div class="list-group">
|
||||
<a ui-sref="admin.systems.config" class="list-group-item" ui-sref-active="active">{{'SYSTEMS.TORRENTS_CONFIG' | translate}}</a>
|
||||
<a ui-sref="admin.systems.template" class="list-group-item" ui-sref-active="active">{{'SYSTEMS.TEMPLATE_EDIT' | translate}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8 col-md-9">
|
||||
<div ui-view></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
11
modules/systems/client/views/template.client.view.html
Normal file
11
modules/systems/client/views/template.client.view.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="panel panel-default system-panel">
|
||||
<div class="panel-heading">
|
||||
{{'SYSTEMS.TEMPLATE_EDIT' | translate}}
|
||||
</div>
|
||||
<div class="panel-desc">
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>...</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,8 +24,7 @@
|
||||
menuService.addSubMenuItem('topbar', 'admin', {
|
||||
title: 'MENU_TORRENTS_ADMIN_EDAU',
|
||||
state: 'admin.announce',
|
||||
position: 1000,
|
||||
divider: true
|
||||
position: 60
|
||||
});
|
||||
}
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user