Tag Cloudlog as 2.6.19

Tag Cloudlog as 2.6.19
这个提交包含在:
Peter Goodhall 2025-06-11 15:27:18 +01:00 提交者 GitHub
当前提交 5f51d60f49
找不到此签名对应的密钥
GPG 密钥 ID: B5690EEEBB952194
共有 23 个文件被更改,包括 846 次插入349 次删除

查看文件

@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
| |
*/ */
$config['migration_version'] = 196; $config['migration_version'] = 199;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

查看文件

@ -1,16 +1,19 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); <?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Activated_gridmap extends CI_Controller { class Activated_gridmap extends CI_Controller
{
function __construct() { function __construct()
{
parent::__construct(); parent::__construct();
} }
public function index() { public function index()
{
$data['page_title'] = "Activated Gridsquare Map"; $data['page_title'] = "Activated Gridsquare Map";
$this->load->model('bands'); $this->load->model('bands');
$this->load->model('activated_gridmap_model'); $this->load->model('activated_gridmap_model');
$this->load->model('stations'); $this->load->model('stations');
$data['visitor'] = false; $data['visitor'] = false;
@ -32,7 +35,7 @@ class Activated_gridmap extends CI_Controller {
$data['gridsquares_gridsquares_not_confirmed'] = lang('gridsquares_gridsquares_not_confirmed'); $data['gridsquares_gridsquares_not_confirmed'] = lang('gridsquares_gridsquares_not_confirmed');
$data['gridsquares_gridsquares_total_activated'] = lang('gridsquares_gridsquares_total_activated'); $data['gridsquares_gridsquares_total_activated'] = lang('gridsquares_gridsquares_total_activated');
$footerData = []; $footerData = [];
$footerData['scripts'] = [ $footerData['scripts'] = [
'assets/js/leaflet/geocoding.js', 'assets/js/leaflet/geocoding.js',
'assets/js/leaflet/L.MaidenheadColouredGridMap.js', 'assets/js/leaflet/L.MaidenheadColouredGridMap.js',
@ -42,15 +45,16 @@ class Activated_gridmap extends CI_Controller {
$this->load->view('interface_assets/header', $data); $this->load->view('interface_assets/header', $data);
$this->load->view('activated_gridmap/index'); $this->load->view('activated_gridmap/index');
$this->load->view('interface_assets/footer', $footerData); $this->load->view('interface_assets/footer', $footerData);
} }
public function getGridsjs() { public function getGridsjs()
$band = $this->security->xss_clean($this->input->post('band')); {
$mode = $this->security->xss_clean($this->input->post('mode')); $band = $this->security->xss_clean($this->input->post('band'));
$qsl = $this->security->xss_clean($this->input->post('qsl')); $mode = $this->security->xss_clean($this->input->post('mode'));
$lotw = $this->security->xss_clean($this->input->post('lotw')); $qsl = $this->security->xss_clean($this->input->post('qsl'));
$eqsl = $this->security->xss_clean($this->input->post('eqsl')); $lotw = $this->security->xss_clean($this->input->post('lotw'));
$qrz = $this->security->xss_clean($this->input->post('qrz')); $eqsl = $this->security->xss_clean($this->input->post('eqsl'));
$qrz = $this->security->xss_clean($this->input->post('qrz'));
$sat = $this->security->xss_clean($this->input->post('sat')); $sat = $this->security->xss_clean($this->input->post('sat'));
$this->load->model('activated_gridmap_model'); $this->load->model('activated_gridmap_model');
@ -73,26 +77,26 @@ class Activated_gridmap extends CI_Controller {
$query = $this->activated_gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); $query = $this->activated_gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat);
if ($query && $query->num_rows() > 0) { if ($query && $query->num_rows() > 0) {
foreach ($query->result() as $row) { foreach ($query->result() as $row) {
$gridlist = explode(',', $row->GRID_SQUARES); $gridlist = explode(',', $row->GRID_SQUARES);
foreach ($gridlist as $grid) { foreach ($gridlist as $grid) {
$grid_2char_confirmed = strtoupper(substr($grid,0,2)); $grid_2char_confirmed = strtoupper(substr($grid, 0, 2));
$grid_4char_confirmed = strtoupper(substr($grid,0,4)); $grid_4char_confirmed = strtoupper(substr($grid, 0, 4));
if ($this->config->item('map_6digit_grids')) { if ($this->config->item('map_6digit_grids')) {
$grid_6char_confirmed = strtoupper(substr($grid,0,6)); $grid_6char_confirmed = strtoupper(substr($grid, 0, 6));
} }
// Check if 2 Char is in array // Check if 2 Char is in array
if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){ if (!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)) {
array_push($array_grid_2char_confirmed, $grid_2char_confirmed); array_push($array_grid_2char_confirmed, $grid_2char_confirmed);
} }
if(!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)){ if (!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)) {
array_push($array_grid_4char_confirmed, $grid_4char_confirmed); array_push($array_grid_4char_confirmed, $grid_4char_confirmed);
} }
if ($this->config->item('map_6digit_grids')) { if ($this->config->item('map_6digit_grids')) {
if(!in_array($grid_6char_confirmed, $array_grid_6char_confirmed)){ if (!in_array($grid_6char_confirmed, $array_grid_6char_confirmed)) {
array_push($array_grid_6char_confirmed, $grid_6char_confirmed); array_push($array_grid_6char_confirmed, $grid_6char_confirmed);
} }
} }
@ -107,23 +111,23 @@ class Activated_gridmap extends CI_Controller {
$gridlist = explode(',', $row->GRID_SQUARES); $gridlist = explode(',', $row->GRID_SQUARES);
foreach ($gridlist as $grid) { foreach ($gridlist as $grid) {
$grid_two = strtoupper(substr($grid,0,2)); $grid_two = strtoupper(substr($grid, 0, 2));
$grid_four = strtoupper(substr($grid,0,4)); $grid_four = strtoupper(substr($grid, 0, 4));
if ($this->config->item('map_6digit_grids')) { if ($this->config->item('map_6digit_grids')) {
$grid_six = strtoupper(substr($grid,0,6)); $grid_six = strtoupper(substr($grid, 0, 6));
} }
// Check if 2 Char is in array // Check if 2 Char is in array
if(!in_array($grid_two, $array_grid_2char)){ if (!in_array($grid_two, $array_grid_2char)) {
array_push($array_grid_2char, $grid_two); array_push($array_grid_2char, $grid_two);
} }
if(!in_array($grid_four, $array_grid_4char)){ if (!in_array($grid_four, $array_grid_4char)) {
array_push($array_grid_4char, $grid_four); array_push($array_grid_4char, $grid_four);
} }
if ($this->config->item('map_6digit_grids')) { if ($this->config->item('map_6digit_grids')) {
if(!in_array($grid_six, $array_grid_6char)){ if (!in_array($grid_six, $array_grid_6char)) {
array_push($array_grid_6char, $grid_six); array_push($array_grid_6char, $grid_six);
} }
} }
@ -137,17 +141,17 @@ class Activated_gridmap extends CI_Controller {
$grids = explode(",", $row->COL_VUCC_GRIDS); $grids = explode(",", $row->COL_VUCC_GRIDS);
foreach($grids as $key) { foreach ($grids as $key) {
$grid_two = strtoupper(substr($key,0,2)); $grid_two = strtoupper(substr($key, 0, 2));
$grid_four = strtoupper(substr($key,0,4)); $grid_four = strtoupper(substr($key, 0, 4));
// Check if 2 Char is in array // Check if 2 Char is in array
if(!in_array($grid_two, $array_grid_2char)){ if (!in_array($grid_two, $array_grid_2char)) {
array_push($array_grid_2char, $grid_two); array_push($array_grid_2char, $grid_two);
} }
if(!in_array($grid_four, $array_grid_4char)){ if (!in_array($grid_four, $array_grid_4char)) {
array_push($array_grid_4char, $grid_four); array_push($array_grid_4char, $grid_four);
} }
} }
@ -158,28 +162,28 @@ class Activated_gridmap extends CI_Controller {
$query_vucc = $this->activated_gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); $query_vucc = $this->activated_gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat);
if ($query_vucc && $query_vucc->num_rows() > 0) { if ($query_vucc && $query_vucc->num_rows() > 0) {
foreach ($query_vucc->result() as $row) { foreach ($query_vucc->result() as $row) {
$grids = explode(",", $row->COL_VUCC_GRIDS); $grids = explode(",", $row->COL_VUCC_GRIDS);
foreach($grids as $key) { foreach ($grids as $key) {
$grid_2char_confirmed = strtoupper(substr($key,0,2)); $grid_2char_confirmed = strtoupper(substr($key, 0, 2));
$grid_4char_confirmed = strtoupper(substr($key,0,4)); $grid_4char_confirmed = strtoupper(substr($key, 0, 4));
// Check if 2 Char is in array // Check if 2 Char is in array
if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){ if (!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)) {
array_push($array_grid_2char_confirmed, $grid_2char_confirmed); array_push($array_grid_2char_confirmed, $grid_2char_confirmed);
} }
if(!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)){ if (!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)) {
array_push($array_grid_4char_confirmed, $grid_4char_confirmed); array_push($array_grid_4char_confirmed, $grid_4char_confirmed);
} }
} }
} }
} }
$data['grid_2char_confirmed'] = ($array_grid_2char_confirmed); $data['grid_2char_confirmed'] = ($array_grid_2char_confirmed);
$data['grid_4char_confirmed'] = ($array_grid_4char_confirmed); $data['grid_4char_confirmed'] = ($array_grid_4char_confirmed);
$data['grid_6char_confirmed'] = ($array_grid_6char_confirmed); $data['grid_6char_confirmed'] = ($array_grid_6char_confirmed);
@ -187,7 +191,7 @@ class Activated_gridmap extends CI_Controller {
$data['grid_4char'] = ($array_grid_4char); $data['grid_4char'] = ($array_grid_4char);
$data['grid_6char'] = ($array_grid_6char); $data['grid_6char'] = ($array_grid_6char);
header('Content-Type: application/json'); header('Content-Type: application/json');
echo json_encode($data); echo json_encode($data);
} }
} }

查看文件

@ -37,27 +37,33 @@ class Clublog extends CI_Controller {
$this->load->model('clublog_model'); $this->load->model('clublog_model');
// Retrieve all station profiles for the user with their QSO counts
$station_profiles = $this->clublog_model->all_with_count($clean_userid); $station_profiles = $this->clublog_model->all_with_count($clean_userid);
if($station_profiles->num_rows()){ if($station_profiles->num_rows()){
foreach ($station_profiles->result() as $station_row) foreach ($station_profiles->result() as $station_row)
{ {
// Only process stations that have QSOs to upload
if($station_row->qso_total > 0) { if($station_row->qso_total > 0) {
// Get QSOs for this station that haven't been uploaded to Clublog yet
$data['qsos'] = $this->clublog_model->get_clublog_qsos($station_row->station_id); $data['qsos'] = $this->clublog_model->get_clublog_qsos($station_row->station_id);
if($data['qsos']->num_rows()){ if($data['qsos']->num_rows()){
// Generate ADIF file content from the view template
$string = $this->load->view('adif/data/clublog', $data, TRUE); $string = $this->load->view('adif/data/clublog', $data, TRUE);
// Generate a unique ID for the temporary file
$ranid = uniqid(); $ranid = uniqid();
// Write the ADIF data to a temporary file
if ( ! write_file('uploads/clublog'.$ranid.$station_row->station_id.'.adi', $string)) { if ( ! write_file('uploads/clublog'.$ranid.$station_row->station_id.'.adi', $string)) {
echo 'Unable to write the file - Make the folder Upload folder has write permissions.'; echo 'Unable to write the file - Make the folder Upload folder has write permissions.';
} }
else { else {
// Get details of the created ADIF file
$file_info = get_file_info('uploads/clublog'.$ranid.$station_row->station_id.'.adi'); $file_info = get_file_info('uploads/clublog'.$ranid.$station_row->station_id.'.adi');
// initialise the curl request // Initialize the CURL request to Clublog's API endpoint
$request = curl_init('https://clublog.org/putlogs.php'); $request = curl_init('https://clublog.org/putlogs.php');
if($this->config->item('directory') != "") { if($this->config->item('directory') != "") {
@ -138,13 +144,12 @@ class Clublog extends CI_Controller {
$this->clublog_model->mark_qsos_sent($clean_station_id); $this->clublog_model->mark_qsos_sent($clean_station_id);
} }
function markallnotsent() { function markallnotsent($station_id) {
$clean_station_id = $this->security->xss_clean($station_id); $clean_station_id = $this->security->xss_clean($station_id);
$this->load->model('clublog_model'); $this->load->model('clublog_model');
$this->clublog_model->mark_all_qsos_notsent($clean_station_id); $this->clublog_model->mark_all_qsos_notsent($clean_station_id);
} }
// Find DXCC // Find DXCC
function find_dxcc($callsign) { function find_dxcc($callsign) {
$clean_callsign = $this->security->xss_clean($callsign); $clean_callsign = $this->security->xss_clean($callsign);

查看文件

@ -215,7 +215,7 @@ class User extends CI_Controller
$this->input->post('user_callbook_username'), $this->input->post('user_callbook_username'),
$this->input->post('user_callbook_password') $this->input->post('user_callbook_password')
)) { )) {
// Check for errors // Check for errors
case EUSERNAMEEXISTS: case EUSERNAMEEXISTS:
$data['username_error'] = 'Username <b>' . $this->input->post('user_name') . '</b> already in use!'; $data['username_error'] = 'Username <b>' . $this->input->post('user_name') . '</b> already in use!';
break; break;
@ -225,7 +225,7 @@ class User extends CI_Controller
case EPASSWORDINVALID: case EPASSWORDINVALID:
$data['password_error'] = 'Invalid password!'; $data['password_error'] = 'Invalid password!';
break; break;
// All okay, return to user screen // All okay, return to user screen
case OK: case OK:
$this->session->set_flashdata('notice', 'User ' . $this->input->post('user_name') . ' added'); $this->session->set_flashdata('notice', 'User ' . $this->input->post('user_name') . ' added');
redirect('user'); redirect('user');
@ -576,6 +576,12 @@ class User extends CI_Controller
$data['user_winkey'] = $q->winkey; $data['user_winkey'] = $q->winkey;
} }
if ($this->input->post('user_winkey_websocket')) {
$data['user_winkey_websocket'] = $this->input->post('user_winkey_websocket', true);
} else {
$data['user_winkey_websocket'] = $q->winkey_websocket;
}
$this->load->model('user_options_model'); $this->load->model('user_options_model');
$callbook_type_object = $this->user_options_model->get_options('callbook')->result(); $callbook_type_object = $this->user_options_model->get_options('callbook')->result();
@ -730,8 +736,14 @@ class User extends CI_Controller
$this->load->view('interface_assets/footer'); $this->load->view('interface_assets/footer');
} else { } else {
unset($data); unset($data);
switch ($this->user_model->edit($this->input->post())) {
// Check for errors
$post_data = $this->input->post();
if (!isset($post_data['user_winkey_websocket'])) {
$post_data['user_winkey_websocket'] = '0';
}
switch ($this->user_model->edit($post_data)) {
// Check for errors
case EUSERNAMEEXISTS: case EUSERNAMEEXISTS:
$data['username_error'] = 'Username <b>' . $this->input->post('user_name', true) . '</b> already in use!'; $data['username_error'] = 'Username <b>' . $this->input->post('user_name', true) . '</b> already in use!';
break; break;
@ -741,7 +753,7 @@ class User extends CI_Controller
case EPASSWORDINVALID: case EPASSWORDINVALID:
$data['password_error'] = 'Invalid password!'; $data['password_error'] = 'Invalid password!';
break; break;
// All okay, return to user screen // All okay, return to user screen
case OK: case OK:
if ($this->session->userdata('user_id') == $this->uri->segment(3)) { // Editing own User? Set cookie! if ($this->session->userdata('user_id') == $this->uri->segment(3)) { // Editing own User? Set cookie!
$cookie = array( $cookie = array(
@ -892,6 +904,7 @@ class User extends CI_Controller
$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter'); $data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter');
$data['language'] = $this->input->post('language'); $data['language'] = $this->input->post('language');
$data['user_winkey'] = $this->input->post('user_winkey'); $data['user_winkey'] = $this->input->post('user_winkey');
$data['user_winkey_websocket'] = $this->input->post('user_winkey_websocket');
$data['user_hamsat_key'] = $this->input->post('user_hamsat_key'); $data['user_hamsat_key'] = $this->input->post('user_hamsat_key');
$data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only'); $data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only');

查看文件

@ -0,0 +1,30 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* This adds a field to user-table to hold winkey websocket setting
*/
// Migration: 197_add_winkey_websocket
class Migration_add_winkey_websocket extends CI_Migration {
public function up()
{
// Check if winkey_websocket exists in the user table if not create a boolean field
if (!$this->db->field_exists('winkey_websocket', 'users')) {
$fields = array(
'winkey_websocket boolean default 0',
);
$this->dbforge->add_column('users', $fields);
}
}
public function down()
{
if ($this->db->field_exists('winkey_websocket', 'users')) {
$this->dbforge->drop_column('users', 'winkey_websocket');
}
}
}

查看文件

@ -0,0 +1,36 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_sat_name_change_hadesicm_so125 extends CI_Migration
{
public function up()
{
// update column COL_SAT_NAME to SO-125 if its HADES-ICM
$this->db->set('COL_SAT_NAME', 'SO-125');
$this->db->where('COL_SAT_NAME', 'HADES-ICM');
$this->db->update($this->config->item('table_name'));
log_message('info', 'Migration: Updated COL_SAT_NAME to SO-125 for HADES-ICM');
// update column COL_LOTW_QSL_SENT to N if its SO-125
$this->db->set('COL_LOTW_QSL_SENT', 'N');
$this->db->where('COL_SAT_NAME', 'SO-125');
$this->db->update($this->config->item('table_name'));
log_message('info', 'Migration: Set COL_LOTW_QSL_SENT to N for SO-125');
}
public function down()
{
//Change back to HADES-ICM
$this->db->set('COL_SAT_NAME', 'HADES-ICM');
$this->db->where('COL_SAT_NAME', 'SO-125');
$this->db->update($this->config->item('table_name'));
log_message('info', 'Migration: Reverted COL_SAT_NAME back to HADES-ICM');
// Set COL_LOTW_QSL_SENT back to N for HADES-ICM
$this->db->set('COL_LOTW_QSL_SENT', 'N');
$this->db->where('COL_SAT_NAME', 'HADES-ICM');
$this->db->update($this->config->item('table_name'));
log_message('info', 'Migration: Reverted COL_LOTW_QSL_SENT back to N for HADES-ICM');
}
}

查看文件

@ -0,0 +1,30 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* Tag Cloudlog as 2.6.19
*/
class Migration_tag_2_6_19 extends CI_Migration {
public function up()
{
// Tag Cloudlog 2.6.19
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.6.19'));
// Trigger Version Info Dialog
$this->db->where('option_type', 'version_dialog');
$this->db->where('option_name', 'confirmed');
$this->db->update('user_options', array('option_value' => 'false'));
}
public function down()
{
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.6.18'));
}
}

查看文件

@ -267,6 +267,7 @@ class User_Model extends CI_Model {
'user_quicklog_enter' => xss_clean($fields['user_quicklog_enter']), 'user_quicklog_enter' => xss_clean($fields['user_quicklog_enter']),
'language' => xss_clean($fields['language']), 'language' => xss_clean($fields['language']),
'winkey' => xss_clean($fields['user_winkey']), 'winkey' => xss_clean($fields['user_winkey']),
'winkey_websocket' => xss_clean($fields['user_winkey_websocket']),
); );
$this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'hamsat','hamsat_key','api','".xss_clean($fields['user_hamsat_key'])."');"); $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'hamsat','hamsat_key','api','".xss_clean($fields['user_hamsat_key'])."');");
@ -426,6 +427,7 @@ class User_Model extends CI_Model {
'active_station_logbook' => $u->row()->active_station_logbook, 'active_station_logbook' => $u->row()->active_station_logbook,
'language' => isset($u->row()->language) ? $u->row()->language: 'english', 'language' => isset($u->row()->language) ? $u->row()->language: 'english',
'isWinkeyEnabled' => $u->row()->winkey, 'isWinkeyEnabled' => $u->row()->winkey,
'isWinkeyWebsocketEnabled' => (bool)$u->row()->winkey_websocket,
'hasQrzKey' => $this->hasQrzKey($u->row()->user_id), 'hasQrzKey' => $this->hasQrzKey($u->row()->user_id),
'callbook_type' => $callbook_type, 'callbook_type' => $callbook_type,
'callbook_username' => $callbook_username, 'callbook_username' => $callbook_username,

查看文件

@ -1125,11 +1125,222 @@ if ($this->session->userdata('user_id') != null) {
<?php if ($this->uri->segment(1) == "qso") { ?> <?php if ($this->uri->segment(1) == "qso") { ?>
<script src="<?php echo base_url(); ?>assets/js/sections/qso.js"></script> <script src="<?php echo base_url(); ?>assets/js/sections/qso.js"></script>
<?php if ($this->session->userdata('isWinkeyEnabled')) { ?> <?php if ($this->session->userdata('isWinkeyEnabled') && !$this->session->userdata('isWinkeyWebsocketEnabled')) { ?>
<script src="<?php echo base_url(); ?>assets/js/winkey.js"></script> <script src="<?php echo base_url(); ?>assets/js/winkey.js"></script>
<?php } <?php } elseif ($this->session->userdata('isWinkeyEnabled') && $this->session->userdata('isWinkeyWebsocketEnabled')) { ?>
<script>
console.log('Winkey Websocket enabled');
</script>
if ($this->optionslib->get_option('dxcache_url') != '') { ?> <script>
let ws = null;
function connectWebSocket() {
if (ws !== null) {
ws.close();
}
const chatRoom = "cw_room";
const wsUrl = `ws://localhost:8181?chatRoom=${encodeURIComponent(chatRoom)}`;
ws = new WebSocket(wsUrl);
ws.onopen = function() {
document.getElementById('cw_socket_status').className = 'badge bg-success';
document.getElementById('cw_socket_status').innerHTML = `Status: Connected`;
logMessage(`Connected to WebSocket server in room: ${chatRoom}`);
};
ws.onclose = function() {
document.getElementById('cw_socket_status').className = 'badge bg-secondary';
document.getElementById('cw_socket_status').innerHTML = 'Status: Disconnected';
logMessage('Disconnected from WebSocket server');
ws = null;
};
ws.onerror = function(error) {
logMessage('WebSocket Error: ' + error);
};
ws.onmessage = function(event) {
logMessage('Received: ' + event.data);
};
}
function disconnectWebSocket() {
if (ws !== null) {
ws.close();
}
}
function sendMessage() {
if (ws === null) {
alert('Please connect to the WebSocket server first');
return;
}
const message = document.getElementById('message').value;
if (message.trim() === '') {
alert('Please enter a message');
return;
}
// Prefix the message with "CW:" to indicate it's a CW message
const cwMessage = 'CW:' + message;
ws.send(cwMessage);
logMessage('Sent: ' + cwMessage);
// Clear the input field
document.getElementById('message').value = '';
}
function logMessage(message) {
const messageLog = document.getElementById('messageLog');
messageLog.value += message + '\n';
// Auto-scroll to bottom
messageLog.scrollTop = messageLog.scrollHeight;
}
// Support for Enter key in the input field
document.getElementById('message').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
sendMessage();
}
});
</script>
<script>
connectWebSocket();
function morsekey_func1() {
console.log("F1: " + UpdateMacros(function1Macro));
const cwMessage = 'CW:' + UpdateMacros(function1Macro);
ws.send(cwMessage);
}
function morsekey_func2() {
console.log("F2: " + UpdateMacros(function2Macro));
const cwMessage = 'CW:' + UpdateMacros(function2Macro);
ws.send(cwMessage);
}
function morsekey_func3() {
console.log("F3: " + UpdateMacros(function3Macro));
const cwMessage = 'CW:' + UpdateMacros(function3Macro);
ws.send(cwMessage);
}
function morsekey_func4() {
console.log("F4: " + UpdateMacros(function4Macro));
const cwMessage = 'CW:' + UpdateMacros(function4Macro);
ws.send(cwMessage);
}
function morsekey_func5() {
console.log("F5: " + UpdateMacros(function5Macro));
const cwMessage = 'CW:' + UpdateMacros(function5Macro);
ws.send(cwMessage);
}
let function1Name, function1Macro, function2Name, function2Macro, function3Name, function3Macro, function4Name, function4Macro, function5Name, function5Macro;
getMacros();
document.addEventListener('keydown', function(event) {
if (event.key === 'F1') {
event.preventDefault();
morsekey_func1();
}
if (event.key === 'F2') {
event.preventDefault();
morsekey_func2();
}
if (event.key === 'F3') {
event.preventDefault();
morsekey_func3();
}
if (event.key === 'F4') {
event.preventDefault();
morsekey_func4();
}
if (event.key === 'F5') {
event.preventDefault();
morsekey_func5();
}
});
function UpdateMacros(macrotext) {
// Get the values from the form set to uppercase
let CALL = document.getElementById("callsign").value.toUpperCase();
let RSTS = document.getElementById("rst_sent").value;
let newString;
newString = macrotext.replace(/\[MYCALL\]/g, my_call);
newString = newString.replace(/\[CALL\]/g, CALL);
newString = newString.replace(/\[RSTS\]/g, RSTS);
console.log(newString);
return newString;
}
// Call url and store the returned json data as variables
function getMacros() {
fetch(base_url + 'index.php/qso/cwmacros_json')
.then(response => response.json())
.then(data => {
function1Name = data.function1_name;
function1Macro = data.function1_macro;
function2Name = data.function2_name;
function2Macro = data.function2_macro;
function3Name = data.function3_name;
function3Macro = data.function3_macro;
function4Name = data.function4_name;
function4Macro = data.function4_macro;
function5Name = data.function5_name;
function5Macro = data.function5_macro;
const morsekey_func1_Button = document.getElementById('morsekey_func1');
morsekey_func1_Button.textContent = 'F1 (' + function1Name + ')';
const morsekey_func2_Button = document.getElementById('morsekey_func2');
morsekey_func2_Button.textContent = 'F2 (' + function2Name + ')';
const morsekey_func3_Button = document.getElementById('morsekey_func3');
morsekey_func3_Button.textContent = 'F3 (' + function3Name + ')';
const morsekey_func4_Button = document.getElementById('morsekey_func4');
morsekey_func4_Button.textContent = 'F4 (' + function4Name + ')';
const morsekey_func5_Button = document.getElementById('morsekey_func5');
morsekey_func5_Button.textContent = 'F5 (' + function5Name + ')';
});
}
function sendMyMessage() {
const message = document.getElementById('sendText').value;
if (message.trim() === '') {
alert('Please enter a message');
return;
}
const cwMessage = 'CW:' + message;
ws.send(cwMessage);
logMessage('Sent: ' + cwMessage);
// Clear the input field
document.getElementById('sendText').value = '';
}
</script>
<?php } ?>
<?php if ($this->optionslib->get_option('dxcache_url') != '') { ?>
<script type="text/javascript"> <script type="text/javascript">
var dxcluster_provider = '<?php echo base_url(); ?>index.php/dxcluster'; var dxcluster_provider = '<?php echo base_url(); ?>index.php/dxcluster';
$(document).ready(function() { $(document).ready(function() {
@ -1470,7 +1681,7 @@ if ($this->session->userdata('user_id') != null) {
$('#notice-alerts').delay(1000).fadeOut(5000); $('#notice-alerts').delay(1000).fadeOut(5000);
function setRst(mode) { function setRst(mode) {
if (mode == 'JT65' || mode == 'JT65B' || mode == 'JT6C' || mode == 'JTMS' || mode == 'ISCAT' || mode == 'MSK144' || mode == 'JTMSK' || mode == 'QRA64' || mode == 'FT8' || mode == 'FT4' || mode == 'JS8' || mode == 'JT9' || mode == 'JT9-1' || mode == 'ROS') { if (mode == 'JT65' || mode == 'JT65B' || mode == 'JT6C' || mode == 'JTMS' || mode == 'ISCAT' || mode == 'MSK144' || mode == 'JTMSK' || mode == 'QRA64' || mode == 'FT8' || mode == 'FT4' || mode == 'JS8' || mode == 'JT9' || mode == 'JT9-1' || mode == 'ROS' || mode == 'Q65' || mode == 'FST4' || mode == 'FST4W') {
$('#rst_sent').val('-5'); $('#rst_sent').val('-5');
$('#rst_rcvd').val('-5'); $('#rst_rcvd').val('-5');
} else if (mode == 'FSK441' || mode == 'JT6M') { } else if (mode == 'FSK441' || mode == 'JT6M') {
@ -1622,6 +1833,28 @@ if ($this->session->userdata('user_id') != null) {
// Event listeners // Event listeners
$(document).ready(() => { $(document).ready(() => {
/**
* Prevents multiple form submissions by tracking submission state
*
* This script prevents duplicate QSO (contact) submissions by:
* - Maintaining an isSubmitting flag to track form submission state
* - Adding an event listener to the 'qso_input' form
* - Preventing form submission if a submission is already in progress
* - Setting the flag to true when a valid submission begins
*
* @since Unknown
* @global boolean isSubmitting Flag to track if form is currently being submitted
*/
let isSubmitting = false;
document.getElementById('qso_input').addEventListener('submit', function(e) {
if (isSubmitting) {
e.preventDefault();
return false;
}
isSubmitting = true;
});
// Update frequency every three seconds for the selected radio // Update frequency every three seconds for the selected radio
setInterval(() => { setInterval(() => {
const selectedRadioID = $('select.radios option:selected').val(); const selectedRadioID = $('select.radios option:selected').val();
@ -1642,15 +1875,15 @@ if ($this->session->userdata('user_id') != null) {
}); });
</script> </script>
<script> <script>
$(document).ready(function () { $(document).ready(function() {
// Synchronize the two selects // Synchronize the two selects
$('.radios').on('change', function () { $('.radios').on('change', function() {
const selectedValue = $(this).val(); // Get the selected value const selectedValue = $(this).val(); // Get the selected value
$('.radios').not(this).val(selectedValue); // Update other selects to match $('.radios').not(this).val(selectedValue); // Update other selects to match
});
}); });
}); </script>
</script>

查看文件

@ -673,9 +673,49 @@
<!-- Winkey Starts --> <!-- Winkey Starts -->
<?php if ($this->session->userdata('isWinkeyEnabled') && $this->session->userdata('isWinkeyWebsocketEnabled')) { ?>
<div id="winkey" class="card winkey-settings" style="margin-bottom: 10px;">
<div class="card-header">
<h4 style="font-size: 16px; font-weight: bold;" class="card-title">Winkey Web Sockets
<div id="cw_socket_status" class="badge text-bg-danger">
Status: Disconnected
</div>
<button type="button" class="btn btn-secondary"
hx-get="<?php echo base_url(); ?>index.php/qso/winkeysettings"
hx-target="#modals-here"
hx-trigger="click"
class="btn btn-primary"
_="on htmx:afterOnLoad wait 10ms then add .show to #modal then add .show to #modal-backdrop"><i class="fas fa-cog"></i> Settings</button>
</h4>
</div>
<div id="modals-here"></div>
<div id="winkey_buttons" class="card-body">
<button id="morsekey_func1" onclick="morsekey_func1()" class="btn btn-warning">F1</button>
<button id="morsekey_func2" onclick="morsekey_func2()" class="btn btn-warning">F2</button>
<button id="morsekey_func3" onclick="morsekey_func3()" class="btn btn-warning">F3</button>
<button id="morsekey_func4" onclick="morsekey_func4()" class="btn btn-warning">F4</button>
<button id="morsekey_func5" onclick="morsekey_func5()" class="btn btn-warning">F5</button>
<br><br>
<input id="sendText" type="text"><input onclick="sendMyMessage()" id="sendButton" type="button" value="Send" class="btn btn-success">
<div>
<strong>Message Log:</strong>
<textarea id="messageLog" class="form-control mt-2" rows="4" readonly></textarea>
</div>
</div>
</div>
<?php } ?>
<?php <?php
// if isWinkeyEnabled in session data is true // if isWinkeyEnabled in session data is true and isWinkeyWebsocketEnabled is false
if ($this->session->userdata('isWinkeyEnabled')) { ?>
if ($this->session->userdata('isWinkeyEnabled') && !$this->session->userdata('isWinkeyWebsocketEnabled')) { ?>
<div id="winkey" class="card winkey-settings" style="margin-bottom: 10px;"> <div id="winkey" class="card winkey-settings" style="margin-bottom: 10px;">
<div class="card-header"> <div class="card-header">

查看文件

@ -8,7 +8,10 @@
</div> </div>
<?php } ?> <?php } ?>
<h2><?php echo $page_title; ?></h2> <div class="d-flex justify-content-between align-items-center mb-3">
<h2><?php echo $page_title; ?></h2>
<a href="<?php echo site_url('station/create'); ?>" class="btn btn-primary"><i class="fas fa-plus"></i> <?php echo lang('station_location_create'); ?></a>
</div>
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
@ -16,8 +19,6 @@
<p class="card-text"><?php echo lang('station_location_header_ln2'); ?></p> <p class="card-text"><?php echo lang('station_location_header_ln2'); ?></p>
<p class="card-text"><?php echo lang('station_location_header_ln3'); ?></p> <p class="card-text"><?php echo lang('station_location_header_ln3'); ?></p>
<p><a href="<?php echo site_url('station/create'); ?>" class="btn btn-primary"><i class="fas fa-plus"></i> <?php echo lang('station_location_create'); ?></a></p>
<?php if ($stations->num_rows() > 0) { ?> <?php if ($stations->num_rows() > 0) { ?>
<?php if($current_active == 0) { ?> <?php if($current_active == 0) { ?>
@ -28,8 +29,7 @@
<?php if (($is_there_qsos_with_no_station_id >= 1) && ($is_admin)) { ?> <?php if (($is_there_qsos_with_no_station_id >= 1) && ($is_admin)) { ?>
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
<span class="badge rounded-pill text-bg-warning"><?php echo lang('general_word_warning'); ?></span> <?php echo lang('station_location_warning_reassign'); ?> <span class="badge rounded-pill text-bg-warning"><?php echo lang('general_word_warning'); ?></span> <?php echo lang('station_location_warning_reassign'); ?> <br>
</br>
<?php echo lang('station_location_reassign_at'); ?> <a href="<?php echo site_url('maintenance/'); ?>" class="btn btn-warning"><i class="fas fa-sync"></i><?php echo lang('account_word_admin') . "/" . lang('general_word_maintenance'); ?></a> <?php echo lang('station_location_reassign_at'); ?> <a href="<?php echo site_url('maintenance/'); ?>" class="btn btn-warning"><i class="fas fa-sync"></i><?php echo lang('account_word_admin') . "/" . lang('general_word_maintenance'); ?></a>
</div> </div>
<?php } ?> <?php } ?>
@ -73,17 +73,16 @@
<?php if($row->user_id == "") { ?> <?php if($row->user_id == "") { ?>
<a href="<?php echo site_url('station/claim_user')."/".$row->station_id; ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-user-plus"></i> <?php echo lang('station_location_claim_ownership'); ?></a> <a href="<?php echo site_url('station/claim_user')."/".$row->station_id; ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-user-plus"></i> <?php echo lang('station_location_claim_ownership'); ?></a>
<?php } ?> <?php } ?>
<a href="<?php echo site_url('station/edit')."/".$row->station_id; ?>" title=<?php echo lang('admin_edit'); ?> class="btn btn-outline-primary btn-sm"><i class="fas fa-edit"></i></a> <a href="<?php echo site_url('station/edit')."/".$row->station_id; ?>" title="<?php echo lang('admin_edit'); ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-edit"></i></a>
</td> </td>
<td style="text-align: center; vertical-align: middle;"> <td style="text-align: center; vertical-align: middle;">
<a href="<?php echo site_url('station/copy')."/".$row->station_id; ?>" title=<?php echo lang('admin_copy'); ?> class="btn btn-outline-primary btn-sm"><i class="fas fa-copy"></i></a> <a href="<?php echo site_url('station/copy')."/".$row->station_id; ?>" title="<?php echo lang('admin_copy'); ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-copy"></i></a>
</td> </td>
<td style="text-align: center; vertical-align: middle;"> <td style="text-align: center; vertical-align: middle;"> <a href="<?php echo site_url('station/deletelog')."/".$row->station_id; ?>" class="btn btn-danger btn-sm" title="<?php echo lang('station_location_emptylog'); ?>" onclick="return confirm('<?php echo lang('station_location_confirm_del_qso'); ?>');"><i class="fas fa-trash-alt"></i></a>
<a href="<?php echo site_url('station/deletelog')."/".$row->station_id; ?>" class="btn btn-danger btn-sm" title=<?php echo lang('station_location_emptylog'); ?> onclick="return confirm('<?php echo lang('station_location_confirm_del_qso'); ?>');"><i class="fas fa-trash-alt"></i></a></td>
</td> </td>
<td style="text-align: center; vertical-align: middle;"> <td style="text-align: center; vertical-align: middle;">
<?php if($row->station_active != 1) { ?> <?php if($row->station_active != 1) { ?>
<a href="<?php echo site_url('station/delete')."/".$row->station_id; ?>" class="btn btn-danger btn-sm" title=<?php echo lang('admin_delete'); ?> onclick="return confirm('<?php echo lang('station_location_confirm_del_stationlocation'); ?> <?php echo $row->station_profile_name; ?> <?php echo lang('station_location_confirm_del_stationlocation_qso'); ?>');"><i class="fas fa-trash-alt"></i></a> <a href="<?php echo site_url('station/delete')."/".$row->station_id; ?>" class="btn btn-danger btn-sm" title="<?php echo lang('admin_delete'); ?>" onclick="return confirm('<?php echo lang('station_location_confirm_del_stationlocation'); ?> <?php echo $row->station_profile_name; ?> <?php echo lang('station_location_confirm_del_stationlocation_qso'); ?>');"><i class="fas fa-trash-alt"></i></a>
<?php } ?> <?php } ?>
</td> </td>
</tr> </tr>

查看文件

@ -8,8 +8,8 @@
<div class="col-md-3"> <div class="col-md-3">
<select id="band" name="band" class="form-select"> <select id="band" name="band" class="form-select">
<option value="All">All</option> <option value="All">All</option>
<?php foreach($worked_bands as $band) { <?php foreach ($worked_bands as $band) {
echo '<option value="' . $band . '">' . $band . '</option>'."\n"; echo '<option value="' . $band . '">' . $band . '</option>' . "\n";
} ?> } ?>
</select> </select>
</div> </div>
@ -17,16 +17,16 @@
<label class="col-md-1 control-label" for="dxcc">DXCC</label> <label class="col-md-1 control-label" for="dxcc">DXCC</label>
<div class="col-md-3"> <div class="col-md-3">
<select id="dxcc" name="dxcc" class="form-select"> <select id="dxcc" name="dxcc" class="form-select">
<option value = 'All'>All</option> <option value='All'>All</option>
<?php <?php
if ($dxcc_list->num_rows() > 0) { if ($dxcc_list->num_rows() > 0) {
foreach ($dxcc_list->result() as $dxcc) { foreach ($dxcc_list->result() as $dxcc) {
echo '<option value=' . $dxcc->adif . '> ' . ucwords(strtolower($dxcc->name)) . ' - ' . $dxcc->prefix; echo '<option value=' . $dxcc->adif . '> ' . ucwords(strtolower($dxcc->name)) . ' - ' . $dxcc->prefix;
if ($dxcc->end != null) { if ($dxcc->end != null) {
echo ' ('.lang('gen_hamradio_deleted_dxcc').')'; echo ' (' . lang('gen_hamradio_deleted_dxcc') . ')';
}
echo '</option>';
} }
echo '</option>';
}
} }
?> ?>
</select> </select>
@ -37,10 +37,10 @@
<label class="col-md-1 control-label" for="cqzone">CQ Zone</label> <label class="col-md-1 control-label" for="cqzone">CQ Zone</label>
<div class="col-md-3"> <div class="col-md-3">
<select id="cqzone" name="cqzone" class="form-select"> <select id="cqzone" name="cqzone" class="form-select">
<option value = 'All'>All</option> <option value='All'>All</option>
<?php <?php
for ($i = 1; $i<=40; $i++) { for ($i = 1; $i <= 40; $i++) {
echo '<option value='. $i . '>'. $i .'</option>'; echo '<option value=' . $i . '>' . $i . '</option>';
} }
?> ?>
</select> </select>

查看文件

@ -3,7 +3,7 @@
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<ul style="font-size: 15px;" class="nav nav-tabs card-header-tabs pull-right" id="myTab" role="tablist"> <ul style="font-size: 15px;" class="nav nav-tabs card-header-tabs pull-right" id="myTab" role="tablist">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" id="dxcc-tab" data-bs-toggle="tab" href="#dxcc" role="tab" aria-controls="update" aria-selected="true">DXCC Lookup Data</a> <a class="nav-link active" id="dxcc-tab" data-bs-toggle="tab" href="#dxcc" role="tab" aria-controls="update" aria-selected="true">DXCC Lookup Data</a>
</li> </li>
@ -19,9 +19,9 @@
<p class="card-text">Here you can update the DXCC lookup data that is used for displaying callsign information.</p> <p class="card-text">Here you can update the DXCC lookup data that is used for displaying callsign information.</p>
<p class="card-text">This data is provided by <a href="https://clublog.org/">Clublog</a>.</p> <p class="card-text">This data is provided by <a href="https://clublog.org/">Clublog</a>.</p>
<?php if(!extension_loaded('xml')) { ?> <?php if (!extension_loaded('xml')) { ?>
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
You must install php-xml for this to work. You must install php-xml for this to work.
</div> </div>
<?php } else { ?> <?php } else { ?>
<h5>Check for DXCC Data Updates</h5> <h5>Check for DXCC Data Updates</h5>
@ -29,37 +29,35 @@
<div id="dxcc_update_status">Status:</br></div> <div id="dxcc_update_status">Status:</br></div>
<br/> <br />
<br/> <br />
<h5>Apply DXCC Data to Logbook</h5> <h5>Apply DXCC Data to Logbook</h5>
<p class="card-text"> <p class="card-text">
After updating, Cloudlog can fill in missing callsign information in the logbook using the newly-obtained DXCC data. After updating, Cloudlog can fill in missing callsign information in the logbook using the newly-obtained DXCC data.
You can choose to check just the QSOs in the logbook that are missing DXCC metadata or to re-check the entire logbook You can choose to check just the QSOs in the logbook that are missing DXCC metadata or to re-check the entire logbook
and update existing metadata as well, in case it has changed. and update existing metadata as well, in case it has changed.
</p> </p>
<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc');?>">Check QSOs missing DXCC data</a></p> <p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc'); ?>">Check QSOs missing DXCC data</a></p>
<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc/all');?>">Re-check all QSOs in logbook</a></p> <p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc/all'); ?>">Re-check all QSOs in logbook</a></p>
<h5>Apply Continent Data to Logbook</h5> <h5>Apply Continent Data to Logbook</h5>
<p class="card-text"> <p class="card-text">
This function can be used to update QSO continent information for all QSOs in Cloudlog missing that information. This function can be used to update QSO continent information for all QSOs in Cloudlog missing that information.
</p> </p>
<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_continent');?>">Check QSOs missing continent data</a></p> <p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_continent'); ?>">Check QSOs missing continent data</a></p>
<style> <style>
#dxcc_update_status{ #dxcc_update_status {
display: None; display: None;
} }
</style> </style>
<?php } ?> <?php } ?>
</div> </div>
<div class="tab-pane fade" id="distance" role="tabpanel" aria-labelledby="distance-tab"> <div class="tab-pane fade" id="distance" role="tabpanel" aria-labelledby="distance-tab">
<p class="card-text">Here you can update QSOs with missing distance information.</p> <p class="card-text">Here you can update QSOs with missing distance information.</p>
<p><a class="btn btn-primary" hx-get="<?php echo site_url('update/update_distances');?>" hx-target="#distance_results" href="<?php echo site_url('update/update_distances');?>">Update distance data</a></p> <p><a class="btn btn-primary" hx-get="<?php echo site_url('update/update_distances'); ?>" hx-target="#distance_results" href="<?php echo site_url('update/update_distances'); ?>">Update distance data</a></p>
<div id="distance_results"></div> <div id="distance_results"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

查看文件

@ -1,18 +1,18 @@
<div class="container"> <div class="container">
<br> <br>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<?php echo lang('account_delete_user_account'); ?> <?php echo $user_name; ?> <?php echo lang('account_delete_user_account'); ?> <?php echo $user_name; ?>
</div> </div>
<div class="card-body"> <div class="card-body">
<h5 class="card-title"></h5> <h5 class="card-title"></h5>
<p class="card-text"><?php echo lang('account_are_you_sure_you_want_to_delete_the_user_account'); ?> <b><?php echo $user_name; ?></b>?</p> <p class="card-text"><?php echo lang('account_are_you_sure_you_want_to_delete_the_user_account'); ?> <b><?php echo $user_name; ?></b>?</p>
<form method="post" action="<?php echo site_url('user/delete')."/".$this->uri->segment(3); ?>" name="users"> <form method="post" action="<?php echo site_url('user/delete') . "/" . $this->uri->segment(3); ?>" name="users">
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" /> <input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
<input class="btn btn-danger" type="submit" value="<?php echo lang('account_yes_delete_this_user'); ?>" /> <a href="<?php echo site_url('user'); ?>" class="btn btn-success"><?php echo lang('account_no_do_not_delete_this_user'); ?></a> <input class="btn btn-danger" type="submit" value="<?php echo lang('account_yes_delete_this_user'); ?>" /> <a href="<?php echo site_url('user'); ?>" class="btn btn-success"><?php echo lang('account_no_do_not_delete_this_user'); ?></a>
</form> </form>
</div> </div>
</div> </div>
</div> </div>

查看文件

@ -46,56 +46,71 @@
<!-- Account Information --> <!-- Account Information -->
<div class="col-md"> <div class="col-md">
<div class="card"> <div class="card">
<div class="card-header"><?php echo lang('account_account_information'); ?></div> <div class="card-header">
<?php echo lang('account_account_information'); ?>
</div>
<div class="card-body"> <div class="card-body">
<div class="mb-3"> <div class="mb-3">
<label><?php echo lang('account_username'); ?></label> <label class="form-label"><?php echo lang('account_username'); ?></label>
<input class="form-control" type="text" name="user_name" value="<?php if (isset($user_name)) {
echo $user_name;
} ?>" />
<?php if (isset($username_error)) {
echo "<small class=\"error\">" . $username_error . "</small>";
} ?>
</div>
<div class="mb-3">
<label><?php echo lang('account_email_address'); ?></label>
<input class="form-control" type="text" name="user_email" value="<?php if (isset($user_email)) {
echo $user_email;
} ?>" />
<?php if (isset($email_error)) {
echo "<small class=\"error\">" . $email_error . "</small>";
} ?>
</div>
<div class="mb-3">
<label><?php echo lang('account_password'); ?></label>
<div class="input-group"> <div class="input-group">
<span class="input-group-text"><i class="fa fa-user"></i></span>
<input class="form-control" type="text" name="user_name" value="<?php if (isset($user_name)) {
echo $user_name;
} ?>" />
</div>
<?php if (isset($username_error)) {
echo "<small class=\"text-danger\"><i class=\"fa fa-exclamation-circle\"></i> " . $username_error . "</small>";
} ?>
</div>
<div class="mb-3">
<label class="form-label"><?php echo lang('account_email_address'); ?></label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-envelope"></i></span>
<input class="form-control" type="email" name="user_email" value="<?php if (isset($user_email)) {
echo $user_email;
} ?>" />
</div>
<?php if (isset($email_error)) {
echo "<small class=\"text-danger\"><i class=\"fa fa-exclamation-circle\"></i> " . $email_error . "</small>";
} ?>
</div>
<div class="mb-3">
<label class="form-label"><?php echo lang('account_password'); ?></label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-lock"></i></span>
<input class="form-control" type="password" name="user_password" /> <input class="form-control" type="password" name="user_password" />
<span class="input-group-btn"><button class="btn btn-default btn-pwd-showhide" type="button"><i class="fa fa-eye-slash"></i></button></span> <button class="btn btn-outline-secondary btn-pwd-showhide" type="button"><i class="fa fa-eye-slash"></i></button>
</div> </div>
<?php if (isset($password_error)) { <?php if (isset($password_error)) {
echo "<small class=\"error\">" . $password_error . "</small>"; echo "<small class=\"text-danger\"><i class=\"fa fa-exclamation-circle\"></i> " . $password_error . "</small>";
} else { ?> } else { ?>
<small class="form-text text-muted"><?php echo lang('account_leave_blank_to_keep_existing_password'); ?></small> <small class="form-text text-muted"><i class="fa fa-info-circle"></i> <?php echo lang('account_leave_blank_to_keep_existing_password'); ?></small>
<?php } ?> <?php } ?>
</div> </div>
<hr /> <hr class="my-4" />
<div class="mb-3"> <div class="mb-3">
<label><?php echo lang('account_user_role'); ?></label> <label class="form-label"><?php echo lang('account_user_role'); ?></label>
<?php if ($this->session->userdata('user_type') == 99) { ?> <?php if ($this->session->userdata('user_type') == 99) { ?>
<select class="form-select" name="user_type"> <div class="input-group">
<?php <span class="input-group-text"><i class="fa fa-users"></i></span>
$levels = $this->config->item('auth_level'); <select class="form-select" name="user_type">
foreach ($levels as $key => $value) { <?php
echo '<option value="' . $key . '" ' . (($user_type == $key) ? "selected=\"selected\"" : "") . '>' . $value . '</option>'; $levels = $this->config->item('auth_level');
} foreach ($levels as $key => $value) {
?> echo '<option value="' . $key . '" ' . (($user_type == $key) ? "selected=\"selected\"" : "") . '>' . $value . '</option>';
</select> }
?>
</select>
</div>
<?php } else { <?php } else {
$l = $this->config->item('auth_level'); $l = $this->config->item('auth_level');
echo $l[$user_type]; echo '<div class="input-group">
<span class="input-group-text"><i class="fa fa-user-tag"></i></span>
<input type="text" class="form-control" value="' . $l[$user_type] . '" disabled>
</div>';
} ?> } ?>
</div> </div>
</div> </div>
@ -281,28 +296,38 @@
<div class="card-body"> <div class="card-body">
<div class="mb-3"> <div class="mb-3">
<div class="form-check form-switch"> <div class="form-check form-switch">
<input name="user_dashboard_enable_dxpedition_card" class="form-check-input" type="checkbox" role="switch" id="DashboardUpcomingDXpeditionCheck" <?php if ($dashboard_upcoming_dx_card) { echo 'checked'; } ?>> <input name="user_dashboard_enable_dxpedition_card" class="form-check-input" type="checkbox" role="switch" id="DashboardUpcomingDXpeditionCheck" <?php if ($dashboard_upcoming_dx_card) {
<label class="form-check-label" for="DashboardUpcomingDXpeditionCheck" >Enable Upcoming DXPedition Card</label> echo 'checked';
} ?>>
<label class="form-check-label" for="DashboardUpcomingDXpeditionCheck">Enable Upcoming DXPedition Card</label>
</div> </div>
<div class="form-check form-switch"> <div class="form-check form-switch">
<input name="user_dashboard_enable_qslcards_card" class="form-check-input" type="checkbox" role="switch" id="DashboardQSLCardCheck" <?php if ($dashboard_qslcard_card) { echo 'checked'; } ?>> <input name="user_dashboard_enable_qslcards_card" class="form-check-input" type="checkbox" role="switch" id="DashboardQSLCardCheck" <?php if ($dashboard_qslcard_card) {
<label class="form-check-label" for="DashboardQSLCardCheck" >Enable QSL Cards Card</label> echo 'checked';
} ?>>
<label class="form-check-label" for="DashboardQSLCardCheck">Enable QSL Cards Card</label>
</div> </div>
<div class="form-check form-switch"> <div class="form-check form-switch">
<input name="user_dashboard_enable_eqslcards_card" class="form-check-input" type="checkbox" role="switch" id="DashboardeQSLCardCheck" <?php if ($dashboard_eqslcard_card) { echo 'checked'; } ?>> <input name="user_dashboard_enable_eqslcards_card" class="form-check-input" type="checkbox" role="switch" id="DashboardeQSLCardCheck" <?php if ($dashboard_eqslcard_card) {
<label class="form-check-label" for="DashboardeQSLCardCheck" >Enable eQSL Cards Card</label> echo 'checked';
} ?>>
<label class="form-check-label" for="DashboardeQSLCardCheck">Enable eQSL Cards Card</label>
</div> </div>
<div class="form-check form-switch"> <div class="form-check form-switch">
<input name="user_dashboard_enable_lotw_card" class="form-check-input" type="checkbox" role="switch" id="DashboardlotwCardCheck" <?php if ($dashboard_lotw_card) { echo 'checked'; } ?>> <input name="user_dashboard_enable_lotw_card" class="form-check-input" type="checkbox" role="switch" id="DashboardlotwCardCheck" <?php if ($dashboard_lotw_card) {
<label class="form-check-label" for="DashboardlotwCardCheck" >Enable Logbook of the World Card</label> echo 'checked';
} ?>>
<label class="form-check-label" for="DashboardlotwCardCheck">Enable Logbook of the World Card</label>
</div> </div>
<div class="form-check form-switch"> <div class="form-check form-switch">
<input name="user_dashboard_enable_vuccgrids_card" class="form-check-input" type="checkbox" role="switch" id="DashboardvuccgridsCardCheck" <?php if ($dashboard_vuccgrids_card) { echo 'checked'; } ?>> <input name="user_dashboard_enable_vuccgrids_card" class="form-check-input" type="checkbox" role="switch" id="DashboardvuccgridsCardCheck" <?php if ($dashboard_vuccgrids_card) {
<label class="form-check-label" for="DashboardvuccgridsCardCheck" >Enable VUCC-Grids Card</label> echo 'checked';
} ?>>
<label class="form-check-label" for="DashboardvuccgridsCardCheck">Enable VUCC-Grids Card</label>
</div> </div>
</div> </div>
</div> </div>
@ -1021,8 +1046,8 @@
<div class="mb-3"> <div class="mb-3">
<label>Callbook Username</label> <label>Callbook Username</label>
<input class="form-control" type="text" name="user_callbook_username" value="<?php if (isset($user_callbook_username)) { <input class="form-control" type="text" name="user_callbook_username" value="<?php if (isset($user_callbook_username)) {
echo $user_callbook_username; echo $user_callbook_username;
} ?>" /> } ?>" />
<?php if (isset($callbook_username_error)) { <?php if (isset($callbook_username_error)) {
echo "<small class=\"error\">" . $callbook_username_error . "</small>"; echo "<small class=\"error\">" . $callbook_username_error . "</small>";
} ?> } ?>
@ -1166,20 +1191,28 @@
<div class="card-header"><?php echo lang('account_winkeyer'); ?> <span class="badge text-bg-danger float-end"><?php echo lang('admin_experimental'); ?></span></div> <div class="card-header"><?php echo lang('account_winkeyer'); ?> <span class="badge text-bg-danger float-end"><?php echo lang('admin_experimental'); ?></span></div>
<div class="card-body"> <div class="card-body">
<div class="mb-3"> <div class="mb-3">
<label><?php echo lang('account_winkeyer_enabled'); ?></label> <div class="form-check form-switch">
<?php if (!isset($user_winkey)) { <?php if (!isset($user_winkey)) {
$user_winkey = '0'; $user_winkey = '0';
} ?> } ?>
<select class="form-select" name="user_winkey" id="user_winkeyer"> <input name="user_winkey" class="form-check-input" type="checkbox" role="switch" id="user_winkeyer" value="1" <?php if ($user_winkey == 1) {
<option value="0" <?php if ($user_winkey == 0) { echo 'checked';
echo 'selected="selected"'; } ?>>
} ?>><?php echo lang('general_word_no'); ?></option> <label class="form-check-label" for="user_winkeyer"><?php echo lang('account_winkeyer_enabled'); ?></label>
<option value="1" <?php if ($user_winkey == 1) { </div>
echo 'selected="selected"';
} ?>><?php echo lang('general_word_yes'); ?></option>
</select>
<small class="form-text text-muted"><?php echo lang('account_winkeyer_hint'); ?></small>
</div> </div>
<hr />
<div class="mb-3">
<div class="form-check form-switch">
<input name="user_winkey_websocket" class="form-check-input" type="checkbox" role="switch" id="user_winkey_websocket" value="1" <?php if ($user_winkey_websocket == 1) {
echo 'checked';
} ?>>
<label class="form-check-label" for="user_winkey_websocket">Winkey Web Sockets</label>
</div>
</div>
<small class="form-text text-muted d-block mt-3"><?php echo lang('account_winkeyer_hint'); ?></small>
</div> </div>
</div> </div>
</div> </div>

查看文件

@ -1,43 +1,43 @@
<style> <style>
html, html,
body { body {
height: 100%; height: 100%;
} }
body { body {
display: flex; display: flex;
align-items: center; align-items: center;
padding-top: 40px; padding-top: 40px;
padding-bottom: 40px; padding-bottom: 40px;
} }
.form-forgot { .form-forgot {
width: 100%; width: 100%;
max-width: 430px; max-width: 430px;
padding: 15px; padding: 15px;
margin: auto; margin: auto;
} }
input[type="email"] { input[type="email"] {
margin-bottom: -1px; margin-bottom: -1px;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
</style> </style>
<main class="form-forgot"> <main class="form-forgot">
<img src="<?php echo base_url()?>/CloudLog_logo.png" class="mx-auto d-block" alt="" style="width:100px;height:100px;"> <img src="<?php echo base_url() ?>/CloudLog_logo.png" class="mx-auto d-block" alt="" style="width:100px;height:100px;">
<div class="my-2 bg-body rounded-0 shadow-sm card mb-2 shadow-sm"> <div class="my-2 bg-body rounded-0 shadow-sm card mb-2 shadow-sm">
<div class="card-body"> <div class="card-body">
<div class="text-center"> <div class="text-center">
<h3 class="text-center"><?php echo lang('account_forgot_password'); ?> <i class="fa fa-lock"></i></h3> <h3 class="text-center"><?php echo lang('account_forgot_password'); ?> <i class="fa fa-lock"></i></h3>
<p><?php echo lang('account_you_can_reset_your_password_here'); ?></p> <p><?php echo lang('account_you_can_reset_your_password_here'); ?></p>
<div class="panel-body"> <div class="panel-body">
<?php if(validation_errors() != ''): ?> <?php if (validation_errors() != ''): ?>
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
<?php echo validation_errors(); ?> <?php echo validation_errors(); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<form id="register-form" role="form" autocomplete="off" class="form" method="post" action="<?php echo site_url('user/forgot_password'); ?>"> <form id="register-form" role="form" autocomplete="off" class="form" method="post" action="<?php echo site_url('user/forgot_password'); ?>">

查看文件

@ -1,36 +1,36 @@
<style> <style>
html, html,
body { body {
height: 100%; height: 100%;
} }
body { body {
display: flex; display: flex;
align-items: center; align-items: center;
padding-top: 40px; padding-top: 40px;
padding-bottom: 40px; padding-bottom: 40px;
} }
.form-signin { .form-signin {
width: 100%; width: 100%;
max-width: 430px; max-width: 430px;
padding: 15px; padding: 15px;
margin: auto; margin: auto;
} }
.form-signin input[type="email"] { .form-signin input[type="email"] {
margin-bottom: -1px; margin-bottom: -1px;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.form-signin input[type="password"] { .form-signin input[type="password"] {
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;
} }
</style> </style>
<main class="form-signin"> <main class="form-signin">
<img src="<?php echo base_url()?>/CloudLog_logo.png" class="mx-auto d-block" alt="" style="width:100px;height:100px;"> <img src="<?php echo base_url() ?>/CloudLog_logo.png" class="mx-auto d-block" alt="" style="width:100px;height:100px;">
<div class="my-2 bg-body rounded-0 shadow-sm card mb-2 shadow-sm"> <div class="my-2 bg-body rounded-0 shadow-sm card mb-2 shadow-sm">
<div class="card-body"> <div class="card-body">
<h3><?php echo lang('account_login_to_cloudlog'); ?></h3> <h3><?php echo lang('account_login_to_cloudlog'); ?></h3>
@ -38,7 +38,7 @@ body {
<?php $this->load->view('layout/messages'); ?> <?php $this->load->view('layout/messages'); ?>
<form method="post" action="<?php echo site_url('user/login'); ?>" name="users"> <form method="post" action="<?php echo site_url('user/login'); ?>" name="users">
<?php $this->form_validation->set_error_delimiters('', ''); ?> <?php $this->form_validation->set_error_delimiters('', ''); ?>
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" /> <input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
<div> <div>
<label for="floatingInput"><strong><?php echo lang('account_username'); ?></strong></label> <label for="floatingInput"><strong><?php echo lang('account_username'); ?></strong></label>
@ -57,10 +57,10 @@ body {
<input type="checkbox" name="remember_me" value="1"> <?php echo lang('account_remember_me'); ?> <input type="checkbox" name="remember_me" value="1"> <?php echo lang('account_remember_me'); ?>
</label> </label>
<div> <div>
<p><small><a class="" href="<?php echo site_url('user/forgot_password'); ?>"><?php echo lang('account_forgot_your_password'); ?></a></small></p> <p><small><a class="" href="<?php echo site_url('user/forgot_password'); ?>"><?php echo lang('account_forgot_your_password'); ?></a></small></p>
</div> </div>
<button class="w-100 btn btn-info" type="submit"><?php echo lang('account_login'); ?> →</button> <button class="w-100 btn btn-info" type="submit"><?php echo lang('account_login'); ?> →</button>
</form> </form>
</div> </div>
</div> </div>

查看文件

@ -70,7 +70,7 @@
echo $row->last_login_date; echo $row->last_login_date;
} else { } else {
echo lang('general_word_never'); echo lang('general_word_never');
}?> } ?>
</td> </td>
<td style="text-align: center; vertical-align: middle;"><a href="<?php echo site_url('user/edit') . "/" . $row->user_id; ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-user-edit"></i></a> <td style="text-align: center; vertical-align: middle;"><a href="<?php echo site_url('user/edit') . "/" . $row->user_id; ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-user-edit"></i></a>
<td style="text-align: center; vertical-align: middle;"> <td style="text-align: center; vertical-align: middle;">
@ -81,7 +81,7 @@
?></td> ?></td>
<td style="text-align: center; vertical-align: middle;"> <td style="text-align: center; vertical-align: middle;">
<?php if ($_SESSION['user_id'] != $row->user_id) { ?> <?php if ($_SESSION['user_id'] != $row->user_id) { ?>
<button class="btn btn-danger btn-sm" hx-delete="<?php echo site_url('user/delete_new/'.$row->user_id);?>"><i class="fas fa-user-minus"></i></button> <button class="btn btn-danger btn-sm" hx-delete="<?php echo site_url('user/delete_new/' . $row->user_id); ?>"><i class="fas fa-user-minus"></i></button>
<?php } ?> <?php } ?>
</td> </td>
</td> </td>

查看文件

@ -1,55 +1,68 @@
<div class="container"> <div class="container">
<br> <br>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<?php echo $this->session->userdata('user_name')."'s profile"; ?> <?php echo $this->session->userdata('user_name') . "'s profile"; ?>
</div> </div>
<div class="card-body"> <div class="card-body">
<h5 class="card-title"></h5> <h5 class="card-title"></h5>
<p class="card-text"></p> <p class="card-text"></p>
<table class="profile"> <table class="profile">
<tr> <tr>
<td width="100px">Username</td> <td width="100px">Username</td>
<td><?php if(isset($user_name)) { echo $user_name; } ?></td> <td><?php if (isset($user_name)) {
</tr> echo $user_name;
} ?></td>
</tr>
<tr> <tr>
<td>Level</td> <td>Level</td>
<td><?php $l = $this->config->item('auth_level'); echo $l[$user_type]; ?></td> <td><?php $l = $this->config->item('auth_level');
</tr> echo $l[$user_type]; ?></td>
</tr>
<tr> <tr>
<td>E-mail</td> <td>E-mail</td>
<td><?php if(isset($user_email)) { echo $user_email; } ?></td> <td><?php if (isset($user_email)) {
</tr> echo $user_email;
} ?></td>
</tr>
<tr> <tr>
<td>Callsign</td> <td>Callsign</td>
<td><?php if(isset($user_callsign)) { echo $user_callsign; } ?></td> <td><?php if (isset($user_callsign)) {
</tr> echo $user_callsign;
} ?></td>
</tr>
<tr> <tr>
<td>Gridsquare</td> <td>Gridsquare</td>
<td><?php if(isset($user_locator)) { echo $user_locator; } ?></td> <td><?php if (isset($user_locator)) {
</tr> echo $user_locator;
} ?></td>
</tr>
<tr> <tr>
<td>First name</td> <td>First name</td>
<td><?php if(isset($user_firstname)) { echo $user_firstname; } ?></td> <td><?php if (isset($user_firstname)) {
</tr> echo $user_firstname;
} ?></td>
</tr>
<tr> <tr>
<td>Last name</td> <td>Last name</td>
<td><?php if(isset($user_lastname)) { echo $user_lastname; } ?></td> <td><?php if (isset($user_lastname)) {
</tr> echo $user_lastname;
} ?></td>
</tr>
</table> </table>
<a class="btn btn-primary" href="<?php echo site_url('user/edit')."/".$this->session->userdata('user_id'); ?>">Edit profile</a> <a class="btn btn-primary" href="<?php echo site_url('user/edit') . "/" . $this->session->userdata('user_id'); ?>">Edit profile</a>
</div> </div>
</div> </div>
</div> </div>

查看文件

@ -1,47 +1,47 @@
<div id="container" class="container mx-auto pt-5"> <div id="container" class="container mx-auto pt-5">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-body">
<div class="text-center"> <div class="text-center">
<h3><i class="fa fa-lock fa-4x"></i></h3> <h3><i class="fa fa-lock fa-4x"></i></h3>
<h2 class="text-center"><?php echo lang('account_reset_password'); ?>?</h2> <h2 class="text-center"><?php echo lang('account_reset_password'); ?>?</h2>
<p><?php echo lang('account_you_can_reset_your_password_here'); ?></p> <p><?php echo lang('account_you_can_reset_your_password_here'); ?></p>
<div class="panel-body"> <div class="panel-body">
<?php if(validation_errors() != ''): ?> <?php if (validation_errors() != ''): ?>
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
<?php echo validation_errors(); ?> <?php echo validation_errors(); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<form role="form" autocomplete="off" class="form" method="post" action="<?php echo site_url('user/reset_password'); ?>/<?php echo $reset_code; ?>"> <form role="form" autocomplete="off" class="form" method="post" action="<?php echo site_url('user/reset_password'); ?>/<?php echo $reset_code; ?>">
<div class="mb-3 row">
<label for="inputPassword" class="col-sm-2 col-form-label"><?php echo lang('account_password'); ?></label>
<div class="col-sm-10">
<input type="password" name="password" class="form-control" id="inputPassword" placeholder="<?php echo lang('account_password'); ?>">
</div>
</div>
<div class="mb-3 row">
<label for="inputPassword" class="col-sm-2 col-form-label"><?php echo lang('account_confirm_password'); ?></label>
<div class="col-sm-10">
<input type="password" name="password_confirm" class="form-control" id="inputPassword" placeholder="<?php echo lang('account_password'); ?>">
</div>
</div>
<div class="mb-3">
<input name="recover-submit" class="btn btn-lg btn-primary btn-block" value="<?php echo lang('account_reset_password'); ?>" type="submit">
</div>
<input type="hidden" class="hide" name="token" id="token" value="">
</form>
<div class="mb-3 row">
<label for="inputPassword" class="col-sm-2 col-form-label"><?php echo lang('account_password'); ?></label>
<div class="col-sm-10">
<input type="password" name="password" class="form-control" id="inputPassword" placeholder="<?php echo lang('account_password'); ?>">
</div> </div>
</div> </div>
</div>
<div class="mb-3 row">
<label for="inputPassword" class="col-sm-2 col-form-label"><?php echo lang('account_confirm_password'); ?></label>
<div class="col-sm-10">
<input type="password" name="password_confirm" class="form-control" id="inputPassword" placeholder="<?php echo lang('account_password'); ?>">
</div>
</div>
<div class="mb-3">
<input name="recover-submit" class="btn btn-lg btn-primary btn-block" value="<?php echo lang('account_reset_password'); ?>" type="submit">
</div>
<input type="hidden" class="hide" name="token" id="token" value="">
</form>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div> </div>

查看文件

@ -174,14 +174,13 @@ function handleInput() {
/^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}|[AENOS]*[FNSUACA]-\d{3}|(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}|[A-Z0-9]{1,3}[F]{2}-\d{4}$/i /^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}|[AENOS]*[FNSUACA]-\d{3}|(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}|[A-Z0-9]{1,3}[F]{2}-\d{4}$/i
) )
) { ) {
sotaWwff = item.toUpperCase(); sotaWwff = item.toUpperCase(); } else if (
} else if (
item.match( item.match(
/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/ /([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/
) )
) { ) {
callsign = item.toUpperCase(); callsign = item.toUpperCase();
} else if (itemNumber > 0 && item.match(/^\d{1,3}$/)) { } else if (itemNumber > 0 && (item.match(/^\d{1,3}$/) || item.match(/^[+-]\d{1,2}$/))) {
if (rst_s === null) { if (rst_s === null) {
rst_s = item; rst_s = item;
} else { } else {
@ -566,6 +565,15 @@ function getReportByMode(rst, mode) {
return "599"; return "599";
} }
// Handle digital modes with dB signal reports (e.g., -09, +00)
if ((mode.toUpperCase() === "FT8" || mode.toUpperCase() === "FT4" || mode.toUpperCase() === "JS8" ||
mode.toUpperCase() === "JT65" || mode.toUpperCase() === "JT65B" || mode.toUpperCase() === "JT6C" ||
mode.toUpperCase() === "JTMS" || mode.toUpperCase() === "ISCAT" || mode.toUpperCase() === "MSK144" ||
mode.toUpperCase() === "JTMSK" || mode.toUpperCase() === "QRA64" || mode.toUpperCase() === "JT9" ||
mode.toUpperCase() === "JT9-1" || mode.toUpperCase() === "ROS" || mode.toUpperCase() === "Q65" ||
mode.toUpperCase() === "FST4" || mode.toUpperCase() === "FST4W") && rst.match(/^[+-]\d{1,2}$/)) {
return rst;
}
if (settingsMode === "SSB") { if (settingsMode === "SSB") {
if (rst.length === 1) { if (rst.length === 1) {

查看文件

@ -88,6 +88,45 @@ async function clickConnect() {
//Define outputstream, inputstream and port so they can be used throughout the sketch //Define outputstream, inputstream and port so they can be used throughout the sketch
var outputStream, inputStream, port; var outputStream, inputStream, port;
// Auto-reconnect functionality
async function autoReconnect() {
try {
// Get previously connected ports
const ports = await navigator.serial.getPorts();
if (ports.length > 0) {
// Try to reconnect to the first available port
port = ports[0];
await port.open({ baudRate: 1200 });
await port.setSignals({ dataTerminalReady: true });
statusBar.innerText = "Auto-reconnected";
connectButton.innerText = "Disconnect";
let decoder = new TextDecoderStream();
inputDone = port.readable.pipeTo(decoder.writable);
inputStream = decoder.readable;
const encoder = new TextEncoderStream();
outputDone = encoder.readable.pipeTo(port.writable);
outputStream = encoder.writable;
writeToByte("0x00, 0x02");
writeToByte("0x02, 0x00");
$('#winkey_buttons').show();
reader = inputStream.getReader();
readLoop();
}
} catch (e) {
console.log("Auto-reconnect failed:", e);
// If auto-reconnect fails, just continue with normal flow
}
}
// Call auto-reconnect when page loads
window.addEventListener('load', autoReconnect);
navigator.serial.addEventListener('connect', e => { navigator.serial.addEventListener('connect', e => {
statusBar.innerText = `Connected to ${e.port}`; statusBar.innerText = `Connected to ${e.port}`;
connectButton.innerText = "Disconnect" connectButton.innerText = "Disconnect"
@ -182,8 +221,10 @@ async function disconnect() {
statusBar.innerText = "Disconnected"; statusBar.innerText = "Disconnected";
connectButton.innerText = "Connect" connectButton.innerText = "Connect"
//Close the port. //Close the port.
await port.close(); if (port) {
port = null; await port.close();
port = null;
}
} }
//When the send button is pressed //When the send button is pressed

查看文件

@ -511,6 +511,18 @@
] ]
} }
}, },
"SO-125":{
"Modes":{
"V/U":[
{
"Uplink_Mode":"FM",
"Uplink_Freq":"145875000",
"Downlink_Mode":"FM",
"Downlink_Freq":"436666000"
}
]
}
},
"SONATE-2":{ "SONATE-2":{
"Modes":{ "Modes":{
"V":[ "V":[