Skip to content

Commit

Permalink
Add Active checkbox to vehicle list and hide Subscribe link for inact…
Browse files Browse the repository at this point in the history
…ive cars
  • Loading branch information
motzky committed Dec 15, 2024
1 parent b47adaa commit 3409e1b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions TeslaLogger/bin/language-de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ Subscribe="Abo abschließen"
SubscribeManage="Abo verwalten"
SubscriptionRequired="Abo notwendig!"
FleetAPIRequired="Fleet API notwendig!"
Aktiv="Aktiv"

#password_fleet.php
PF_LOGOUT="Melden Sie sich von Ihrem Tesla-Konto ab, wenn Sie bereits eingeloggt sind"
Expand Down
1 change: 1 addition & 0 deletions TeslaLogger/bin/language-en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ Subscribe="Subscribe"
SubscribeManage="Manage"
SubscriptionRequired="Subscription Required!"
FleetAPIRequired="Fleet API Required!"
Aktiv="Active"

#password_fleet.php
PF_LOGOUT="Log out from your Tesla account if logged in already"
Expand Down
7 changes: 6 additions & 1 deletion TeslaLogger/www/admin/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ function GetTokensFromURL()
<th><?php t("Model"); ?></th>
<th><?php t("VIN"); ?></th>
<th><?php t("Tasker Token"); ?></th>
<th><?php t("Aktiv"); ?></th>
<th style='text-align:center;'><?php t("Free SUC"); ?></th>
<th style='text-align:center;'>Fleet API</th>
<th style='text-align:center;'>Virtual Key</th>
Expand All @@ -454,6 +455,7 @@ function GetTokensFromURL()
$vin = $v->{"vin"};
$tesla_carid = $v->{"tesla_carid"};
$access_type = $v->{"access_type"};
$inactive = $v->{"inactive"} == 1;

$cartype = $v->{"car_type"};
$NeedSubscription = !($cartype === "models" || $cartype === "modelx" || $cartype === "models2");
Expand All @@ -468,12 +470,15 @@ function GetTokensFromURL()

$virtualKeyCheckBox = GetCheckbox($v->{"virtualkey"});

$activeCheckBox = GetCheckbox(!$inactive);

echo(" <tr>\r\n");
echo(" <td>$id</td>\r\n");
echo(" <td>$display_name <a href='changecarname.php?carid=$id'>&#9998</a></td>\r\n");
echo(" <td>$car</td>\r\n");
echo(" <td>$vin</td>\r\n");
echo(" <td>$tasker_token</td>\r\n");
echo(" <td style='text-align:center;'>$activeCheckBox</td>\r\n");
echo(" <td style='text-align:center;'>$freesuccheckbox</td>\r\n");
echo(" <td style='text-align:center;'>$fleetAPICheckBox</td>\r\n");
echo(" <td style='text-align:center;'>$virtualKeyCheckBox</td>\r\n");
Expand All @@ -485,7 +490,7 @@ function GetTokensFromURL()
echo("</td>\r\n");

echo(" <td style='text-align:center;'>");
if ($NeedSubscription)
if ($NeedSubscription && !$inactive)
{
$subscription = file_get_contents("https://teslalogger.de/stripe/subscription-check.php?vin=$vin");

Expand Down

0 comments on commit 3409e1b

Please sign in to comment.