-
Notifications
You must be signed in to change notification settings - Fork 0
/
plans.yml
149 lines (134 loc) · 4.48 KB
/
plans.yml
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
145
146
147
148
149
AccountGroup:
- name: Free
policy: Free
priority: 4
TimePlan:
- name: One Day
price: 0.0
usage_time: 1
usage_time_unit: days
QuotaPlan:
- name: 5GB / 2GB
price: 0.0
usage_mb_up: 2048
usage_mb_down: 5120
UsagePlan:
- name: One Day Free 5GB
account_group: Free
currency: USD
recurring_method: none
variable_recurring_day: true
automatic_login: true
time_plan: One Day
quota_plan: 5GB / 2GB
usage_lifetime_time: 1
recurring_retry_grace_minutes: 1440
recurring_fail_limit: 5
lock_devices: true
max_sessions: 3
unlimited_devices: true
usage_lifetime_time_unit: days
max_dedicated_ips: 0
pms_guest_match_operator: OR
recurring_lifetime_time_unit: months
unlimited_recurring_lifetime: true
validation_method: none
validation_grace_minutes: 0
max_party_devices: 0
captive_portals:
- Default Splash
landing_portals:
- Default Landing
PortalMod:
- name: Simpler menu
partial: menu
html: |
<%%
icon_style ||= :solid
bottom_button ||= nil
nav_links = [
{
action: :index,
icon: (@logged_in ? 'tachometer-alt' : 'home'),
title: (@logged_in ? _('Dashboard') : _('Home')),
},
]
# Manage Devices
nav_links << {
action: :manage_devices,
icon: 'desktop',
title: _('Devices'),
} if @current_account_or_token.try(:can_manage_devices?)
# Profile and Billing
if @current_account
unless @current_account.pms_room
# Profile
nav_links << {
action: :account_info,
icon: 'user',
title: _('Profile'),
}
# Billing
# nav_links << {
# action: :billing,
# icon: 'credit-card',
# title: _('Billing'),
# }
end # unless @current_account.pms_room
end # if @current_account
# Coupon
nav_links << {
action: :coupon,
icon: 'ticket-alt',
title: _('Coupon'),
} if Coupon.any?
# Usage
nav_links << {
action: :usage,
icon: 'chart-bar',
title: _('Usage'),
} if @current_account_or_token
# Location
nav_links << {
action: :map,
icon: 'street-view',
title: _('Location'),
} if client_floor
# Logout and Sign Up
if @logged_in
nav_links << {
action: :login_session_destroy,
icon: 'sign-out-alt',
title: _('Logout'),
method: :delete,
} if !@login_session.account || (@login_session.account && @login_session.account.lock_devices == false)
# Usage Plans Button
# bottom_button ||= { action: :usage_plan_list, icon: 'shopping-cart', title: _('Upgrade Plan') } unless @usage_plans.empty? || !@current_account_or_token
end # if @logged in
# Sign Up Button
bottom_button ||= { action: :sign_up, icon: 'user-plus', title: _('Sign Up') } unless @logged_in
if bottom_button
bottom_button_icon = fa_icon(icon: bottom_button[:icon], style: icon_style, fixed: true, class: 'me-3')
bottom_button_text = bottom_button_icon ? (_('%{icon} %{title}') % { icon: bottom_button_icon, title: bottom_button[:title] }).html_safe : bottom_button[:title]
end # if bottom_button
%>
<%%= nav(class: ['flex-column align-items-start h-100 py-4 text-nowrap']) do %>
<%% nav_links.each do |link| %>
<%%
link_icon = nil
link_icon = fa_icon(style: icon_style, icon: link[:icon].to_s, fixed_width: true, size: :lg, class: 'me-3') if link[:icon]
link_title = link[:title].to_s
link_text = link_icon ? (_('%{icon} %{title}') % { icon: link_icon, title: link_title }).html_safe : link_title
%>
<%%= nav_link({action: link[:action]}, link_text.html_safe,
active: ((params[:action].to_s == link[:action].to_s) || (params[:no_please_wait] == 'true' && params[:action] == 'login_success' && link[:title] == 'Dashboard')),
disabled: !!link[:disabled], method: link[:method] || :get, class: 'mb-3')
%>
<%% end # nav_links.each %>
<%% if bottom_button %>
<%%= button(bottom_button_text, url: {action: bottom_button[:action]}, context: :primary, class: ' w-75 mx-auto') %>
<%% end # if bottom_button %>
<%% end # nav %>
mod_type: partial
landing_portals:
- Default Landing