mirror of
https://github.com/edward-shen/MMM-pages.git
synced 2025-03-29 00:58:20 -07:00
Add example config files
This commit is contained in:
parent
2ccd56ef36
commit
07eed1bf3e
4 changed files with 123 additions and 4 deletions
|
@ -59,7 +59,7 @@ To use this module, add a configuration to the modules array in the `config/conf
|
|||
|
||||
There are two ways to configure this module: Using the module names or using class names. The module name based configuration is easier to use, but has the limitation that you can only use one instance of each module. So if you want to use multiple instances of the same module, you have to use the class based configuration.
|
||||
|
||||
*Note*: Some of the module names used in the following examples are fictitious.
|
||||
*Note*: You can find complete configuration example files for both module name and class based configurations in the [example_configs](example_configs) directory.
|
||||
|
||||
### Module name based configuration
|
||||
|
||||
|
@ -87,11 +87,11 @@ The first element of the array is the first page, the second element is the seco
|
|||
hiddenPages: { // modules that are only shown on specific pages
|
||||
"screenSaver": [
|
||||
"clock",
|
||||
"MMM-SomeBackgroundImageModule"
|
||||
"MMM-BackgroundSlideshow"
|
||||
],
|
||||
"admin": [
|
||||
"MMM-ShowMeSystemStatsModule",
|
||||
"MMM-AnOnScreenMenuModule"
|
||||
"MMM-SystemMonitor",
|
||||
"MMM-OnScreenMenu"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,11 +13,13 @@ const config = [
|
|||
Log: 'readonly',
|
||||
MM: 'readonly',
|
||||
Module: 'readonly',
|
||||
module: 'readonly',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
||||
'@stylistic/comma-dangle': ['error', 'only-multiline'],
|
||||
'@stylistic/max-statements-per-line': ['error', { max: 2 }],
|
||||
'@stylistic/semi': ['error', 'always'],
|
||||
'object-shorthand': ['error', 'always']
|
||||
},
|
||||
|
|
60
example_configs/config_class-name.js
Normal file
60
example_configs/config_class-name.js
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* This is an example configuration file for the MMM-pages module.
|
||||
*
|
||||
* Since it uses only default modules besides MMM-pages, it is a good starting
|
||||
* point for your configuration. You can add more modules if you want.
|
||||
*
|
||||
* It shows how to configure the module with class names. Checkout the
|
||||
* "Class based configuration" section in the README.
|
||||
*
|
||||
*/
|
||||
|
||||
let config = {
|
||||
modules: [
|
||||
{
|
||||
module: 'MMM-pages',
|
||||
config: {
|
||||
timings: {
|
||||
default: 5000,
|
||||
2: 20000
|
||||
},
|
||||
modules: [
|
||||
['page0'],
|
||||
['page1'],
|
||||
['page2'],
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
module: 'compliments',
|
||||
classes: 'page0 page1 page2',
|
||||
position: 'top_bar',
|
||||
config: {
|
||||
compliments: {
|
||||
anytime: ['Test MMM-pages: Class based configuration'],
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
module: 'clock',
|
||||
classes: 'page1',
|
||||
position: 'bottom_bar'
|
||||
},
|
||||
{
|
||||
module: 'newsfeed',
|
||||
classes: 'page2',
|
||||
position: 'middle_center',
|
||||
config: {
|
||||
feeds: [
|
||||
{
|
||||
title: 'New York Times',
|
||||
url: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
]
|
||||
};
|
||||
|
||||
/** ************* DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== 'undefined') { module.exports = config; }
|
57
example_configs/config_module-name.js
Normal file
57
example_configs/config_module-name.js
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* This is an example configuration file for the MMM-pages module.
|
||||
*
|
||||
* Since it uses only default modules besides MMM-pages, it is a good starting
|
||||
* point for your configuration. You can add more modules if you want.
|
||||
*
|
||||
* It shows how to configure the module with module names. Checkout the
|
||||
* "Module name based configuration" section in the README.
|
||||
*
|
||||
*/
|
||||
|
||||
let config = {
|
||||
modules: [
|
||||
{
|
||||
module: 'MMM-pages',
|
||||
config: {
|
||||
timings: {
|
||||
default: 5000,
|
||||
2: 20000
|
||||
},
|
||||
modules: [
|
||||
['compliments'],
|
||||
['clock'],
|
||||
['newsfeed'],
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
module: 'compliments',
|
||||
position: 'top_bar',
|
||||
config: {
|
||||
compliments: {
|
||||
anytime: ['Test MMM-pages: Module name based configuration'],
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
module: 'clock',
|
||||
position: 'top_bar'
|
||||
},
|
||||
{
|
||||
module: 'newsfeed',
|
||||
position: 'middle_center',
|
||||
config: {
|
||||
feeds: [
|
||||
{
|
||||
title: 'New York Times',
|
||||
url: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
]
|
||||
};
|
||||
|
||||
/** ************* DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== 'undefined') { module.exports = config; }
|
Loading…
Reference in a new issue