Skip to content

Commit

Permalink
Merge branch 'master' into fix-nil-deref
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Dec 25, 2023
2 parents 3c532f5 + 4bc5c34 commit bf6cfdb
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -33,12 +33,15 @@ NOTE: Add new changes BELOW THIS COMMENT.

### Fixed

- Statistics for 7 days displayed as 168 hours on the dashboard.
- Pre-filling the Edit static lease window with data ([#6534]).
- Names defined in the `/etc/hosts` for a single address family wrongly
considered undefined for another family ([#6541]).
- Omitted CNAME records in safe search results, which can cause YouTube to not
work on iOS ([#6352]).

[#6352]: https://github.com/AdguardTeam/AdGuardHome/issues/6352
[#6534]: https://github.com/AdguardTeam/AdGuardHome/issues/6534
[#6541]: https://github.com/AdguardTeam/AdGuardHome/issues/6541
[#6545]: https://github.com/AdguardTeam/AdGuardHome/issues/6545

Expand Down
7 changes: 5 additions & 2 deletions client/src/components/Settings/Dhcp/Leases.js
Expand Up @@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ReactTable from 'react-table';
import { Trans, withTranslation } from 'react-i18next';
import { LEASES_TABLE_DEFAULT_PAGE_SIZE } from '../../../helpers/constants';
import { LEASES_TABLE_DEFAULT_PAGE_SIZE, MODAL_TYPE } from '../../../helpers/constants';
import { sortIp } from '../../../helpers/helpers';
import { toggleLeaseModal } from '../../../actions';

Expand All @@ -18,7 +18,10 @@ class Leases extends Component {

convertToStatic = (data) => () => {
const { dispatch } = this.props;
dispatch(toggleLeaseModal(data));
dispatch(toggleLeaseModal({
type: MODAL_TYPE.ADD_LEASE,
config: data,
}));
}

makeStatic = ({ row }) => {
Expand Down
1 change: 1 addition & 0 deletions client/src/helpers/constants.js
Expand Up @@ -181,6 +181,7 @@ export const MODAL_TYPE = {
ADD_REWRITE: 'ADD_REWRITE',
EDIT_REWRITE: 'EDIT_REWRITE',
EDIT_LEASE: 'EDIT_LEASE',
ADD_LEASE: 'ADD_LEASE',
};

export const CLIENT_ID = {
Expand Down
3 changes: 2 additions & 1 deletion client/src/reducers/dhcp.js
Expand Up @@ -128,7 +128,8 @@ const dhcp = handleActions(
const newState = {
...state,
isModalOpen: !state.isModalOpen,
leaseModalConfig: payload,
modalType: payload?.type || '',
leaseModalConfig: payload?.config,
};
return newState;
},
Expand Down
6 changes: 5 additions & 1 deletion internal/stats/unit.go
Expand Up @@ -484,7 +484,7 @@ func (s *StatsCtx) fillCollectedStats(data *StatsResp, units []*unitDB, curID ui
data.TimeUnits = timeUnitsHours

daysCount := size / 24
if daysCount > 7 {
if daysCount >= 7 {
size = daysCount
data.TimeUnits = timeUnitsDays
}
Expand All @@ -510,6 +510,10 @@ func (s *StatsCtx) fillCollectedStats(data *StatsResp, units []*unitDB, curID ui

// fillCollectedStatsDaily fills data with collected daily statistics. units
// must contain data for the count of days.
//
// TODO(s.chzhen): Improve collection of statistics for frontend. Dashboard
// cards should contain statistics for the whole interval without rounding to
// days.
func (s *StatsCtx) fillCollectedStatsDaily(
data *StatsResp,
units []*unitDB,
Expand Down
9 changes: 8 additions & 1 deletion openapi/CHANGELOG.md
Expand Up @@ -4,6 +4,13 @@

## v0.108.0: API changes

## v0.107.44: API changes

### Type correction in `Client`

* Field `upstreams_cache_size` of object `Client` now correctly has type
`integer` instead of the previous incorrect type `boolean`.

## v0.107.42: API changes

### The new field `"serve_plain_dns"` in `TlsConfig`
Expand Down Expand Up @@ -152,7 +159,7 @@ has the following format:
* The new field `"top_upstreams_responses"` in `GET /control/stats` method
shows the total number of responses from each upstream.

* The new field `"top_upstrems_avg_time"` in `GET /control/stats` method shows
* The new field `"top_upstreams_avg_time"` in `GET /control/stats` method shows
the average processing time in seconds of requests from each upstream.

## v0.107.30: API changes
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi.yaml
Expand Up @@ -2709,7 +2709,7 @@
changed.
This behaviour can be changed in the future versions.
'type': 'boolean'
'type': 'integer'
'ClientAuto':
'type': 'object'
'description': 'Auto-Client information'
Expand Down

0 comments on commit bf6cfdb

Please sign in to comment.