forked from UPC/ravada
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(frontend): get all fallback files for the package * wip(frontend): fallback for raphael fixed * wip(frontend): get original files for fallback * Also fix tell user to install agent for remote tests * wip(frontend); version badge issue UPC#993
- Loading branch information
1 parent
5e42138
commit efc16b5
Showing
11 changed files
with
121 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css morris.js/ | ||
https://use.fontawesome.com/releases/v5.10.1/fontawesome-free-5.10.1-web.zip | ||
https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.7.0/introjs.css intro.js/bin/ | ||
https://code.jquery.com/jquery-3.3.1.min.js jquery/ | ||
https://jqueryui.com/resources/download/jquery-ui-1.11.1.zip | ||
https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js | ||
https://code.angularjs.org/1.5.5/angular-1.5.5.zip | ||
https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/2.5.0/ui-bootstrap.min.js | ||
https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js raphael.js/ | ||
https://github.com/snapappointments/bootstrap-select/archive/v1.13.9.zip | ||
https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js morris.js/ | ||
https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.7.0/intro.js intro.js/ | ||
https://github.com/twbs/bootstrap/releases/download/v4.3.1/bootstrap-4.3.1-dist.zip | ||
https://www.upc.edu/content/assets/images/logoUPC.png ../img/logoUPC.png | ||
#../img/version-$version-brightbreen.svg wget https://img.shields.io/badge/version-$version-brightgreen.svg | ||
https://readthedocs.org/projects/ravada/badge/?version=latest ../img/latest.svg | ||
https://img.shields.io/badge/License-AGPL%20v3-blue.svg ../img/License-AGPL%20v3-blue.svg | ||
https://download.cksource.com/CKEditor/CKEditor/CKEditor%204.12.1/ckeditor_4.12.1_standard_easyimage.zip | ||
https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js angular-material/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/usr/bin/perl | ||
|
||
use warnings; | ||
use strict; | ||
|
||
use Cwd; | ||
use File::Path qw(make_path); | ||
use Mojo::UserAgent; | ||
|
||
use lib './lib'; | ||
use Ravada; | ||
|
||
my $VERSION = Ravada::version(); | ||
no warnings "experimental::signatures"; | ||
use feature qw(signatures); | ||
|
||
my $ua = Mojo::UserAgent->new; | ||
$ua->max_redirects(4); | ||
|
||
my $FILE_CONFIG = 'etc/fallback.conf'; | ||
my $DIR_FALLBACK = getcwd.'/public/fallback'; | ||
|
||
die "Error: missing fallback dir $DIR_FALLBACK" | ||
if ! -e $DIR_FALLBACK; | ||
|
||
sub download($url, $dst = $DIR_FALLBACK) { | ||
|
||
$dst = "$DIR_FALLBACK/$dst" if $dst !~ m{^/}; | ||
|
||
my ($path) = $dst =~ m{(.*)/}; | ||
make_path($path) if ! -e $path; | ||
|
||
if ( -d $dst ) { | ||
my ($filename) = $url =~ m{.*/(.*)}; | ||
$dst .= "/" if $dst !~ m{/$}; | ||
$dst .= $filename; | ||
} | ||
|
||
return $dst if -e $dst; | ||
|
||
print "get $url\n"; | ||
my $res = $ua->get($url)->result; | ||
if ($res->is_success) { | ||
print "$url downloaded to $dst\n"; | ||
$res->content->asset->move_to($dst); | ||
} | ||
elsif ($res->is_error) { print $res->message."\n" } | ||
elsif ($res->code == 301) { print $res->headers->location."\n" } | ||
else { print "Error ".$res->code." ".$res->message | ||
." downloading $url\n"} | ||
return $dst; | ||
} | ||
|
||
sub uncompress($file) { | ||
chdir $DIR_FALLBACK or die "$! $DIR_FALLBACK"; | ||
print `unzip -o $file`; | ||
} | ||
|
||
sub get_version_badge { | ||
return if $VERSION =~/alpha/; | ||
$VERSION =~ s/-/--/; | ||
download("https://img.shields.io/badge/version-$VERSION-brightgreen.svg" | ||
,"../img/version-$VERSION-brightgreen.svg"); | ||
exit; | ||
} | ||
|
||
############################################################################# | ||
|
||
get_version_badge(); | ||
|
||
open my $in,'<',$FILE_CONFIG or die "$! $FILE_CONFIG"; | ||
while (<$in>) { | ||
next if /^#/; | ||
my ($url, $dst) = split; | ||
my $file = download($url, $dst); | ||
uncompress($file) if $file =~ /\.zip$/; | ||
} | ||
close $in; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters