ui: Display a message when dealing with compressed downloads
This commit is contained in:
parent
1a21115503
commit
6a0b0545d7
2 changed files with 16 additions and 6 deletions
|
@ -40,7 +40,14 @@
|
||||||
{/if}
|
{/if}
|
||||||
<nobr>
|
<nobr>
|
||||||
Taille :
|
Taille :
|
||||||
<FileSize size={file.size} />
|
{#if file.compressed}
|
||||||
|
<acronym title="Nous ne sommes pas en mesure de calculer la taille exacte de ce fichier, votre navigateur est susceptible d'afficher une progression non représentative. Tant que le téléchargement se poursuit (même au delà de 100%), n'arrêtez pas, vous n'auriez pas le fichier en entier. Ce phénomène est du au fait que le fichier est stocké sous une forme compressé sur notre serveur, alors que vous le récupérez décompressé." class="fst-italic">
|
||||||
|
environ
|
||||||
|
<FileSize size={file.size} />
|
||||||
|
</acronym>
|
||||||
|
{:else}
|
||||||
|
<FileSize size={file.size} />
|
||||||
|
{/if}
|
||||||
</nobr>
|
</nobr>
|
||||||
<nobr class="d-block text-truncate">
|
<nobr class="d-block text-truncate">
|
||||||
<span title="blake2.net">b2sum</span> :
|
<span title="blake2.net">b2sum</span> :
|
||||||
|
|
|
@ -20,10 +20,11 @@ var DisplayAllFlags bool
|
||||||
var DisplayMCQBadCount bool
|
var DisplayMCQBadCount bool
|
||||||
|
|
||||||
type myTeamFile struct {
|
type myTeamFile struct {
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Checksum string `json:"checksum"`
|
Checksum string `json:"checksum"`
|
||||||
Size int64 `json:"size"`
|
Compressed bool `json:"compressed,omitempty"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
}
|
}
|
||||||
type myTeamHint struct {
|
type myTeamHint struct {
|
||||||
HintId int64 `json:"id"`
|
HintId int64 `json:"id"`
|
||||||
|
@ -178,10 +179,12 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
if t == nil || t.CanDownload(f) {
|
if t == nil || t.CanDownload(f) {
|
||||||
cksum := f.Checksum
|
cksum := f.Checksum
|
||||||
|
compressed := false
|
||||||
if len(f.ChecksumShown) > 0 {
|
if len(f.ChecksumShown) > 0 {
|
||||||
cksum = f.ChecksumShown
|
cksum = f.ChecksumShown
|
||||||
|
compressed = true
|
||||||
}
|
}
|
||||||
exercice.Files = append(exercice.Files, myTeamFile{path.Join(FilesDir, f.Path), f.Name, hex.EncodeToString(cksum), f.Size})
|
exercice.Files = append(exercice.Files, myTeamFile{path.Join(FilesDir, f.Path), f.Name, hex.EncodeToString(cksum), compressed, f.Size})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue