Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b54bf94697 | ||
|
|
7fade498b9 | ||
|
|
39640d8190 | ||
|
|
242e5e136f | ||
|
|
b105f20837 | ||
|
|
8521635f63 |
@@ -233,6 +233,7 @@ export const getProfile = () => async (dispatch) => {
|
||||
export const dnsStatusRequest = createAction('DNS_STATUS_REQUEST');
|
||||
export const dnsStatusFailure = createAction('DNS_STATUS_FAILURE');
|
||||
export const dnsStatusSuccess = createAction('DNS_STATUS_SUCCESS');
|
||||
export const setDnsRunningStatus = createAction('SET_DNS_RUNNING_STATUS');
|
||||
|
||||
export const getDnsStatus = () => async (dispatch) => {
|
||||
dispatch(dnsStatusRequest());
|
||||
@@ -242,15 +243,17 @@ export const getDnsStatus = () => async (dispatch) => {
|
||||
dispatch(dnsStatusFailure());
|
||||
window.location.reload(true);
|
||||
};
|
||||
|
||||
const handleRequestSuccess = (response) => {
|
||||
const dnsStatus = response.data;
|
||||
const runningStatus = dnsStatus && dnsStatus.running;
|
||||
const { running } = dnsStatus;
|
||||
const runningStatus = dnsStatus && running;
|
||||
if (runningStatus === true) {
|
||||
dispatch(dnsStatusSuccess(dnsStatus));
|
||||
dispatch(getVersion());
|
||||
dispatch(getTlsStatus());
|
||||
dispatch(getProfile());
|
||||
} else {
|
||||
dispatch(setDnsRunningStatus(running));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -89,12 +89,13 @@ class App extends Component {
|
||||
<LoadingBar className="loading-bar" updateTime={1000} />
|
||||
<Route component={Header} />
|
||||
<div className="container container--wrap">
|
||||
{dashboard.processing && !dashboard.isCoreRunning && (
|
||||
{dashboard.processing && <Loading />}
|
||||
{!dashboard.isCoreRunning && (
|
||||
<div className="row row-cards">
|
||||
<div className="col-lg-12">
|
||||
<Status reloadPage={this.reloadPage}
|
||||
message="dns_start"
|
||||
/>
|
||||
/>
|
||||
<Loading />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,12 +58,13 @@ const settings = handleActions(
|
||||
|
||||
const dashboard = handleActions(
|
||||
{
|
||||
[actions.setDnsRunningStatus]: (state, { payload }) =>
|
||||
({ ...state, isCoreRunning: payload }),
|
||||
[actions.dnsStatusRequest]: state => ({ ...state, processing: true }),
|
||||
[actions.dnsStatusFailure]: state => ({ ...state, processing: false }),
|
||||
[actions.dnsStatusSuccess]: (state, { payload }) => {
|
||||
const {
|
||||
version,
|
||||
running,
|
||||
dns_port: dnsPort,
|
||||
dns_addresses: dnsAddresses,
|
||||
upstream_dns: upstreamDns,
|
||||
@@ -75,7 +76,7 @@ const dashboard = handleActions(
|
||||
} = payload;
|
||||
const newState = {
|
||||
...state,
|
||||
isCoreRunning: running,
|
||||
isCoreRunning: true,
|
||||
processing: false,
|
||||
dnsVersion: version,
|
||||
dnsPort,
|
||||
@@ -187,7 +188,7 @@ const dashboard = handleActions(
|
||||
},
|
||||
{
|
||||
processing: true,
|
||||
isCoreRunning: false,
|
||||
isCoreRunning: true,
|
||||
processingVersion: true,
|
||||
processingFiltering: true,
|
||||
processingClients: true,
|
||||
|
||||
@@ -119,13 +119,13 @@ type accessListJSON struct {
|
||||
}
|
||||
|
||||
func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) {
|
||||
s.Lock()
|
||||
s.RLock()
|
||||
j := accessListJSON{
|
||||
AllowedClients: s.conf.AllowedClients,
|
||||
DisallowedClients: s.conf.DisallowedClients,
|
||||
BlockedHosts: s.conf.BlockedHosts,
|
||||
}
|
||||
s.Unlock()
|
||||
s.RUnlock()
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
err := json.NewEncoder(w).Encode(j)
|
||||
|
||||
@@ -94,7 +94,7 @@ func stringArrayDup(a []string) []string {
|
||||
|
||||
// WriteDiskConfig - write configuration
|
||||
func (s *Server) WriteDiskConfig(c *FilteringConfig) {
|
||||
s.Lock()
|
||||
s.RLock()
|
||||
sc := s.conf.FilteringConfig
|
||||
*c = sc
|
||||
c.RatelimitWhitelist = stringArrayDup(sc.RatelimitWhitelist)
|
||||
@@ -103,7 +103,7 @@ func (s *Server) WriteDiskConfig(c *FilteringConfig) {
|
||||
c.DisallowedClients = stringArrayDup(sc.DisallowedClients)
|
||||
c.BlockedHosts = stringArrayDup(sc.BlockedHosts)
|
||||
c.UpstreamDNS = stringArrayDup(sc.UpstreamDNS)
|
||||
s.Unlock()
|
||||
s.RUnlock()
|
||||
}
|
||||
|
||||
// FilteringConfig represents the DNS filtering configuration of AdGuard Home
|
||||
|
||||
2
go.mod
2
go.mod
@@ -3,7 +3,7 @@ module github.com/AdguardTeam/AdGuardHome
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/AdguardTeam/dnsproxy v0.23.2
|
||||
github.com/AdguardTeam/dnsproxy v0.23.3
|
||||
github.com/AdguardTeam/golibs v0.3.0
|
||||
github.com/AdguardTeam/urlfilter v0.7.0
|
||||
github.com/NYTimes/gziphandler v1.1.1
|
||||
|
||||
4
go.sum
4
go.sum
@@ -1,5 +1,5 @@
|
||||
github.com/AdguardTeam/dnsproxy v0.23.2 h1:HbBzoe9Pssj4UjvbeBUPHz7cpCt/7/LpVKu4olhPcKk=
|
||||
github.com/AdguardTeam/dnsproxy v0.23.2/go.mod h1:2qy8rpdfBzKgMPxkHmPdaNK4XZJ322v4KtVGI8s8Bn0=
|
||||
github.com/AdguardTeam/dnsproxy v0.23.3 h1:RzI9M0sX99t7qnlikvKTPW25sCFzgfBStxUJ+2z1KQI=
|
||||
github.com/AdguardTeam/dnsproxy v0.23.3/go.mod h1:2qy8rpdfBzKgMPxkHmPdaNK4XZJ322v4KtVGI8s8Bn0=
|
||||
github.com/AdguardTeam/golibs v0.2.4 h1:GUssokegKxKF13K67Pgl0ZGwqHjNN6X7sep5ik6ORdY=
|
||||
github.com/AdguardTeam/golibs v0.2.4/go.mod h1:R3M+mAg3nWG4X4Hsag5eef/TckHFH12ZYhK7AzJc8+U=
|
||||
github.com/AdguardTeam/golibs v0.3.0 h1:1zO8ulGEOdXDDM++Ap4sYfTsT/Z4tZBZtiWSA4ykcOU=
|
||||
|
||||
Reference in New Issue
Block a user