zhaoqige / 6w-grid-lite

Web User Interface for GWS Beijing Firmware since March 2017
MIT License
0 stars 0 forks source link

Save user defined "target" for flood/ping #13

Open zhaoqige opened 7 years ago

zhaoqige commented 7 years ago

Even after user refreshed the web page, still has the last target

zhaoqige commented 7 years ago

Need browser support "Web Store".

if (typeof(Storage) != 'undefined') {
  localStorage('ping_target', '192.168.1.2');
  $('#qz-tool-icmp-target').val(localStorage.getItem('ping_target'));
} else {
  console.log('Your browser don't support HTML5 Web Storage.');
}