-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfig.php.example
144 lines (131 loc) · 4.93 KB
/
config.php.example
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
/*** CONFIG FILE FOR THE SWITCHCONFIG WEB APP ***/
/***
# MANUAL: HOW TO USE THE MAIN CONFIG ARRAYS #
#
# const SWITCHES = [
# [
# 'addr' => '10.1.2.3', # The address of your switch. Can be an IP-Adress or DNS name. Also used as identifier - it has to be unique.
# 'name' => 'demoswitch - Room 3.400', # Name or description of your Switch, may contains additional information like room number etc.
# 'group' => 'Group 1', # Set a group name, e.g. 'Floor 1'.
# ],
# ... more switch entries here ...
# ];
#
# const VISIBLE_VLAN = [
# ['id' => 'disabled', 'name' => '[--] DISABLED'], # keep this special entry (disables the port if selected in the web interface)
# ['id' => 1, 'name' => '[01] MyVlanDescription'], # replace with your own VLANs
# ['id' => 10, 'name' => '[10] MyVlanDescription'], # 'id' has to be the exact VLAN id like on the switches; 'name' can be anything you like
# ... more VLAN entries here ...
# ];
#
# const MAPS = [
# [
# "name" => "e_0", # A short name for this map, used internal only, e.g. in URLs.
# "displayname" => "Third Floor", # The name of this map, displayed to the user.
# "img" => "maps/floor_0.png", # The background image for this map (relative to index.php or absolute path to another webserver, beginning with http://...).
# "items" => [ # Contains the switches, which should be displayed on this map.
# [ "switch" => "demoswitch", # The name of the switch, exactly as defined in the const SWITCHES array (field 'addr').
# "x" => "2105", "y" => "105" ], # X and Y coordinates for the button on the map for this switch.
# ... more switches for this map here ...
# ],
# ... more map entries here ...
# ]
# ];
***/
/*** DEMO CONFIGURATION ***/
// enable or disable the password change feature (experimental)
const ENABLE_PASSWORD_CHANGE = false; #(true|false)
// decide if "wr mem" should be executed on the switch after each save procedure (this could take some seconds)
// NOT RECOMMENDED anymore - can lead to infinite loading times, see ADR #0001
const DO_WR_MEM = false; #(true|false)
// decide if POE should be enabled/disabled on the switchport (depending on VoIP selection)
const DO_SET_POE = false; #(true|false)
// define the voice vlan (will be set if the user enables VoIP on the switchport)
// set it to -1 if you don't want to assign VoIP options to the switchport
const VOICE_VLAN = -1; # TODO: replace with your voice VLAN ID number
// hint to show on mouse hover on the port description field
const PORT_DESCRIPTION_HINT = '';
// set which port types should be visible/available for configuring and which should be hidden
const VISIBLE_PORTS = ['Gi', 'Fa'];
const HIDDEN_PORTS = ['Gi1/1', 'Gi2/1'];
// defines all on the webinterface visible VLANs
const VISIBLE_VLAN = [
['id' => 'disabled', 'name' => '[----] DISABLED'], # special entry: disables the port
['id' => 1, 'name' => '[01] MyVLAN 1'], # TODO: replace with your own VLAN
['id' => 2, 'name' => '[02] MyVLAN 2'], # TODO: replace with your own VLAN
/* ... */
];
// define command snippets
// scope port : will be executed in port context - %PORT% is replaced with the selected port name
// scope switch : will be executed in switch context
// users : array with usernames which can execute this snippet or null
const SNIPPETS = [
/*
[
'scope' => 'port',
'id' => 'wifi-setup',
'name' => 'Setup Port for WiFi Access Point',
'users' => ['user1', 'user2'],
'cmd' => 'conf t'."\n".
'int %PORT%'."\n".
'description WIFI AP'."\n".
'switchport mode access'."\n".
'switchport access vlan 999'."\n".
'end'."\n".
'wr mem'."\n"
],
[
'scope' => 'switch',
'id' => 'powerstate',
'name' => 'Show PoE-State',
'users' => null,
'cmd' => 'sh power inline'."\n"
]
*/
];
// defines all on the webinterface visible switches
const SWITCHES = [ # TODO: insert your own switches and remove the examples
[
'addr' => 'switch_ga1',
'name' => 'switch_ga1 - 1. Etage - Raum 1.11',
'group' => 'House A',
],
[
'addr' => 'switch_ga2',
'name' => 'switch_ga2 - 2. Etage - Raum 2.11',
'group' => 'House A',
],
[##################################################
'addr' => 'switch_gb2',
'name' => 'switch_gb2 - 1. Etage - Raum 1.14',
'group' => 'House B',
],
/* ... */
];
// defines the maps and it's items with their positions
const MAPS = [ # TODO: remove the examples and (optional) create your own maps
[
"name" => "map_gebaeude_a",
"displayname" => "Haus A",
"img" => "maps/haus_a.png",
"items" => [
[ "switch" => "switch_ga1",
"x" => "480", "y" => "190" ],
[ "switch" => "switch_ga2",
"x" => "530", "y" => "512" ],
/* ... */
]
],
[
"name" => "map_gebaeude_b",
"displayname" => "Haus B",
"img" => "maps/haus_b.png",
"items" => [
[ "switch" => "switch_gb1",
"x" => "1515", "y" => "270" ],
/* ... */
]
],
/* ... */
];