forked from colmena/colmena
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
62 lines (49 loc) · 1.35 KB
/
config.js
File metadata and controls
62 lines (49 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'use strict'
import angular from 'angular'
const app = angular.module('com.module.core.config', [])
app.config((cfpLoadingBarProvider) => {
cfpLoadingBarProvider.includeSpinner = false
})
app.run(($rootScope, Setting, gettextCatalog) => {
// Left Sidemenu
$rootScope.menu = []
// Add Sidebar Menu
$rootScope.addMenu = (name, sref, icon) => $rootScope.menu.push({ name, sref, icon })
// Add Menu Dashboard
$rootScope.addMenu(gettextCatalog.getString('Dashboard'), 'app.home', 'fa-dashboard')
// Dashboard
$rootScope.dashboardBox = []
// Add Dashboard Box
$rootScope.addDashboardBox = (name, color, icon, quantity, href) => {
$rootScope.dashboardBox.push({ name, color, icon, quantity, href })
}
// Get Settings for Database
$rootScope.setSetting = (key, value) => {
Setting.find({
filter: {
where: {
key,
},
},
}, (data) => {
if (data.length) {
data[ 0 ].value = value
data[ 0 ].$save()
} else {
Setting.create({
key,
value,
}, (data) => console.log(data))
}
$rootScope.loadSettings()
})
}
// Load Settings blank
$rootScope.settings = {}
// Get Settings for Loopback Service
$rootScope.loadSettings = () => {
Setting.find((settings) => {
$rootScope.settings.data = settings
})
}
})