--- /dev/null
+'use strict';
+
+'require form';
+'require uci';
+'require view';
+
+return view.extend({
+ load: function () {
+ return Promise.all([
+ uci.load('rpcd')
+ ]);
+ },
+
+ render: function () {
+ let m, s, o;
+
+ if (!uci.get('rpcd', 'policy'))
+ uci.add('rpcd', 'policy', 'policy');
+
+ m = new form.Map('rpcd', _('Policy'));
+ m.readonly = !L.hasViewPermission();
+
+ s = m.section(form.NamedSection, 'policy')
+ s.addremove = false;
+ s.anonymous = true;
+
+ o = s.option(form.Flag, 'enabled',
+ _('Enable password policy'));
+ o.default = o.disabled;
+
+ o = s.option(form.Value, 'pw_length',
+ _('Require a minimum password length'));
+ o.datatype = 'uinteger';
+ o.rmempty = true;
+ o.depends('enabled', '1');
+
+ o = s.option(form.Flag, 'digits',
+ _('Require digits'));
+ o.default = o.disabled;
+ o.rmempty = true;
+ o.depends('enabled', '1');
+
+ o = s.option(form.Flag, 'uc_lc',
+ _('Require upper/lower case'));
+ o.default = o.disabled;
+ o.rmempty = true;
+ o.depends('enabled', '1');
+
+ o = s.option(form.Flag, 'special_characters',
+ _('Require special characters <br/> (e.g., !, @, #, $, %, &)'));
+ o.default = o.disabled;
+ o.rmempty = true;
+ o.depends('enabled', '1');
+
+ return m.render();
+ }
+});
}
},
+ "admin/system/admin/pwpolicy": {
+ "title": "Password Policy",
+ "order": 2,
+ "action": {
+ "type": "view",
+ "path": "system/pwpolicy"
+ },
+ "depends": {
+ "acl": [ "luci-mod-system-pwpolicy" ]
+ }
+ },
+
"admin/system/admin/dropbear": {
"title": "SSH Access",
- "order": 2,
+ "order": 5,
"action": {
"type": "view",
"path": "system/dropbear"
"admin/system/admin/sshkeys": {
"title": "SSH-Keys",
- "order": 3,
+ "order": 6,
"action": {
"type": "view",
"path": "system/sshkeys"
"admin/system/admin/uhttpd": {
"title": "HTTP(S) Access",
- "order": 4,
+ "order": 7,
"action": {
"type": "view",
"path": "system/uhttpd"
"admin/system/admin/repokeys": {
"title": "Repo Public Keys",
- "order": 5,
+ "order": 8,
"action": {
"type": "view",
"path": "system/repokeys"
"admin/system/plugins": {
"title": "Plugins",
- "order": 3,
+ "order": 4,
"action": {
"type": "view",
"path": "system/plugins"