mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 12:46:34 +00:00
force hide files on sdc
This commit is contained in:
parent
5c79d2dc87
commit
7a01c70e7c
@ -146,6 +146,7 @@ void UfsCheckSDCardInit(void) {
|
|||||||
cs = Pin(GPIO_SDCARD_CS);
|
cs = Pin(GPIO_SDCARD_CS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef EPS8266
|
#ifdef EPS8266
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
#endif // EPS8266
|
#endif // EPS8266
|
||||||
@ -563,7 +564,12 @@ const char UFS_FORM_FILE_UPGb[] PROGMEM =
|
|||||||
"<form method='get' action='ufse'><input type='hidden' file='" D_NEW_FILE "'>"
|
"<form method='get' action='ufse'><input type='hidden' file='" D_NEW_FILE "'>"
|
||||||
"<button type='submit'>" D_CREATE_NEW_FILE "</button></form>"
|
"<button type='submit'>" D_CREATE_NEW_FILE "</button></form>"
|
||||||
#endif
|
#endif
|
||||||
"<input type='checkbox' id='shf' onclick='sf(eb(\"shf\").checked);' name='shf'>" D_SHOW_HIDDEN_FILES "</input>"
|
;
|
||||||
|
|
||||||
|
const char UFS_FORM_FILE_UPGb1[] PROGMEM =
|
||||||
|
"<input type='checkbox' id='shf' onclick='sf(eb(\"shf\").checked);' name='shf'>" D_SHOW_HIDDEN_FILES "</input>";
|
||||||
|
|
||||||
|
const char UFS_FORM_FILE_UPGb2[] PROGMEM =
|
||||||
"</fieldset>"
|
"</fieldset>"
|
||||||
"</div>"
|
"</div>"
|
||||||
"<div id='f2' name='f2' style='display:none;text-align:center;'><b>" D_UPLOAD_STARTED " ...</b></div>";
|
"<div id='f2' name='f2' style='display:none;text-align:center;'><b>" D_UPLOAD_STARTED " ...</b></div>";
|
||||||
@ -665,14 +671,30 @@ void UfsDirectory(void) {
|
|||||||
}
|
}
|
||||||
WSContentSend_P(UFS_FORM_SDC_DIRc);
|
WSContentSend_P(UFS_FORM_SDC_DIRc);
|
||||||
WSContentSend_P(UFS_FORM_FILE_UPGb);
|
WSContentSend_P(UFS_FORM_FILE_UPGb);
|
||||||
|
if (!isSDC()) {
|
||||||
|
WSContentSend_P(UFS_FORM_FILE_UPGb1);
|
||||||
|
}
|
||||||
|
WSContentSend_P(UFS_FORM_FILE_UPGb2);
|
||||||
|
|
||||||
WSContentSpaceButton(BUTTON_MANAGEMENT);
|
WSContentSpaceButton(BUTTON_MANAGEMENT);
|
||||||
WSContentStop();
|
WSContentStop();
|
||||||
|
|
||||||
Web.upload_file_type = UPL_UFSFILE;
|
Web.upload_file_type = UPL_UFSFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return true if SDC
|
||||||
|
bool isSDC(void) {
|
||||||
|
#ifndef SDC_HIDE_INVISIBLES
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
if (((uint32_t)ufsp != (uint32_t)ffsp) && ((uint32_t)ffsp == (uint32_t)dfsp)) return false;
|
||||||
|
if (((uint32_t)ufsp == (uint32_t)ffsp) && (ufs_type != UFS_TSDC)) return false;
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void UfsListDir(char *path, uint8_t depth) {
|
void UfsListDir(char *path, uint8_t depth) {
|
||||||
char name[32];
|
char name[48];
|
||||||
char npath[128];
|
char npath[128];
|
||||||
char format[12];
|
char format[12];
|
||||||
sprintf(format, PSTR("%%-%ds"), 24 - depth);
|
sprintf(format, PSTR("%%-%ds"), 24 - depth);
|
||||||
@ -717,6 +739,8 @@ void UfsListDir(char *path, uint8_t depth) {
|
|||||||
// osx formatted disks contain a lot of stuff we dont want
|
// osx formatted disks contain a lot of stuff we dont want
|
||||||
bool hiddable = UfsReject((char*)ep);
|
bool hiddable = UfsReject((char*)ep);
|
||||||
|
|
||||||
|
if (!hiddable || !isSDC() ) {
|
||||||
|
|
||||||
for (uint8_t cnt = 0; cnt<depth; cnt++) {
|
for (uint8_t cnt = 0; cnt<depth; cnt++) {
|
||||||
*cp++ = '-';
|
*cp++ = '-';
|
||||||
}
|
}
|
||||||
@ -752,6 +776,9 @@ void UfsListDir(char *path, uint8_t depth) {
|
|||||||
}
|
}
|
||||||
entry.close();
|
entry.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
dir.close();
|
dir.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user