refactor mac service

This commit is contained in:
rustdesk
2022-01-17 12:05:06 +08:00
parent a12f24bf16
commit 5af1258454
22 changed files with 173 additions and 171 deletions

View File

@@ -25,6 +25,11 @@ body {
color: color(text);
}
div {
word-wrap: break-word;
// word-break: break-all; // this will break english word
}
button.button {
height: 2em;
border-radius: 0.5em;
@@ -257,8 +262,6 @@ div.msgbox div.right-side div {
div.msgbox div.text {
margin-top: 0.5em;
word-wrap: break-word;
word-break: break-all;
}
@media platform != "OSX" {

View File

@@ -324,9 +324,11 @@ div.install-me, div.trust-me {
background: linear-gradient(left,#e242bc,#f4727c);
}
div.trust-me > div:nth-child(1),
div.install-me > div:nth-child(1) {
font-size: 1.2em;
font-weight: bold;
text-align: center;
margin-bottom: 0.5em;
}
@@ -334,19 +336,16 @@ div.install-me > div:nth-child(2) {
line-height: 1.4em;
}
div.trust-me > div:nth-child(1) {
font-size: 1.2em;
text-align: center;
font-weight: bold;
margin-bottom: 0.5em;
#install-me.link {
margin-top: 0.5em;
}
div.trust-me > div:nth-child(2) {
text-align: center;
font-size: 0.9em;
margin-bottom: 1em;
}
div#install-me.link,
div.trust-me > div:nth-child(3) {
text-align: center;
font-size: 1.5em;

View File

@@ -302,12 +302,12 @@ class App: Reactor.Component
<Password />
</div>
</div>
{handler.is_installed() ? "": <InstallMe />}
{handler.is_installed() && software_update_url ? <UpdateMe /> : ""}
{handler.is_installed() && !software_update_url && handler.is_installed_lower_version() ? <UpgradeMe /> : ""}
{!is_win || handler.is_installed() ? "": <InstallMe />}
{software_update_url ? <UpdateMe /> : ""}
{is_win && handler.is_installed() && !software_update_url && handler.is_installed_lower_version() ? <UpgradeMe /> : ""}
{is_can_screen_recording ? "": <CanScreenRecording />}
{is_can_screen_recording && !handler.is_process_trusted(false) ? <TrustMe /> : ""}
{is_can_screen_recording && handler.is_process_trusted(false) && !handler.is_installed_daemon(false) ? <InstallDaemon /> : ""}
{is_can_screen_recording && handler.is_process_trusted(false) && handler.is_installed() && !handler.is_installed_daemon(false) ? <InstallDaemon /> : ""}
{system_error ? <SystemError /> : ""}
{!system_error && handler.is_login_wayland() && !handler.current_is_wayland() ? <FixWayland /> : ""}
{!system_error && handler.current_is_wayland() ? <ModifyDefaultLogin /> : ""}
@@ -347,7 +347,7 @@ class InstallMe: Reactor.Component {
return <div .install-me>
<span />
<div>{translate('install_tip')}</div>
<div style="text-align: center; margin-top: 1em;"><button #install-me .button>{translate('Install')}</button></div>
<div><button #install-me .button>{translate('Install')}</button></div>
</div>;
}
@@ -404,7 +404,7 @@ class UpgradeMe: Reactor.Component {
return <div .install-me>
<div>{translate('Status')}</div>
<div>{translate('Your installation is lower version.')}</div>
<div #install-me .link style="padding-top: 1em">{translate('Click to upgrade')}</div>
<div #install-me.link>{translate('Click to upgrade')}</div>
</div>;
}
@@ -419,7 +419,7 @@ class UpdateMe: Reactor.Component {
return <div .install-me>
<div>{translate('Status')}</div>
<div>There is a newer version of {handler.get_app_name()} ({handler.get_new_version()}) available.</div>
<div #install-me .link style="padding-top: 1em">Click to {update_or_download}</div>
<div #install-me.link>{translate('Click to ' + update_or_download)}</div>
<div #download-percent style="display:hidden; padding-top: 1em;" />
</div>;
}
@@ -494,16 +494,15 @@ class CanScreenRecording: Reactor.Component {
class InstallDaemon: Reactor.Component {
function render() {
return <div .trust-me>
<div>{translate('Configuration Permissions')}</div>
<div>{translate('install_daemon')}</div>
<div #install-daemon .link>{translate('Configure')}</div>
return <div .install-me>
<span />
<div>{translate('install_daemon_tip')}</div>
<div #install-me.link>{translate('Install')}</div>
</div>;
}
event click $(#install-daemon) {
event click $(#install-me) {
handler.is_installed_daemon(true);
watch_trust();
}
}
@@ -543,14 +542,17 @@ class ModifyDefaultLogin: Reactor.Component {
function watch_trust() {
// not use TrustMe::update, because it is buggy
var trusted = handler.is_process_trusted(false) && handler.is_installed_daemon(false);
var trusted = handler.is_process_trusted(false);
var el = $(div.trust-me);
if (el) {
el.style.set {
display: trusted ? "none" : "block",
};
}
// if (trusted) return;
if (trusted) {
app.update();
return;
}
self.timer(1s, watch_trust);
}