local sys = require("luci.sys")
local util = require("luci.util")
local http = require("luci.http")
-local templ = require("luci.template")
local i18n = require("luci.i18n")
local json = require("luci.jsonc")
local uci = require("luci.model.uci").cursor()
-local fs = require("nixio.fs")
function index()
if not nixio.fs.access("/etc/config/adblock") then
rt_file = uci:get("adblock", "global", "adb_rtfile") or "/tmp/adb_runtime.json"
- if fs.access(rt_file) then
- content = json.parse(fs.readfile(rt_file))
- if content then
- http.prepare_content("application/json")
- http.write_json(content)
- end
+ if nixio.fs.access(rt_file) then
+ content = json.parse(nixio.fs.readfile(rt_file) or "")
+ http.prepare_content("application/json")
+ http.write_json(content)
end
end
.cbi-section-table-row,
.tr[data-title]::before
{
- text-align:left;
- vertical-align:top;
- margin-left:0px;
- padding-left:2px;
+ text-align: left;
+ vertical-align: top;
+ margin-left: 0px;
+ padding-left: 2px;
}
.table.cbi-section-table .th
{
- white-space:nowrap;
+ white-space: nowrap;
}
.table.cbi-section-table input
{
- width:7em;
+ width: 7em;
}
.cbi-section-table-row > .cbi-value-field [data-dynlist] > input,
.table.cbi-section-table input
{
- width:7em;
+ width: 7em;
}
.cbi-input-text
{
- text-align:left;
- padding-left:2px;
- outline:none;
- box-shadow:none;
- background:transparent;
- width:7em;
+ text-align: left;
+ padding-left: 2px;
+ outline: none;
+ box-shadow: none;
+ background: transparent;
+ width: 7em;
}
</style>
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<% if self.title then -%>
- <legend><%=self.title%></legend>
+ <h3><%=self.title%></h3>
<%- end %>
<div class="cbi-section-descr"><%=self.description%></div>
<div class="cbi-section-node">
<%#
Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
This is free software, licensed under the Apache License, Version 2.0
-local sys = require("luci.sys")
-
-%>
+
<style type="text/css">
.runtime
{
- color:#0069d6;
- font-weight:bold;
- display:inline-block;
- width:100%;
+ color: #0069d6;
+ font-weight: bold;
+ display: inline-block;
+ width: 100%;
padding-top: 0.5rem;
}
</style>