Skip to content

Feature/multiple variables - #16

Merged
TillBrede merged 29 commits into
masterfrom
feature/multiple-variables
Nov 2, 2026
Merged

TillBrede merged 29 commits into
masterfrom
feature/multiple-variables

Conversation

@Sunnyka98

@Sunnyka98 Sunnyka98 commented Nov 28, 2024 •

Copy link
Copy Markdown
Contributor
  • da fehlt noch: Translation, Verbindung zu FTP,FTPS,SFTP testen,

close https://github.com/symcon/modules/issues/281

@Sunnyka98
Sunnyka98 requested a review from paresy November 28, 2024 16:08
@Sunnyka98
Sunnyka98 marked this pull request as ready for review November 29, 2024 15:48

@TillBrede TillBrede left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Habe das Modul auf der 2 getestet. Das Zippen und Aufteilen auf mehrere Dateien scheint zu laufe. Bei mir lokal konnte ich den Branch nicht auschecken (Problem mit composer?). Das hochladen über FTP/SFTP/FTPS konnte ich nicht komplett testen (SB_UIGoDeeper, TargetDir). Der Login und das auslesen der Verzeichnisse läuft aber.

Comment thread CSVZipExport/form.json Outdated
"confirm": "Go into this Directory?"
},
{
"onClick": "SB_UIGoDeeper($id,$CurrentDir.'/'.$SelectTargetDirectory['SelectedDirectory'],$Host, $Port, $Username, $Password, $ConnectionType);",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Falsches Prefix

Comment thread CSVZipExport/form.json Outdated
},
{
"type": "Label",
"caption": "Single File per Variable will zip in a archive",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

an archive

Comment thread CSVZipExport/module.php Outdated
if (!$showError) {
$this->SetStatus(201);
} else {
echo $this->Translate('Username/Password is invalid');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dieser Fehler scheint nur bei SFTP korrekt angezeigt werden. Bei den anderen gibt es nur unschöne Fehlermeldungen.
image
Der Status 201 "A Variable is not selected" kann da irreführend sein

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was meinst du mit unschönen Fehlermeldungen?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Die Fehlermeldung im Bild. Bei SFTP wird einfach 'Username/Password is invalid' angezeigt. Bei dem Rest wird nichts abgefangen.

Comment thread CSVZipExport/module.php Outdated
//*---------------*//

/** Handle the export via Button */
public function UserExport(int $ArchiveVariable, int $AggregationStage, string $AggregationStart, string $AggregationEnd)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ArchiveVariable wird wohl nur für die Fehlermeldung genutzt

Comment thread CSVZipExport/module.php
*/
private function fetchAllValues(string $filePath, int $variable, int $level, int $start, int $end, int $limit)
{
$separator = $this->ReadPropertyString('DecimalSeparator');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Es wird nicht geprüft ob die Variablen existieren. Nicht existierende Variablen führen zu unschönen Fehlermeldungen

Comment thread CSVZipExport/module.php Resolved
Comment thread CSVZipExport/module.php Resolved
Comment thread CSVZipExport/form.json Resolved
Comment thread CSVZipExport/module.php Resolved
Comment thread CSVZipExport/module.php Resolved
@Sunnyka98
Sunnyka98 requested a review from TillBrede March 10, 2025 12:49

@TillBrede TillBrede left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Der Login Fehler wird noch nicht schön abgefangen.
Funktional konnte ich nicht testen, da das Submodul fehlt / nicht richtig geladen wird

Comment thread CSVZipExport/module.php Outdated
if (!$showError) {
$this->SetStatus(201);
} else {
echo $this->Translate('Username/Password is invalid');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Die Fehlermeldung im Bild. Bei SFTP wird einfach 'Username/Password is invalid' angezeigt. Bei dem Rest wird nichts abgefangen.

Comment thread CSVZipExport/module.php Resolved
@Sunnyka98
Sunnyka98 requested a review from TillBrede July 1, 2025 10:08
- Fix cyclic timer for daily/weekly/monthly/yearly intervals
- Upload FTP/SFTP files into the target directory by file name
- Catch connection and login errors for FTP, FTPS and SFTP
- Use the instance based export path for download, mail and cleanup
- Fix MySQL export and hide the option without SyncMySQL
- Migrate the ArchiveVariable configuration of version 1.x
- Keep columns aligned in the multi variable export
- Remove duplicated rows in the raw value export
- Add missing translations and the target directory status
Active mode fails if the server cannot connect back (NAT, firewall).
Wait 10 seconds for the server like SFTP instead of 90.
- Return false from Export and UserExport if nothing could be exported
- Show errors of the download button and its own progress bar
- Return 404 from the hook if the export was already deleted
- Lock the export per instance and name the temp files per instance
- Empty the temp file before fetching, so no stale rows are exported
- Check the configuration on every run, so a failed sending is retried
- Check the FTP connection while sending instead of in ApplyChanges
- "Send Mail Now" and "Send File now" only use their own method
- Use the exported period in the mail subject
- Report failed mails and transfers
Symcon ignores default values of parameters, so CSV_SendCyclic with only
the instance ID failed with "Wrong parameter count" on every run.
Scripts of version 1.x call both functions with the variable to export.
They export this single variable to a Zip File again. The export of the
configured variables is now CSV_ExportVariables, the download button
uses CSV_UIExport.

An export deletes the previous Zip or Csv File, so the hook and the
sending always find the file of the last export.
UIChangePort read the saved port instead of the port in the form.
MLSD has a standardized format. Without MLSD, Windows (IIS) listings are parsed besides Unix listings and lines like "total 12" are skipped.
"Send Mail Now" refused to send if the cyclic FTP sending had no host. The buttons only need valid variables now, the status still shows an invalid configuration of the cyclic sending.
The archive includes the end timestamp, so every export contained the first value of the current interval. On a monday, the weekly export used the week before the last one.
The next hour was calculated without the date, so after 23:00 the next run was in the past and the timer interval negative.
@TillBrede
TillBrede merged commit fc38bed into master Nov 2, 2026
4 checks passed
@TillBrede
TillBrede deleted the feature/multiple-variables branch November 2, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants