Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System 1418/update network plugin #19

Merged
merged 41 commits into from
Jan 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d79284c
Add network profile list and signal strength list files
cmajed Dec 2, 2022
719982a
Parse android version from settings redis channel.
gvercoutere-geny Dec 2, 2022
7112f7f
Add new input lists and wifi checkbox
cmajed Dec 2, 2022
11775b2
Extract network_profile and baseband callback in functions.
gvercoutere-geny Dec 2, 2022
33c8707
Update mobile profiles.
gvercoutere-geny Dec 2, 2022
64f2831
Send a redis message when a mobile profile is selected on the list.
gvercoutere-geny Dec 2, 2022
7970579
Add checkbox for wifi and mobile
cmajed Dec 2, 2022
48beeae
Implement enable/disable wifi/mobile when checkbox state changes
cmajed Dec 2, 2022
2fb8576
Update mobile profile list UI when a new value is received with redis.
gvercoutere-geny Dec 2, 2022
8a4bdd3
On click on the "Update" button, don't send mobile profile info when
gvercoutere-geny Dec 2, 2022
d9ba301
Signal Strength : Send a redis message when a mobile profile is selec…
gvercoutere-geny Dec 2, 2022
de0129d
Update mobile/wifi checkbox UI when a new status is received with redis.
gvercoutere-geny Dec 2, 2022
1f3ca17
Mobile profile : don't show 5g item if android version < 10
gvercoutere-geny Dec 2, 2022
5f3bebb
Update interface status on refresh
cmajed Dec 5, 2022
8ff875f
Update mobile network detail when profile or signal strength changes
cmajed Dec 5, 2022
f662e32
Remove sim and operator details from network widget
cmajed Dec 5, 2022
6d891ce
Better manage enabling/disabling mobile
cmajed Dec 5, 2022
d39a699
New widget to handle removed baseband from network widget
cmajed Dec 5, 2022
6d6bec8
Show wifi and mobile checkbow only for android > 8.0
cmajed Dec 6, 2022
a2f73b0
Fix ui and android < 8 update troubles
cmajed Dec 9, 2022
d7f98c1
Rename Sim plugin
cmajed Dec 12, 2022
6aded15
Add Baseband section to the Features & options paragraph
cmajed Dec 13, 2022
b0aefad
Rework 'network' feature text following baseband split
gvercoutere-geny Dec 13, 2022
f562363
Update network widget UI according to review remarks
cmajed Dec 16, 2022
e54699c
Several corrections after review
cmajed Dec 16, 2022
ab4fcdc
Update Readme file
cmajed Dec 16, 2022
a3a703f
Update network test to resolve errors
cmajed Dec 19, 2022
22aa78d
Move baseband related test frop network to new test file
cmajed Dec 19, 2022
4bcf57d
Init androidVersion to ''
cmajed Dec 19, 2022
dd71ec3
Resolve yarn lin errors
cmajed Dec 19, 2022
c9b82e9
Rework after review
cmajed Dec 20, 2022
48a3bbd
Add new option for mobile throttling support
cmajed Dec 20, 2022
6bf2999
Uses capabilities for mobilethrottling and 5G support
cmajed Jan 3, 2023
a4c7b26
Create widget elements when needed instead of hiding unhiding them
cmajed Jan 4, 2023
a93dfae
Do nothing when calling disable5G
cmajed Jan 4, 2023
bc1d2c1
Handle random error
cmajed Jan 4, 2023
5f92995
Put bac section and fields in baseband scss file
cmajed Jan 4, 2023
f9dbddd
Remove no needed check
cmajed Jan 6, 2023
ece997a
Remove duplicated baseabnd section from readme file
cmajed Jan 11, 2023
4b0a253
Rename NETWORK to BASEBAND
cmajed Jan 11, 2023
3d753f5
Add name attribute to some fields needed for autotests
cmajed Jan 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 32 additions & 7 deletions src/plugins/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ module.exports = class Network extends OverlayPlugin {
const signalStrength = values[10].split(':');

this.setActiveMobileProfile(mobileProfile[1]);
this.setActiveSignalStrength(signalStrength[1]);
}
}

Expand Down Expand Up @@ -527,7 +528,6 @@ module.exports = class Network extends OverlayPlugin {
changeMobileProfile() {
const profile = MOBILE_PROFILES.find((elem) => elem.name === this.select.value);
if (profile) {
// TODO update profile founded
console.log("Selected profile label:" + profile.label + " name: " + profile.name)
const msgs = [];
msgs.push('setprofile mobile ' + profile.name);
Expand All @@ -540,13 +540,15 @@ module.exports = class Network extends OverlayPlugin {
}

changeMobileSignalStrength() {
const signalStrength = MOBILE_SIGNAL_STRENGTH.find((elem) => elem.name === this.select.value);
const signalStrength = MOBILE_SIGNAL_STRENGTH.find((elem) => elem.name === this.selectMobileSignalStrength.value);
if (signalStrength) {
// TODO update profile details
console.log("Selected signalStrength:" + signalStrength.label)
const msgs = [];
msgs.push('setsignalstrength mobile ' + signalStrength.name);
const json = {channel: 'network_profile', messages: msgs};
this.instance.sendEvent(json);
} else {
// hide profile details
this.profileDetails.classList.add('gm-hidden');
// TODO hide or do something?
console.log("Selected signalStrength not found")
pgivel marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down Expand Up @@ -631,7 +633,7 @@ module.exports = class Network extends OverlayPlugin {
/**
* Update mobile profile list UI according to the current active profile.
*
* @param {string} name Profile name.
* @param {string} profile Profile name.
*/
setActiveMobileProfile(profile) {
if(!profile) {
Expand All @@ -651,4 +653,27 @@ module.exports = class Network extends OverlayPlugin {
}
}
}
caarmen marked this conversation as resolved.
Show resolved Hide resolved

/**
* Update mobile signal strength list UI according to the current active strength.
*
* @param {string} strength Signal strength name.
*/
setActiveSignalStrength(strength) {
if(!strength) {
return;
}
const signalStrength = MOBILE_SIGNAL_STRENGTH.find((elem) => elem.name === strength);
if (!signalStrength) {
return;
}

const options = this.selectMobileSignalStrength.getElementsByTagName('option');
for (let i = 0; i < options.length; i++) {
const option = options[i];
if (option.value === signalStrength.name) {
option.selected = 'selected';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

}
}
}
};