Pull request: all: imp ann url

Updates #4209.

Squashed commit of the following:

commit 0c31a59c5bf6bcc27a4779adf226d9a1ac9eece1
Merge: 803f32db 8455940b
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Feb 1 19:33:55 2022 +0300

    Merge branch 'master' into 4209-ann-url

commit 803f32dbc7276077a4374ed0f5e0a1fa36f91c9b
Author: Ildar Kamalov <ik@adguard.com>
Date:   Tue Feb 1 14:46:47 2022 +0300

    client: add manual update link to update topline

commit ca375b52fa53503a3987b9723eb9a1d74878e890
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Jan 31 20:49:42 2022 +0300

    all: imp ann url
This commit is contained in:
Ainar Garipov 2022-02-01 19:42:07 +03:00
parent 8455940b59
commit 76fa60498e
3 changed files with 32 additions and 14 deletions

View File

@ -403,6 +403,7 @@
"dns_providers": "Here is a <0>list of known DNS providers</0> to choose from.", "dns_providers": "Here is a <0>list of known DNS providers</0> to choose from.",
"update_now": "Update now", "update_now": "Update now",
"update_failed": "Auto-update failed. Please <a>follow these steps</a> to update manually.", "update_failed": "Auto-update failed. Please <a>follow these steps</a> to update manually.",
"manual_update": "Please <a>follow these steps</a> to update manually.",
"processing_update": "Please wait, AdGuard Home is being updated", "processing_update": "Please wait, AdGuard Home is being updated",
"clients_title": "Clients", "clients_title": "Clients",
"clients_desc": "Configure devices connected to AdGuard Home", "clients_desc": "Configure devices connected to AdGuard Home",

View File

@ -1,8 +1,10 @@
import React from 'react'; import React from 'react';
import { Trans } from 'react-i18next'; import { Trans } from 'react-i18next';
import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import Topline from './Topline'; import Topline from './Topline';
import { getUpdate } from '../../actions'; import { getUpdate } from '../../actions';
import { MANUAL_UPDATE_LINK } from '../../helpers/constants';
const UpdateTopline = () => { const UpdateTopline = () => {
const { const {
@ -29,16 +31,27 @@ const UpdateTopline = () => {
> >
update_announcement update_announcement
</Trans> </Trans>
{canAutoUpdate &nbsp;
&& <button {canAutoUpdate ? (
type="button" <button
className="btn btn-sm btn-primary ml-3" type="button"
onClick={handleUpdate} className="btn btn-sm btn-primary ml-3"
disabled={processingUpdate} onClick={handleUpdate}
> disabled={processingUpdate}
<Trans>update_now</Trans> >
</button> <Trans>update_now</Trans>
} </button>
) : (
<Trans components={{
a: (
<a href={MANUAL_UPDATE_LINK} target="_blank" rel="noopener noreferrer" key="0">
Link
</a>
),
}}>
manual_update
</Trans>
)}
</> </>
</Topline>; </Topline>;
}; };

View File

@ -379,17 +379,21 @@ readonly version_download_url version_json
# Point users to the master branch if the channel is edge. # Point users to the master branch if the channel is edge.
if [ "$channel" = 'edge' ] if [ "$channel" = 'edge' ]
then then
version_history_url='https://github.com/AdguardTeam/AdGuardHome/commits/master' # TODO(a.garipov): Put a link to the platforms page here. Something like:
#
# announcement_url='https://github.com/AdguardTeam/AdGuardHome/wiki/Platforms'
#
announcement_url='https://github.com/AdguardTeam/AdGuardHome/commits/master'
else else
version_history_url='https://github.com/AdguardTeam/AdGuardHome/releases' announcement_url="https://github.com/AdguardTeam/AdGuardHome/releases/tag/${version}"
fi fi
readonly version_history_url readonly announcement_url
rm -f "$version_json" rm -f "$version_json"
echo "{ echo "{
\"version\": \"${version}\", \"version\": \"${version}\",
\"announcement\": \"AdGuard Home ${version} is now available!\", \"announcement\": \"AdGuard Home ${version} is now available!\",
\"announcement_url\": \"${version_history_url}\", \"announcement_url\": \"${announcement_url}\",
\"selfupdate_min_version\": \"0.0\", \"selfupdate_min_version\": \"0.0\",
" >> "$version_json" " >> "$version_json"