first commit
This commit is contained in:
parent
1492f2a23d
commit
e0581ff7f1
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
__*
|
||||||
|
env
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"python.pythonPath": "env/bin/python"
|
||||||
|
}
|
57
backend/Jsonfile.py
Normal file
57
backend/Jsonfile.py
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import json
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
|
import urllib.request
|
||||||
|
import os
|
||||||
|
|
||||||
|
class JSONfile:
|
||||||
|
|
||||||
|
def __init__(self,filename):
|
||||||
|
self.datafilepath=os.path.dirname(os.path.realpath(__file__))+"/"+filename
|
||||||
|
try:
|
||||||
|
with open(self.datafilepath, 'r', encoding='utf-8') as f:
|
||||||
|
self.data=json.load(f)
|
||||||
|
except FileNotFoundError:
|
||||||
|
self.parsechaine()
|
||||||
|
|
||||||
|
def get_chaine(self,number):
|
||||||
|
try:
|
||||||
|
return self.data[number]
|
||||||
|
except KeyError:
|
||||||
|
return "numero de chaine inconnue"
|
||||||
|
def parsechaine(self):
|
||||||
|
|
||||||
|
URL = 'https://fr.wikipedia.org/wiki/Liste_des_cha%C3%AEnes_de_Canal'
|
||||||
|
liste_chaine = {}
|
||||||
|
response = urllib.request.urlopen(URL)
|
||||||
|
html = response.read()
|
||||||
|
parse = BeautifulSoup(html,"html.parser")
|
||||||
|
for item in parse.find_all('table'):
|
||||||
|
if (item.get("class") == ['wikitable'] or item.get("class") == ['wikitable', 'sortable']):
|
||||||
|
for tr in item.find_all('tr'):
|
||||||
|
|
||||||
|
firstTD = tr.find()
|
||||||
|
num = firstTD.text
|
||||||
|
#print(num)
|
||||||
|
if RepresentsInt(num):
|
||||||
|
|
||||||
|
if RepresentsInt(firstTD.find_next().string):
|
||||||
|
#print(firstTD.find_next().find_next().text)
|
||||||
|
liste_chaine[str(int(num))] = firstTD.find_next().find_next().text
|
||||||
|
else:
|
||||||
|
#print(firstTD.find_next().string)
|
||||||
|
liste_chaine[str(int(num))] = firstTD.find_next().text
|
||||||
|
print(json.dumps(liste_chaine, indent=4))
|
||||||
|
self.data=liste_chaine
|
||||||
|
with open(self.datafilepath, 'w', encoding='utf-8') as f:
|
||||||
|
json.dump(liste_chaine, f, indent=4)
|
||||||
|
def __repr__(self):
|
||||||
|
return str(self.data)
|
||||||
|
|
||||||
|
def RepresentsInt(s):
|
||||||
|
try:
|
||||||
|
int(s)
|
||||||
|
return True
|
||||||
|
except ValueError:
|
||||||
|
return False
|
||||||
|
except TypeError:
|
||||||
|
return False
|
365
backend/chaine.json
Normal file
365
backend/chaine.json
Normal file
@ -0,0 +1,365 @@
|
|||||||
|
{
|
||||||
|
"0": "Accueil\n",
|
||||||
|
"1": "TF1\n",
|
||||||
|
"2": "France 2\n",
|
||||||
|
"3": "France 3\n",
|
||||||
|
"4": "Canal+\n",
|
||||||
|
"5": "France 5\n",
|
||||||
|
"6": "M6\n",
|
||||||
|
"7": "Arte\n",
|
||||||
|
"8": "\u00c0 la une\n",
|
||||||
|
"9": "Canal+\n",
|
||||||
|
"10": "Canal+ Cin\u00e9ma\n",
|
||||||
|
"11": "Canal+ Sport\n",
|
||||||
|
"12": "Canal+ S\u00e9ries\n",
|
||||||
|
"13": "Canal+ Family\n",
|
||||||
|
"14": "Canal+ D\u00e9cal\u00e9\n",
|
||||||
|
"15": "Canal \u00e0 la demande\n",
|
||||||
|
"16": "Canal VOD\n",
|
||||||
|
"17": "Canalplay\n",
|
||||||
|
"18": "4K UHD \u00c9v\u00e9nement\n",
|
||||||
|
"19": "\u00c9v\u00e9nement\n",
|
||||||
|
"20": "Cin\u00e9+ Premier\n",
|
||||||
|
"21": "Cin\u00e9+ Frisson\n",
|
||||||
|
"22": "Cin\u00e9+ \u00c9motion\n",
|
||||||
|
"23": "Cin\u00e9+ Famiz\n",
|
||||||
|
"24": "Cin\u00e9+ Club\n",
|
||||||
|
"25": "Cin\u00e9+ Classic\n",
|
||||||
|
"26": "OCS Max\n",
|
||||||
|
"27": "OCS City\n",
|
||||||
|
"28": "OCS Choc\n",
|
||||||
|
"29": "OCS G\u00e9ants\n",
|
||||||
|
"30": "Disney Cinema\n",
|
||||||
|
"31": "TCM Cin\u00e9ma\n",
|
||||||
|
"32": "Paramount Channel\n",
|
||||||
|
"33": "Action\n",
|
||||||
|
"34": "SundanceTV\n",
|
||||||
|
"38": "Fox Play\n",
|
||||||
|
"40": "Com\u00e9die+\n",
|
||||||
|
"41": "Polar+\n",
|
||||||
|
"42": "Warner TV\n",
|
||||||
|
"43": "S\u00e9rie Club\n",
|
||||||
|
"44": "MTV\n",
|
||||||
|
"45": "ELLE Girl TV\n",
|
||||||
|
"46": "Non Stop People\n",
|
||||||
|
"47": "Novelas TV\n",
|
||||||
|
"48": "MCM\n",
|
||||||
|
"49": "Game One\n",
|
||||||
|
"50": "J-One\n",
|
||||||
|
"51": "Mangas\n",
|
||||||
|
"52": "AB1\n",
|
||||||
|
"53": "TV Breizh\n",
|
||||||
|
"54": "T\u00e9va\n",
|
||||||
|
"55": "Paris Premi\u00e8re\n",
|
||||||
|
"56": "RTL9\n",
|
||||||
|
"57": "BET\n",
|
||||||
|
"58": "C8\n",
|
||||||
|
"59": "W9\n",
|
||||||
|
"60": "TMC\n",
|
||||||
|
"61": "TFX\n",
|
||||||
|
"62": "NRJ 12\n",
|
||||||
|
"63": "France 4\n",
|
||||||
|
"64": "CStar\n",
|
||||||
|
"65": "France \u00d4\n",
|
||||||
|
"66": "TF1 S\u00e9ries Films\n",
|
||||||
|
"67": "6ter\n",
|
||||||
|
"68": "RMC Story\n",
|
||||||
|
"69": "Ch\u00e9rie 25\n",
|
||||||
|
"71": "TV5 Monde\n",
|
||||||
|
"75": "myZen.tv\n",
|
||||||
|
"78": "M6 Boutique\n",
|
||||||
|
"79": "Astrocenter TV\n",
|
||||||
|
"80": "Plan\u00e8te+\n",
|
||||||
|
"81": "Plan\u00e8te+ Crime+Investigation\n",
|
||||||
|
"82": "Plan\u00e8te+ A&E\n",
|
||||||
|
"83": "Viceland\n",
|
||||||
|
"84": "Museum\n",
|
||||||
|
"85": "National Geographic\n",
|
||||||
|
"86": "National Geographic Wild\n",
|
||||||
|
"87": "Voyage\n",
|
||||||
|
"88": "Ushua\u00efa TV\n",
|
||||||
|
"89": "Histoire\n",
|
||||||
|
"90": "Toute l'Histoire\n",
|
||||||
|
"91": "Science et Vie TV\n",
|
||||||
|
"92": "Animaux\n",
|
||||||
|
"93": "Trek\n",
|
||||||
|
"94": "Seasons\n",
|
||||||
|
"95": "Chasse et P\u00eache\n",
|
||||||
|
"96": "MB Live TV\n",
|
||||||
|
"97": "8 Mont-Blanc\n",
|
||||||
|
"98": "RMC D\u00e9couverte\n",
|
||||||
|
"99": "Mes vid\u00e9os\n",
|
||||||
|
"100": "La Cha\u00eene M\u00e9t\u00e9o\n",
|
||||||
|
"101": "CNews\n",
|
||||||
|
"102": "BFM TV\n",
|
||||||
|
"103": "LCI\n",
|
||||||
|
"104": "France Info\n",
|
||||||
|
"105": "Euronews (version FR)\n",
|
||||||
|
"106": "France 24\n",
|
||||||
|
"107": "La Cha\u00eene parlementaire\n",
|
||||||
|
"108": "BFM Business\n",
|
||||||
|
"109": "Bloomberg TV\n",
|
||||||
|
"110": "CNN International\n",
|
||||||
|
"111": "BBC World News\n",
|
||||||
|
"112": "CNBC Europe\n",
|
||||||
|
"113": "i24 News\n",
|
||||||
|
"114": "KTO\n",
|
||||||
|
"120": "Infosport+\n",
|
||||||
|
"121": "Eurosport 1\n",
|
||||||
|
"122": "Eurosport 2\n",
|
||||||
|
"123": "Mosa\u00efque beIN Sports\n",
|
||||||
|
"124": "beIN Sports 1\n",
|
||||||
|
"125": "beIN Sports 2\n",
|
||||||
|
"126": "beIN Sports 3\n",
|
||||||
|
"127": "RMC Sport 1\n",
|
||||||
|
"128": "RMC Sport 2\n",
|
||||||
|
"129": "RMC Sport 3\n",
|
||||||
|
"130": "RMC Sport 4\n",
|
||||||
|
"131": "RMC Sport News\n",
|
||||||
|
"132": "Onz\u00e9o\n",
|
||||||
|
"133": "OL TV\n",
|
||||||
|
"134": "Automoto la cha\u00eene\n",
|
||||||
|
"135": "Equidia\n",
|
||||||
|
"136": "Golf+\n",
|
||||||
|
"137": "Extreme Sports Channel\n",
|
||||||
|
"138": "L'\u00c9quipe\n",
|
||||||
|
"150": "Disney Junior\n",
|
||||||
|
"151": "Piwi+\n",
|
||||||
|
"152": "Nickelodeon Junior\n",
|
||||||
|
"153": "Mon Nickelodeon Junior\n",
|
||||||
|
"154": "TiJi\n",
|
||||||
|
"155": "Boomerang\n",
|
||||||
|
"156": "Cartoon Network\n",
|
||||||
|
"157": "Nickelodeon\n",
|
||||||
|
"158": "Nickelodeon+1\n",
|
||||||
|
"159": "T\u00e9l\u00e9toon+\n",
|
||||||
|
"160": "T\u00e9l\u00e9toon+1\n",
|
||||||
|
"161": "Disney XD\n",
|
||||||
|
"162": "Canal J\n",
|
||||||
|
"163": "Boing\n",
|
||||||
|
"164": "Toonami\n",
|
||||||
|
"165": "Nickelodeon Teen\n",
|
||||||
|
"166": "Disney Channel\n",
|
||||||
|
"167": "Disney Channel +1\n",
|
||||||
|
"169": "Gulli\n",
|
||||||
|
"170": "Clique TV\n",
|
||||||
|
"171": "CStar Hits France\n",
|
||||||
|
"172": "MTV Hits\n",
|
||||||
|
"173": "myMTV\n",
|
||||||
|
"174": "M6 Music\n",
|
||||||
|
"175": "NRJ Hits\n",
|
||||||
|
"176": "Trace Urban\n",
|
||||||
|
"177": "MCM Top\n",
|
||||||
|
"178": "RFM TV\n",
|
||||||
|
"179": "Melody\n",
|
||||||
|
"180": "Deutsche Grammophon+\n",
|
||||||
|
"181": "Mezzo\n",
|
||||||
|
"182": "Mezzo Live HD\n",
|
||||||
|
"183": "Stingray Brava\n",
|
||||||
|
"184": "Stingray Djazz\n",
|
||||||
|
"199": "Mosa\u00efque des radios\n",
|
||||||
|
"209": "Le Porn\n",
|
||||||
|
"210": "Pass XXL-Dorcel\n",
|
||||||
|
"211": "XXL\n",
|
||||||
|
"212": "Dorcel TV\n",
|
||||||
|
"213": "Dorcel XXX\n",
|
||||||
|
"214": "Libido TV\n",
|
||||||
|
"215": "Penthouse HD\n",
|
||||||
|
"216": "Penthouse Black\n",
|
||||||
|
"217": "Colmax TV\n",
|
||||||
|
"218": "Pink X\n",
|
||||||
|
"219": "Man-X\n",
|
||||||
|
"220": "Pass Pink X\n",
|
||||||
|
"250": "Multisports\n",
|
||||||
|
"251": "Foot+ 24/24\n",
|
||||||
|
"252": "Golf+\n",
|
||||||
|
"253": "Multisports 1\n",
|
||||||
|
"254": "Multisports 2\n",
|
||||||
|
"255": "Multisports 3\n",
|
||||||
|
"256": "Multisports 4\n",
|
||||||
|
"257": "Multisports 5\n",
|
||||||
|
"258": "Multisports 6\n",
|
||||||
|
"260": "Eurosport 360\u00b0 1\n",
|
||||||
|
"261": "Eurosport 360\u00b0 2\n",
|
||||||
|
"262": "Eurosport 360\u00b0 3\n",
|
||||||
|
"263": "Eurosport 360\u00b0 4\n",
|
||||||
|
"264": "Eurosport 360\u00b0 5\n",
|
||||||
|
"265": "Eurosport 360\u00b0 6\n",
|
||||||
|
"266": "Eurosport 360\u00b0 7\n",
|
||||||
|
"267": "Eurosport 360\u00b0 8\n",
|
||||||
|
"268": "beIN Sports Max 4\n",
|
||||||
|
"269": "beIN Sports Max 5\n",
|
||||||
|
"270": "beIN Sports Max 6\n",
|
||||||
|
"271": "beIN Sports Max 7\n",
|
||||||
|
"272": "beIN Sports Max 8\n",
|
||||||
|
"273": "beIN Sports Max 9\n",
|
||||||
|
"274": "beIN Sports Max 10\n",
|
||||||
|
"275": "RMC Sport Live 5\n",
|
||||||
|
"276": "RMC Sport Live 6\n",
|
||||||
|
"277": "RMC Sport Live 7\n",
|
||||||
|
"278": "RMC Sport Live 8\n",
|
||||||
|
"279": "RMC Sport Live 9\n",
|
||||||
|
"280": "RMC Sport Live 10\n",
|
||||||
|
"281": "RMC Sport Live 11\n",
|
||||||
|
"282": "RMC Sport Live 12\n",
|
||||||
|
"283": "RMC Sport Live 13\n",
|
||||||
|
"284": "RMC Sport Live 14\n",
|
||||||
|
"285": "RMC Sport Live 15\n",
|
||||||
|
"286": "RMC Sport Live 16\n",
|
||||||
|
"291": "Canalplay\n",
|
||||||
|
"292": "Canal VOD\n",
|
||||||
|
"294": "6play M6\n",
|
||||||
|
"301": "TF1\n",
|
||||||
|
"302": "France 2\n",
|
||||||
|
"303": "France 3 National\n",
|
||||||
|
"304": "Canal+\n",
|
||||||
|
"305": "France 5\n",
|
||||||
|
"306": "M6\n",
|
||||||
|
"307": "Arte\n",
|
||||||
|
"308": "C8\n",
|
||||||
|
"309": "W9\n",
|
||||||
|
"310": "TMC\n",
|
||||||
|
"311": "TFX\n",
|
||||||
|
"312": "NRJ 12\n",
|
||||||
|
"313": "La Cha\u00eene parlementaire\n",
|
||||||
|
"314": "France 4\n",
|
||||||
|
"315": "BFM TV\n",
|
||||||
|
"316": "CNews\n",
|
||||||
|
"317": "CStar\n",
|
||||||
|
"318": "Gulli\n",
|
||||||
|
"319": "France \u00d4\n",
|
||||||
|
"320": "TF1 S\u00e9ries Films\n",
|
||||||
|
"321": "La cha\u00eene L'\u00c9quipe \n",
|
||||||
|
"322": "6ter\n",
|
||||||
|
"323": "RMC Story\n",
|
||||||
|
"324": "RMC D\u00e9couverte\n",
|
||||||
|
"325": "Ch\u00e9rie 25\n",
|
||||||
|
"326": "LCI\n",
|
||||||
|
"327": "France Info\n",
|
||||||
|
"350": "France 3 Alpes\n",
|
||||||
|
"351": "France 3 Alsace\n",
|
||||||
|
"352": "France 3 Aquitaine\n",
|
||||||
|
"353": "France 3 Auvergne\n",
|
||||||
|
"354": "France 3 Basse-Normandie\n",
|
||||||
|
"355": "France 3 Bourgogne\n",
|
||||||
|
"356": "France 3 Bretagne\n",
|
||||||
|
"357": "France 3 Centre-Val de Loire\n",
|
||||||
|
"358": "France 3 Champagne-Ardenne\n",
|
||||||
|
"359": "France 3 Corse\n",
|
||||||
|
"360": "France 3 C\u00f4te d'Azur\n",
|
||||||
|
"361": "France 3 Franche-Comt\u00e9\n",
|
||||||
|
"362": "France 3 Haute-Normandie\n",
|
||||||
|
"363": "France 3 Languedoc-Roussillon\n",
|
||||||
|
"364": "France 3 Limousin\n",
|
||||||
|
"365": "France 3 Lorraine\n",
|
||||||
|
"366": "France 3 Midi-Pyr\u00e9n\u00e9es\n",
|
||||||
|
"367": "France 3 Nord-Pas-de-Calais\n",
|
||||||
|
"368": "France 3 Paris \u00cele-de-France\n",
|
||||||
|
"369": "France 3 Pays de la Loire\n",
|
||||||
|
"370": "France 3 Picardie\n",
|
||||||
|
"371": "France 3 Poitou-Charentes\n",
|
||||||
|
"372": "France 3 Provence-Alpes\n",
|
||||||
|
"373": "France 3 Rh\u00f4ne-Alpes\n",
|
||||||
|
"400": "Al Jazeera\n",
|
||||||
|
"401": "France 24 Arabic\n",
|
||||||
|
"402": "2M Monde\n",
|
||||||
|
"403": "Canal Alg\u00e9rie\n",
|
||||||
|
"404": "A3\n",
|
||||||
|
"405": "Tunisie 1\n",
|
||||||
|
"407": "France 24 English\n",
|
||||||
|
"409": "Sky News International\n",
|
||||||
|
"414": "RTP Internacional\n",
|
||||||
|
"415": "Record Internacional\n",
|
||||||
|
"416": "Tele Sur\n",
|
||||||
|
"418": "TVE International\n",
|
||||||
|
"419": "Canal 24 horas\n",
|
||||||
|
"420": "Andaluc\u00eda TV\n",
|
||||||
|
"421": "Televisi\u00f3n de Galicia\n",
|
||||||
|
"422": "Cubavisi\u00f3n Internacional\n",
|
||||||
|
"426": "DW-TV\n",
|
||||||
|
"427": "RTL Television\n",
|
||||||
|
"428": "RTL II\n",
|
||||||
|
"429": "Super RTL\n",
|
||||||
|
"430": "Das Erste\n",
|
||||||
|
"431": "tagesschau24\n",
|
||||||
|
"433": "One\n",
|
||||||
|
"434": "BR Fernsehen\n",
|
||||||
|
"435": "ARD-alpha\n",
|
||||||
|
"436": "RBB Berlin\n",
|
||||||
|
"437": "HR-Fernsehen\n",
|
||||||
|
"438": "MDR Fernsehen\n",
|
||||||
|
"439": "NDR Fernsehen\n",
|
||||||
|
"440": "RBB Brandenburg\n",
|
||||||
|
"441": "Phoenix\n",
|
||||||
|
"442": "SR Fernsehen\n",
|
||||||
|
"443": "WDR Fernsehen\n",
|
||||||
|
"444": "3sat\n",
|
||||||
|
"445": "KiKA\n",
|
||||||
|
"446": "Arte Allemagne\n",
|
||||||
|
"447": "Euronews (version DE)\n",
|
||||||
|
"448": "ZDFinfo\n",
|
||||||
|
"450": "ZDFneo\n",
|
||||||
|
"451": "Sport1\n",
|
||||||
|
"452": "Kabel eins\n",
|
||||||
|
"453": "Sat.1 Gold\n",
|
||||||
|
"454": "Welt\n",
|
||||||
|
"455": "Sat.1\n",
|
||||||
|
"456": "ProSieben\n",
|
||||||
|
"457": "VOX\n",
|
||||||
|
"458": "n-tv\n",
|
||||||
|
"459": "Tele 5\n",
|
||||||
|
"460": "Sonnenklar.TV\n",
|
||||||
|
"461": "Comedy Central\n",
|
||||||
|
"463": "Sonlife\n",
|
||||||
|
"464": "God TV\n",
|
||||||
|
"466": "EWTN\n",
|
||||||
|
"467": "TV Trwam\n",
|
||||||
|
"469": "CGTN Documentary\n",
|
||||||
|
"470": "CGTN\n",
|
||||||
|
"471": "CGTN fran\u00e7ais\n",
|
||||||
|
"472": "Arirang TV\n",
|
||||||
|
"473": "NHK World\n",
|
||||||
|
"475": "TRT T\u00fcrk\n",
|
||||||
|
"476": "TRT World\n",
|
||||||
|
"600": "France Culture\n",
|
||||||
|
"601": "France Musique\n",
|
||||||
|
"602": "FIP\n",
|
||||||
|
"603": "France Info\n",
|
||||||
|
"604": "France Inter\n",
|
||||||
|
"605": "France Bleu\n",
|
||||||
|
"606": "Mouv'\n",
|
||||||
|
"608": "RFI\n",
|
||||||
|
"610": "Europe 1\n",
|
||||||
|
"611": "Virgin Radio\n",
|
||||||
|
"612": "RFM\n",
|
||||||
|
"613": "RTL\n",
|
||||||
|
"614": "RTL2\n",
|
||||||
|
"615": "Fun Radio\n",
|
||||||
|
"616": "NRJ\n",
|
||||||
|
"617": "Ch\u00e9rie\n",
|
||||||
|
"618": "Rire & Chansons\n",
|
||||||
|
"619": "Nostalgie\n",
|
||||||
|
"620": "RMC\n",
|
||||||
|
"621": "BFM Business\n",
|
||||||
|
"622": "Sud Radio\n",
|
||||||
|
"623": "TSF Jazz\n",
|
||||||
|
"624": "Radio Nova\n",
|
||||||
|
"625": "Radio FG\n",
|
||||||
|
"627": "Contact FM\n",
|
||||||
|
"629": "Jazz Radio\n",
|
||||||
|
"630": "Skyrock\n",
|
||||||
|
"631": "Radio Classique\n",
|
||||||
|
"633": "O\u00dcI FM\n",
|
||||||
|
"635": "Radio Notre-Dame\n",
|
||||||
|
"638": "Beur FM\n",
|
||||||
|
"639": "BBC World Service\n",
|
||||||
|
"640": "BBC Arabic\n",
|
||||||
|
"490": "Espace client\n",
|
||||||
|
"777": "Num\u00e9rotations\n",
|
||||||
|
"888": "Cha\u00eene de droits\n",
|
||||||
|
"922": "Info Technique\n",
|
||||||
|
"944": "Association Mat\u00e9riel\n",
|
||||||
|
"998": "Nouveaut\u00e9s\n",
|
||||||
|
"999": "Mosa\u00efque\n",
|
||||||
|
"2019": "n.c\n"
|
||||||
|
}
|
18
backend/requirements.txt
Normal file
18
backend/requirements.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
astroid==2.2.5
|
||||||
|
beautifulsoup4==4.7.1
|
||||||
|
bs4==0.0.1
|
||||||
|
Click==7.0
|
||||||
|
Flask==1.0.2
|
||||||
|
Flask-Cors==3.0.7
|
||||||
|
isort==4.3.17
|
||||||
|
itsdangerous==1.1.0
|
||||||
|
Jinja2==2.10.1
|
||||||
|
lazy-object-proxy==1.3.1
|
||||||
|
MarkupSafe==1.1.1
|
||||||
|
mccabe==0.6.1
|
||||||
|
pylint==2.3.1
|
||||||
|
six==1.12.0
|
||||||
|
soupsieve==1.9.1
|
||||||
|
typed-ast==1.3.4
|
||||||
|
Werkzeug==0.15.2
|
||||||
|
wrapt==1.11.1
|
35
backend/run.py
Normal file
35
backend/run.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
from flask import Flask,request,make_response,redirect,url_for,render_template,jsonify
|
||||||
|
from flask_cors import CORS
|
||||||
|
import Jsonfile
|
||||||
|
data= Jsonfile.JSONfile("chaine.json")
|
||||||
|
app=Flask(__name__,static_folder = "../dist/static",template_folder="../dist")
|
||||||
|
|
||||||
|
CORS(app)
|
||||||
|
@app.route('/')
|
||||||
|
|
||||||
|
def index(path="index.html"):
|
||||||
|
print(path)
|
||||||
|
return render_template(path)
|
||||||
|
|
||||||
|
@app.route('/ping', methods=['GET'])
|
||||||
|
def ping_pong():
|
||||||
|
return jsonify('pong!')
|
||||||
|
|
||||||
|
@app.route('/api/v1/chaine/<num>', methods=['GET'])
|
||||||
|
def get_chaine(num):
|
||||||
|
return jsonify(data.get_chaine(num))
|
||||||
|
|
||||||
|
@app.route('/api/v1/chaine/', methods=['put'])
|
||||||
|
def update_list():
|
||||||
|
data.parsechaine()
|
||||||
|
return "OK"
|
||||||
|
|
||||||
|
##@app.errorhandler(404)
|
||||||
|
##def ma_page_404(error):
|
||||||
|
## return redirect("https://www.ducamps.win/404/404.html", 307)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(debug=True)
|
12
client/.babelrc
Normal file
12
client/.babelrc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
["env", {
|
||||||
|
"modules": false,
|
||||||
|
"targets": {
|
||||||
|
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
"stage-2"
|
||||||
|
],
|
||||||
|
"plugins": ["transform-vue-jsx", "transform-runtime"]
|
||||||
|
}
|
9
client/.editorconfig
Normal file
9
client/.editorconfig
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
4
client/.eslintignore
Normal file
4
client/.eslintignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/build/
|
||||||
|
/config/
|
||||||
|
/dist/
|
||||||
|
/*.js
|
50
client/.eslintrc.js
Normal file
50
client/.eslintrc.js
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// https://eslint.org/docs/user-guide/configuring
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
parserOptions: {
|
||||||
|
parser: 'babel-eslint'
|
||||||
|
},
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
},
|
||||||
|
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
|
||||||
|
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
|
||||||
|
extends: ['plugin:vue/essential', 'airbnb-base'],
|
||||||
|
// required to lint *.vue files
|
||||||
|
plugins: [
|
||||||
|
'vue'
|
||||||
|
],
|
||||||
|
// check if imports actually resolve
|
||||||
|
settings: {
|
||||||
|
'import/resolver': {
|
||||||
|
webpack: {
|
||||||
|
config: 'build/webpack.base.conf.js'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// add your custom rules here
|
||||||
|
rules: {
|
||||||
|
// don't require .vue extension when importing
|
||||||
|
'import/extensions': ['error', 'always', {
|
||||||
|
js: 'never',
|
||||||
|
vue: 'never'
|
||||||
|
}],
|
||||||
|
// disallow reassignment of function parameters
|
||||||
|
// disallow parameter object manipulation except for specific exclusions
|
||||||
|
'no-param-reassign': ['error', {
|
||||||
|
props: true,
|
||||||
|
ignorePropertyModificationsFor: [
|
||||||
|
'state', // for vuex state
|
||||||
|
'acc', // for reduce accumulators
|
||||||
|
'e' // for e.returnvalue
|
||||||
|
]
|
||||||
|
}],
|
||||||
|
// allow optionalDependencies
|
||||||
|
'import/no-extraneous-dependencies': ['error', {
|
||||||
|
optionalDependencies: ['test/unit/index.js']
|
||||||
|
}],
|
||||||
|
// allow debugger during development
|
||||||
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||||
|
}
|
||||||
|
}
|
14
client/.gitignore
vendored
Normal file
14
client/.gitignore
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules/
|
||||||
|
/dist/
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
10
client/.postcssrc.js
Normal file
10
client/.postcssrc.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
"plugins": {
|
||||||
|
"postcss-import": {},
|
||||||
|
"postcss-url": {},
|
||||||
|
// to edit target browsers: use "browserslist" field in package.json
|
||||||
|
"autoprefixer": {}
|
||||||
|
}
|
||||||
|
}
|
21
client/README.md
Normal file
21
client/README.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# client
|
||||||
|
|
||||||
|
> A Vue.js project
|
||||||
|
|
||||||
|
## Build Setup
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
# install dependencies
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# serve with hot reload at localhost:8080
|
||||||
|
npm run dev
|
||||||
|
|
||||||
|
# build for production with minification
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# build for production and view the bundle analyzer report
|
||||||
|
npm run build --report
|
||||||
|
```
|
||||||
|
|
||||||
|
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
41
client/build/build.js
Normal file
41
client/build/build.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
'use strict'
|
||||||
|
require('./check-versions')()
|
||||||
|
|
||||||
|
process.env.NODE_ENV = 'production'
|
||||||
|
|
||||||
|
const ora = require('ora')
|
||||||
|
const rm = require('rimraf')
|
||||||
|
const path = require('path')
|
||||||
|
const chalk = require('chalk')
|
||||||
|
const webpack = require('webpack')
|
||||||
|
const config = require('../config')
|
||||||
|
const webpackConfig = require('./webpack.prod.conf')
|
||||||
|
|
||||||
|
const spinner = ora('building for production...')
|
||||||
|
spinner.start()
|
||||||
|
|
||||||
|
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||||
|
if (err) throw err
|
||||||
|
webpack(webpackConfig, (err, stats) => {
|
||||||
|
spinner.stop()
|
||||||
|
if (err) throw err
|
||||||
|
process.stdout.write(stats.toString({
|
||||||
|
colors: true,
|
||||||
|
modules: false,
|
||||||
|
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
|
||||||
|
chunks: false,
|
||||||
|
chunkModules: false
|
||||||
|
}) + '\n\n')
|
||||||
|
|
||||||
|
if (stats.hasErrors()) {
|
||||||
|
console.log(chalk.red(' Build failed with errors.\n'))
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(chalk.cyan(' Build complete.\n'))
|
||||||
|
console.log(chalk.yellow(
|
||||||
|
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||||
|
' Opening index.html over file:// won\'t work.\n'
|
||||||
|
))
|
||||||
|
})
|
||||||
|
})
|
54
client/build/check-versions.js
Normal file
54
client/build/check-versions.js
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
'use strict'
|
||||||
|
const chalk = require('chalk')
|
||||||
|
const semver = require('semver')
|
||||||
|
const packageConfig = require('../package.json')
|
||||||
|
const shell = require('shelljs')
|
||||||
|
|
||||||
|
function exec (cmd) {
|
||||||
|
return require('child_process').execSync(cmd).toString().trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
const versionRequirements = [
|
||||||
|
{
|
||||||
|
name: 'node',
|
||||||
|
currentVersion: semver.clean(process.version),
|
||||||
|
versionRequirement: packageConfig.engines.node
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
if (shell.which('npm')) {
|
||||||
|
versionRequirements.push({
|
||||||
|
name: 'npm',
|
||||||
|
currentVersion: exec('npm --version'),
|
||||||
|
versionRequirement: packageConfig.engines.npm
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function () {
|
||||||
|
const warnings = []
|
||||||
|
|
||||||
|
for (let i = 0; i < versionRequirements.length; i++) {
|
||||||
|
const mod = versionRequirements[i]
|
||||||
|
|
||||||
|
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||||
|
warnings.push(mod.name + ': ' +
|
||||||
|
chalk.red(mod.currentVersion) + ' should be ' +
|
||||||
|
chalk.green(mod.versionRequirement)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (warnings.length) {
|
||||||
|
console.log('')
|
||||||
|
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
||||||
|
console.log()
|
||||||
|
|
||||||
|
for (let i = 0; i < warnings.length; i++) {
|
||||||
|
const warning = warnings[i]
|
||||||
|
console.log(' ' + warning)
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log()
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
}
|
BIN
client/build/logo.png
Normal file
BIN
client/build/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
101
client/build/utils.js
Normal file
101
client/build/utils.js
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
'use strict'
|
||||||
|
const path = require('path')
|
||||||
|
const config = require('../config')
|
||||||
|
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||||
|
const packageConfig = require('../package.json')
|
||||||
|
|
||||||
|
exports.assetsPath = function (_path) {
|
||||||
|
const assetsSubDirectory = process.env.NODE_ENV === 'production'
|
||||||
|
? config.build.assetsSubDirectory
|
||||||
|
: config.dev.assetsSubDirectory
|
||||||
|
|
||||||
|
return path.posix.join(assetsSubDirectory, _path)
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.cssLoaders = function (options) {
|
||||||
|
options = options || {}
|
||||||
|
|
||||||
|
const cssLoader = {
|
||||||
|
loader: 'css-loader',
|
||||||
|
options: {
|
||||||
|
sourceMap: options.sourceMap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const postcssLoader = {
|
||||||
|
loader: 'postcss-loader',
|
||||||
|
options: {
|
||||||
|
sourceMap: options.sourceMap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// generate loader string to be used with extract text plugin
|
||||||
|
function generateLoaders (loader, loaderOptions) {
|
||||||
|
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
|
||||||
|
|
||||||
|
if (loader) {
|
||||||
|
loaders.push({
|
||||||
|
loader: loader + '-loader',
|
||||||
|
options: Object.assign({}, loaderOptions, {
|
||||||
|
sourceMap: options.sourceMap
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract CSS when that option is specified
|
||||||
|
// (which is the case during production build)
|
||||||
|
if (options.extract) {
|
||||||
|
return ExtractTextPlugin.extract({
|
||||||
|
use: loaders,
|
||||||
|
fallback: 'vue-style-loader'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return ['vue-style-loader'].concat(loaders)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
||||||
|
return {
|
||||||
|
css: generateLoaders(),
|
||||||
|
postcss: generateLoaders(),
|
||||||
|
less: generateLoaders('less'),
|
||||||
|
sass: generateLoaders('sass', { indentedSyntax: true }),
|
||||||
|
scss: generateLoaders('sass'),
|
||||||
|
stylus: generateLoaders('stylus'),
|
||||||
|
styl: generateLoaders('stylus')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate loaders for standalone style files (outside of .vue)
|
||||||
|
exports.styleLoaders = function (options) {
|
||||||
|
const output = []
|
||||||
|
const loaders = exports.cssLoaders(options)
|
||||||
|
|
||||||
|
for (const extension in loaders) {
|
||||||
|
const loader = loaders[extension]
|
||||||
|
output.push({
|
||||||
|
test: new RegExp('\\.' + extension + '$'),
|
||||||
|
use: loader
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.createNotifierCallback = () => {
|
||||||
|
const notifier = require('node-notifier')
|
||||||
|
|
||||||
|
return (severity, errors) => {
|
||||||
|
if (severity !== 'error') return
|
||||||
|
|
||||||
|
const error = errors[0]
|
||||||
|
const filename = error.file && error.file.split('!').pop()
|
||||||
|
|
||||||
|
notifier.notify({
|
||||||
|
title: packageConfig.name,
|
||||||
|
message: severity + ': ' + error.name,
|
||||||
|
subtitle: filename || '',
|
||||||
|
icon: path.join(__dirname, 'logo.png')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
22
client/build/vue-loader.conf.js
Normal file
22
client/build/vue-loader.conf.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
'use strict'
|
||||||
|
const utils = require('./utils')
|
||||||
|
const config = require('../config')
|
||||||
|
const isProduction = process.env.NODE_ENV === 'production'
|
||||||
|
const sourceMapEnabled = isProduction
|
||||||
|
? config.build.productionSourceMap
|
||||||
|
: config.dev.cssSourceMap
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
loaders: utils.cssLoaders({
|
||||||
|
sourceMap: sourceMapEnabled,
|
||||||
|
extract: isProduction
|
||||||
|
}),
|
||||||
|
cssSourceMap: sourceMapEnabled,
|
||||||
|
cacheBusting: config.dev.cacheBusting,
|
||||||
|
transformToRequire: {
|
||||||
|
video: ['src', 'poster'],
|
||||||
|
source: 'src',
|
||||||
|
img: 'src',
|
||||||
|
image: 'xlink:href'
|
||||||
|
}
|
||||||
|
}
|
92
client/build/webpack.base.conf.js
Normal file
92
client/build/webpack.base.conf.js
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
'use strict'
|
||||||
|
const path = require('path')
|
||||||
|
const utils = require('./utils')
|
||||||
|
const config = require('../config')
|
||||||
|
const vueLoaderConfig = require('./vue-loader.conf')
|
||||||
|
|
||||||
|
function resolve (dir) {
|
||||||
|
return path.join(__dirname, '..', dir)
|
||||||
|
}
|
||||||
|
|
||||||
|
const createLintingRule = () => ({
|
||||||
|
test: /\.(js|vue)$/,
|
||||||
|
loader: 'eslint-loader',
|
||||||
|
enforce: 'pre',
|
||||||
|
include: [resolve('src'), resolve('test')],
|
||||||
|
options: {
|
||||||
|
formatter: require('eslint-friendly-formatter'),
|
||||||
|
emitWarning: !config.dev.showEslintErrorsInOverlay
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
context: path.resolve(__dirname, '../'),
|
||||||
|
entry: {
|
||||||
|
app: './src/main.js'
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
path: config.build.assetsRoot,
|
||||||
|
filename: '[name].js',
|
||||||
|
publicPath: process.env.NODE_ENV === 'production'
|
||||||
|
? config.build.assetsPublicPath
|
||||||
|
: config.dev.assetsPublicPath
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.js', '.vue', '.json'],
|
||||||
|
alias: {
|
||||||
|
'vue$': 'vue/dist/vue.esm.js',
|
||||||
|
'@': resolve('src'),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
...(config.dev.useEslint ? [createLintingRule()] : []),
|
||||||
|
{
|
||||||
|
test: /\.vue$/,
|
||||||
|
loader: 'vue-loader',
|
||||||
|
options: vueLoaderConfig
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
loader: 'babel-loader',
|
||||||
|
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||||
|
loader: 'url-loader',
|
||||||
|
options: {
|
||||||
|
limit: 10000,
|
||||||
|
name: utils.assetsPath('img/[name].[hash:7].[ext]')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||||
|
loader: 'url-loader',
|
||||||
|
options: {
|
||||||
|
limit: 10000,
|
||||||
|
name: utils.assetsPath('media/[name].[hash:7].[ext]')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||||
|
loader: 'url-loader',
|
||||||
|
options: {
|
||||||
|
limit: 10000,
|
||||||
|
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
node: {
|
||||||
|
// prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||||
|
// source contains it (although only uses it if it's native).
|
||||||
|
setImmediate: false,
|
||||||
|
// prevent webpack from injecting mocks to Node native modules
|
||||||
|
// that does not make sense for the client
|
||||||
|
dgram: 'empty',
|
||||||
|
fs: 'empty',
|
||||||
|
net: 'empty',
|
||||||
|
tls: 'empty',
|
||||||
|
child_process: 'empty'
|
||||||
|
}
|
||||||
|
}
|
95
client/build/webpack.dev.conf.js
Executable file
95
client/build/webpack.dev.conf.js
Executable file
@ -0,0 +1,95 @@
|
|||||||
|
'use strict'
|
||||||
|
const utils = require('./utils')
|
||||||
|
const webpack = require('webpack')
|
||||||
|
const config = require('../config')
|
||||||
|
const merge = require('webpack-merge')
|
||||||
|
const path = require('path')
|
||||||
|
const baseWebpackConfig = require('./webpack.base.conf')
|
||||||
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||||
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
|
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||||
|
const portfinder = require('portfinder')
|
||||||
|
|
||||||
|
const HOST = process.env.HOST
|
||||||
|
const PORT = process.env.PORT && Number(process.env.PORT)
|
||||||
|
|
||||||
|
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||||
|
module: {
|
||||||
|
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||||
|
},
|
||||||
|
// cheap-module-eval-source-map is faster for development
|
||||||
|
devtool: config.dev.devtool,
|
||||||
|
|
||||||
|
// these devServer options should be customized in /config/index.js
|
||||||
|
devServer: {
|
||||||
|
clientLogLevel: 'warning',
|
||||||
|
historyApiFallback: {
|
||||||
|
rewrites: [
|
||||||
|
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
hot: true,
|
||||||
|
contentBase: false, // since we use CopyWebpackPlugin.
|
||||||
|
compress: true,
|
||||||
|
host: HOST || config.dev.host,
|
||||||
|
port: PORT || config.dev.port,
|
||||||
|
open: config.dev.autoOpenBrowser,
|
||||||
|
overlay: config.dev.errorOverlay
|
||||||
|
? { warnings: false, errors: true }
|
||||||
|
: false,
|
||||||
|
publicPath: config.dev.assetsPublicPath,
|
||||||
|
proxy: config.dev.proxyTable,
|
||||||
|
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||||
|
watchOptions: {
|
||||||
|
poll: config.dev.poll,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env': require('../config/dev.env')
|
||||||
|
}),
|
||||||
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
|
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||||
|
new webpack.NoEmitOnErrorsPlugin(),
|
||||||
|
// https://github.com/ampedandwired/html-webpack-plugin
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
filename: 'index.html',
|
||||||
|
template: 'index.html',
|
||||||
|
inject: true
|
||||||
|
}),
|
||||||
|
// copy custom static assets
|
||||||
|
new CopyWebpackPlugin([
|
||||||
|
{
|
||||||
|
from: path.resolve(__dirname, '../static'),
|
||||||
|
to: config.dev.assetsSubDirectory,
|
||||||
|
ignore: ['.*']
|
||||||
|
}
|
||||||
|
])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
module.exports = new Promise((resolve, reject) => {
|
||||||
|
portfinder.basePort = process.env.PORT || config.dev.port
|
||||||
|
portfinder.getPort((err, port) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err)
|
||||||
|
} else {
|
||||||
|
// publish the new Port, necessary for e2e tests
|
||||||
|
process.env.PORT = port
|
||||||
|
// add port to devServer config
|
||||||
|
devWebpackConfig.devServer.port = port
|
||||||
|
|
||||||
|
// Add FriendlyErrorsPlugin
|
||||||
|
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||||
|
compilationSuccessInfo: {
|
||||||
|
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||||
|
},
|
||||||
|
onErrors: config.dev.notifyOnErrors
|
||||||
|
? utils.createNotifierCallback()
|
||||||
|
: undefined
|
||||||
|
}))
|
||||||
|
|
||||||
|
resolve(devWebpackConfig)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
145
client/build/webpack.prod.conf.js
Normal file
145
client/build/webpack.prod.conf.js
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
'use strict'
|
||||||
|
const path = require('path')
|
||||||
|
const utils = require('./utils')
|
||||||
|
const webpack = require('webpack')
|
||||||
|
const config = require('../config')
|
||||||
|
const merge = require('webpack-merge')
|
||||||
|
const baseWebpackConfig = require('./webpack.base.conf')
|
||||||
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||||
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
|
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||||
|
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
|
||||||
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||||
|
|
||||||
|
const env = require('../config/prod.env')
|
||||||
|
|
||||||
|
const webpackConfig = merge(baseWebpackConfig, {
|
||||||
|
module: {
|
||||||
|
rules: utils.styleLoaders({
|
||||||
|
sourceMap: config.build.productionSourceMap,
|
||||||
|
extract: true,
|
||||||
|
usePostCSS: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||||
|
output: {
|
||||||
|
path: config.build.assetsRoot,
|
||||||
|
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||||
|
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env': env
|
||||||
|
}),
|
||||||
|
new UglifyJsPlugin({
|
||||||
|
uglifyOptions: {
|
||||||
|
compress: {
|
||||||
|
warnings: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sourceMap: config.build.productionSourceMap,
|
||||||
|
parallel: true
|
||||||
|
}),
|
||||||
|
// extract css into its own file
|
||||||
|
new ExtractTextPlugin({
|
||||||
|
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||||
|
// Setting the following option to `false` will not extract CSS from codesplit chunks.
|
||||||
|
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
|
||||||
|
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
|
||||||
|
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
|
||||||
|
allChunks: true,
|
||||||
|
}),
|
||||||
|
// Compress extracted CSS. We are using this plugin so that possible
|
||||||
|
// duplicated CSS from different components can be deduped.
|
||||||
|
new OptimizeCSSPlugin({
|
||||||
|
cssProcessorOptions: config.build.productionSourceMap
|
||||||
|
? { safe: true, map: { inline: false } }
|
||||||
|
: { safe: true }
|
||||||
|
}),
|
||||||
|
// generate dist index.html with correct asset hash for caching.
|
||||||
|
// you can customize output by editing /index.html
|
||||||
|
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
filename: config.build.index,
|
||||||
|
template: 'index.html',
|
||||||
|
inject: true,
|
||||||
|
minify: {
|
||||||
|
removeComments: true,
|
||||||
|
collapseWhitespace: true,
|
||||||
|
removeAttributeQuotes: true
|
||||||
|
// more options:
|
||||||
|
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||||
|
},
|
||||||
|
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||||
|
chunksSortMode: 'dependency'
|
||||||
|
}),
|
||||||
|
// keep module.id stable when vendor modules does not change
|
||||||
|
new webpack.HashedModuleIdsPlugin(),
|
||||||
|
// enable scope hoisting
|
||||||
|
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||||
|
// split vendor js into its own file
|
||||||
|
new webpack.optimize.CommonsChunkPlugin({
|
||||||
|
name: 'vendor',
|
||||||
|
minChunks (module) {
|
||||||
|
// any required modules inside node_modules are extracted to vendor
|
||||||
|
return (
|
||||||
|
module.resource &&
|
||||||
|
/\.js$/.test(module.resource) &&
|
||||||
|
module.resource.indexOf(
|
||||||
|
path.join(__dirname, '../node_modules')
|
||||||
|
) === 0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
// extract webpack runtime and module manifest to its own file in order to
|
||||||
|
// prevent vendor hash from being updated whenever app bundle is updated
|
||||||
|
new webpack.optimize.CommonsChunkPlugin({
|
||||||
|
name: 'manifest',
|
||||||
|
minChunks: Infinity
|
||||||
|
}),
|
||||||
|
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||||
|
// in a separate chunk, similar to the vendor chunk
|
||||||
|
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||||
|
new webpack.optimize.CommonsChunkPlugin({
|
||||||
|
name: 'app',
|
||||||
|
async: 'vendor-async',
|
||||||
|
children: true,
|
||||||
|
minChunks: 3
|
||||||
|
}),
|
||||||
|
|
||||||
|
// copy custom static assets
|
||||||
|
new CopyWebpackPlugin([
|
||||||
|
{
|
||||||
|
from: path.resolve(__dirname, '../static'),
|
||||||
|
to: config.build.assetsSubDirectory,
|
||||||
|
ignore: ['.*']
|
||||||
|
}
|
||||||
|
])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
if (config.build.productionGzip) {
|
||||||
|
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||||
|
|
||||||
|
webpackConfig.plugins.push(
|
||||||
|
new CompressionWebpackPlugin({
|
||||||
|
asset: '[path].gz[query]',
|
||||||
|
algorithm: 'gzip',
|
||||||
|
test: new RegExp(
|
||||||
|
'\\.(' +
|
||||||
|
config.build.productionGzipExtensions.join('|') +
|
||||||
|
')$'
|
||||||
|
),
|
||||||
|
threshold: 10240,
|
||||||
|
minRatio: 0.8
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.build.bundleAnalyzerReport) {
|
||||||
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||||
|
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = webpackConfig
|
7
client/config/dev.env.js
Normal file
7
client/config/dev.env.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
'use strict'
|
||||||
|
const merge = require('webpack-merge')
|
||||||
|
const prodEnv = require('./prod.env')
|
||||||
|
|
||||||
|
module.exports = merge(prodEnv, {
|
||||||
|
NODE_ENV: '"development"'
|
||||||
|
})
|
76
client/config/index.js
Normal file
76
client/config/index.js
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
'use strict'
|
||||||
|
// Template version: 1.3.1
|
||||||
|
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||||
|
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
dev: {
|
||||||
|
|
||||||
|
// Paths
|
||||||
|
assetsSubDirectory: 'static',
|
||||||
|
assetsPublicPath: '/',
|
||||||
|
proxyTable: {},
|
||||||
|
|
||||||
|
// Various Dev Server settings
|
||||||
|
host: 'localhost', // can be overwritten by process.env.HOST
|
||||||
|
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||||
|
autoOpenBrowser: false,
|
||||||
|
errorOverlay: true,
|
||||||
|
notifyOnErrors: true,
|
||||||
|
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||||
|
|
||||||
|
// Use Eslint Loader?
|
||||||
|
// If true, your code will be linted during bundling and
|
||||||
|
// linting errors and warnings will be shown in the console.
|
||||||
|
useEslint: true,
|
||||||
|
// If true, eslint errors and warnings will also be shown in the error overlay
|
||||||
|
// in the browser.
|
||||||
|
showEslintErrorsInOverlay: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Source Maps
|
||||||
|
*/
|
||||||
|
|
||||||
|
// https://webpack.js.org/configuration/devtool/#development
|
||||||
|
devtool: 'cheap-module-eval-source-map',
|
||||||
|
|
||||||
|
// If you have problems debugging vue-files in devtools,
|
||||||
|
// set this to false - it *may* help
|
||||||
|
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||||
|
cacheBusting: true,
|
||||||
|
|
||||||
|
cssSourceMap: true
|
||||||
|
},
|
||||||
|
|
||||||
|
build: {
|
||||||
|
// Template for index.html
|
||||||
|
index: path.resolve(__dirname, '../../dist/index.html'),
|
||||||
|
|
||||||
|
// Paths
|
||||||
|
assetsRoot: path.resolve(__dirname, '../../dist'),
|
||||||
|
assetsSubDirectory: 'static',
|
||||||
|
assetsPublicPath: '/',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Source Maps
|
||||||
|
*/
|
||||||
|
|
||||||
|
productionSourceMap: true,
|
||||||
|
// https://webpack.js.org/configuration/devtool/#production
|
||||||
|
devtool: '#source-map',
|
||||||
|
|
||||||
|
// Gzip off by default as many popular static hosts such as
|
||||||
|
// Surge or Netlify already gzip all static assets for you.
|
||||||
|
// Before setting to `true`, make sure to:
|
||||||
|
// npm install --save-dev compression-webpack-plugin
|
||||||
|
productionGzip: false,
|
||||||
|
productionGzipExtensions: ['js', 'css'],
|
||||||
|
|
||||||
|
// Run the build command with an extra argument to
|
||||||
|
// View the bundle analyzer report after build finishes:
|
||||||
|
// `npm run build --report`
|
||||||
|
// Set to `true` or `false` to always turn it on or off
|
||||||
|
bundleAnalyzerReport: process.env.npm_config_report
|
||||||
|
}
|
||||||
|
}
|
4
client/config/prod.env.js
Normal file
4
client/config/prod.env.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
'use strict'
|
||||||
|
module.exports = {
|
||||||
|
NODE_ENV: '"production"'
|
||||||
|
}
|
12
client/index.html
Normal file
12
client/index.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<title>client</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
</html>
|
11553
client/package-lock.json
generated
Normal file
11553
client/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
72
client/package.json
Normal file
72
client/package.json
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
{
|
||||||
|
"name": "client",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "A Vue.js project",
|
||||||
|
"author": "vincent <vincent@ducamps.win>",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||||
|
"start": "npm run dev",
|
||||||
|
"lint": "eslint --ext .js,.vue src",
|
||||||
|
"build": "node build/build.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"axios": "^0.18.0",
|
||||||
|
"vue": "^2.5.2",
|
||||||
|
"vue-router": "^3.0.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"autoprefixer": "^7.1.2",
|
||||||
|
"babel-core": "^6.22.1",
|
||||||
|
"babel-eslint": "^8.2.1",
|
||||||
|
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||||
|
"babel-loader": "^7.1.1",
|
||||||
|
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||||
|
"babel-plugin-transform-runtime": "^6.22.0",
|
||||||
|
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||||
|
"babel-preset-env": "^1.3.2",
|
||||||
|
"babel-preset-stage-2": "^6.22.0",
|
||||||
|
"chalk": "^2.0.1",
|
||||||
|
"copy-webpack-plugin": "^4.0.1",
|
||||||
|
"css-loader": "^0.28.0",
|
||||||
|
"eslint": "^4.15.0",
|
||||||
|
"eslint-config-airbnb-base": "^11.3.0",
|
||||||
|
"eslint-friendly-formatter": "^3.0.0",
|
||||||
|
"eslint-import-resolver-webpack": "^0.8.3",
|
||||||
|
"eslint-loader": "^1.7.1",
|
||||||
|
"eslint-plugin-import": "^2.7.0",
|
||||||
|
"eslint-plugin-vue": "^4.0.0",
|
||||||
|
"extract-text-webpack-plugin": "^3.0.0",
|
||||||
|
"file-loader": "^1.1.4",
|
||||||
|
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||||
|
"html-webpack-plugin": "^2.30.1",
|
||||||
|
"node-notifier": "^5.1.2",
|
||||||
|
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
||||||
|
"ora": "^1.2.0",
|
||||||
|
"portfinder": "^1.0.13",
|
||||||
|
"postcss-import": "^11.0.0",
|
||||||
|
"postcss-loader": "^2.0.8",
|
||||||
|
"postcss-url": "^7.2.1",
|
||||||
|
"rimraf": "^2.6.0",
|
||||||
|
"semver": "^5.3.0",
|
||||||
|
"shelljs": "^0.7.6",
|
||||||
|
"uglifyjs-webpack-plugin": "^1.1.1",
|
||||||
|
"url-loader": "^0.5.8",
|
||||||
|
"vue-loader": "^13.3.0",
|
||||||
|
"vue-style-loader": "^3.0.1",
|
||||||
|
"vue-template-compiler": "^2.5.2",
|
||||||
|
"webpack": "^3.6.0",
|
||||||
|
"webpack-bundle-analyzer": "^2.9.0",
|
||||||
|
"webpack-dev-server": "^2.9.1",
|
||||||
|
"webpack-merge": "^4.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6.0.0",
|
||||||
|
"npm": ">= 3.0.0"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions",
|
||||||
|
"not ie <= 8"
|
||||||
|
]
|
||||||
|
}
|
22
client/src/App.vue
Normal file
22
client/src/App.vue
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<template>
|
||||||
|
<div id="app">
|
||||||
|
<router-view/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'App',
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#app {
|
||||||
|
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
text-align: center;
|
||||||
|
color: #2c3e50;
|
||||||
|
margin-top: 60px;
|
||||||
|
}
|
||||||
|
</style>
|
BIN
client/src/assets/logo.png
Normal file
BIN
client/src/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
113
client/src/components/HelloWorld.vue
Normal file
113
client/src/components/HelloWorld.vue
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
<template>
|
||||||
|
<div class="hello">
|
||||||
|
<h1>{{ msg }}</h1>
|
||||||
|
<h2>Essential Links</h2>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://vuejs.org"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
Core Docs
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://forum.vuejs.org"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
Forum
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://chat.vuejs.org"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
Community Chat
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://twitter.com/vuejs"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
Twitter
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="http://vuejs-templates.github.io/webpack/"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
Docs for This Template
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h2>Ecosystem</h2>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="http://router.vuejs.org/"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
vue-router
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="http://vuex.vuejs.org/"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
vuex
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="http://vue-loader.vuejs.org/"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
vue-loader
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://github.com/vuejs/awesome-vue"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
awesome-vue
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'HelloWorld',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
msg: 'Welcome to Your Vue.js App',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
|
<style scoped>
|
||||||
|
h1, h2 {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #42b983;
|
||||||
|
}
|
||||||
|
</style>
|
78
client/src/components/chainetv.vue
Normal file
78
client/src/components/chainetv.vue
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h1>ChaineTV</h1>
|
||||||
|
<div>
|
||||||
|
<input name="chaine-input" v-model=chaine type="text">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button v-on:click="checkchaine()">search</button>
|
||||||
|
|
||||||
|
<button v-on:click="parsechaine">update chaine</button>
|
||||||
|
</div>
|
||||||
|
<div >
|
||||||
|
<ul>
|
||||||
|
<li v-for="message in messages" :key="message">
|
||||||
|
{{message}}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'chainetv',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
messages: [],
|
||||||
|
chaine: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getchaine(num) {
|
||||||
|
let path = 'http://localhost:5000/api/v1/chaine/';
|
||||||
|
path += num;
|
||||||
|
axios.get(path)
|
||||||
|
.then((res) => {
|
||||||
|
this.messages.push(num + ' ==> ' + res.data);
|
||||||
|
console.log(this.messages);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
checkchaine() {
|
||||||
|
this.getchaine(this.chaine);
|
||||||
|
|
||||||
|
},
|
||||||
|
parsechaine() {
|
||||||
|
const path = 'http://localhost:5000/api/v1/chaine/';
|
||||||
|
axios.put(path)
|
||||||
|
.then((res) => {
|
||||||
|
this.message = res.data;
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
h1, h2 {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #42b983;
|
||||||
|
}
|
||||||
|
</style>
|
50
client/src/components/ping.vue
Normal file
50
client/src/components/ping.vue
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h1>{{ msg }}</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ping',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
msg: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMessage() {
|
||||||
|
const path = 'http://localhost:5000/ping';
|
||||||
|
axios.get(path)
|
||||||
|
.then((res) => {
|
||||||
|
this.msg = res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getMessage();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
h1, h2 {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #42b983;
|
||||||
|
}
|
||||||
|
</style>
|
15
client/src/main.js
Normal file
15
client/src/main.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// The Vue build version to load with the `import` command
|
||||||
|
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||||
|
import Vue from 'vue';
|
||||||
|
import App from './App';
|
||||||
|
import router from './router';
|
||||||
|
|
||||||
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
|
/* eslint-disable no-new */
|
||||||
|
new Vue({
|
||||||
|
el: '#app',
|
||||||
|
router,
|
||||||
|
components: { App },
|
||||||
|
template: '<App/>',
|
||||||
|
});
|
21
client/src/router/index.js
Normal file
21
client/src/router/index.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import Vue from 'vue';
|
||||||
|
import Router from 'vue-router';
|
||||||
|
import ping from '@/components/ping';
|
||||||
|
import chainetv from '@/components/chainetv';
|
||||||
|
|
||||||
|
Vue.use(Router);
|
||||||
|
|
||||||
|
export default new Router({
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
name: 'chaineTV',
|
||||||
|
component: chainetv,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/ping',
|
||||||
|
name: 'ping',
|
||||||
|
component: ping,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
0
client/static/.gitkeep
Normal file
0
client/static/.gitkeep
Normal file
1
dist/index.html
vendored
Normal file
1
dist/index.html
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>client</title><link href=/static/css/app.c335ac03f0b687e6f38933ddc999f807.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.b80c91c2a6434c966aab.js></script><script type=text/javascript src=/static/js/app.4f275ae67982aafbbb4b.js></script></body></html>
|
2
dist/static/css/app.c335ac03f0b687e6f38933ddc999f807.css
vendored
Normal file
2
dist/static/css/app.c335ac03f0b687e6f38933ddc999f807.css
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}h1[data-v-3dfaaed4],h2[data-v-3dfaaed4]{font-weight:400}ul[data-v-3dfaaed4]{list-style-type:none;padding:0}li[data-v-3dfaaed4]{display:inline-block;margin:0 10px}a[data-v-3dfaaed4]{color:#42b983}h1[data-v-4c806b4e],h2[data-v-4c806b4e]{font-weight:400}ul[data-v-4c806b4e]{list-style-type:none;padding:0}li[data-v-4c806b4e]{display:inline-block;margin:0 10px}a[data-v-4c806b4e]{color:#42b983}
|
||||||
|
/*# sourceMappingURL=app.c335ac03f0b687e6f38933ddc999f807.css.map */
|
1
dist/static/css/app.c335ac03f0b687e6f38933ddc999f807.css.map
vendored
Normal file
1
dist/static/css/app.c335ac03f0b687e6f38933ddc999f807.css.map
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["app.c335ac03f0b687e6f38933ddc999f807.css"],"names":[],"mappings":"AACA,KACE,8CAAoD,AACpD,mCAAoC,AACpC,kCAAmC,AACnC,kBAAmB,AACnB,cAAe,AACf,eAAiB,CAClB,AAED,wCACE,eAAoB,CACrB,AACD,oBACE,qBAAsB,AACtB,SAAW,CACZ,AACD,oBACE,qBAAsB,AACtB,aAAe,CAChB,AACD,mBACE,aAAe,CAChB,AAED,wCACE,eAAoB,CACrB,AACD,oBACE,qBAAsB,AACtB,SAAW,CACZ,AACD,oBACE,qBAAsB,AACtB,aAAe,CAChB,AACD,mBACE,aAAe,CAChB","file":"app.c335ac03f0b687e6f38933ddc999f807.css","sourcesContent":["\n#app {\n font-family: 'Avenir', Helvetica, Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: center;\n color: #2c3e50;\n margin-top: 60px;\n}\n\nh1[data-v-3dfaaed4], h2[data-v-3dfaaed4] {\n font-weight: normal;\n}\nul[data-v-3dfaaed4] {\n list-style-type: none;\n padding: 0;\n}\nli[data-v-3dfaaed4] {\n display: inline-block;\n margin: 0 10px;\n}\na[data-v-3dfaaed4] {\n color: #42b983;\n}\n\nh1[data-v-4c806b4e], h2[data-v-4c806b4e] {\n font-weight: normal;\n}\nul[data-v-4c806b4e] {\n list-style-type: none;\n padding: 0;\n}\nli[data-v-4c806b4e] {\n display: inline-block;\n margin: 0 10px;\n}\na[data-v-4c806b4e] {\n color: #42b983;\n}\n"]}
|
2
dist/static/js/app.4f275ae67982aafbbb4b.js
vendored
Normal file
2
dist/static/js/app.4f275ae67982aafbbb4b.js
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
webpackJsonp([1],{"/qIl":function(e,n){},GlAN:function(e,n){},HuWz:function(e,n){},NHnr:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=t("7+uW"),i={render:function(){var e=this.$createElement,n=this._self._c||e;return n("div",{attrs:{id:"app"}},[n("router-view")],1)},staticRenderFns:[]};var c=t("VU/8")({name:"App"},i,!1,function(e){t("HuWz")},null,null).exports,r=t("/ocq"),o=t("mtWM"),s=t.n(o),u={name:"Ping",data:function(){return{msg:""}},methods:{getMessage:function(){var e=this;s.a.get("http://localhost:5000/ping").then(function(n){e.msg=n.data}).catch(function(e){console.error(e)})}},created:function(){this.getMessage()}},h={render:function(){var e=this.$createElement,n=this._self._c||e;return n("div",[n("h1",[this._v(this._s(this.msg))])])},staticRenderFns:[]};var p=t("VU/8")(u,h,!1,function(e){t("/qIl")},"data-v-3dfaaed4",null).exports,l={name:"chainetv",data:function(){return{message:"",chaine:""}},methods:{checkchaine:function(){var e=this,n="http://localhost:5000/api/v1/chaine/";n+=this.chaine,s.a.get(n).then(function(n){e.message=n.data}).catch(function(e){console.error(e)})}}},v={render:function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",[t("h1",[e._v("ChaineTV")]),e._v(" "),t("div",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.chaine,expression:"chaine"}],attrs:{name:"chaine-input",type:"text"},domProps:{value:e.chaine},on:{input:function(n){n.target.composing||(e.chaine=n.target.value)}}})]),e._v(" "),t("div",[t("button",{on:{click:function(n){return e.checkchaine()}}},[e._v("submit")])]),e._v(" "),t("div",[e._v("\n "+e._s(e.message)+"\n ")])])},staticRenderFns:[]};var d=t("VU/8")(l,v,!1,function(e){t("GlAN")},"data-v-4c806b4e",null).exports;a.a.use(r.a);var m=new r.a({routes:[{path:"/ping",name:"ping",component:p},{path:"/",name:"chaineTV",component:d}]});a.a.config.productionTip=!1,new a.a({el:"#app",router:m,components:{App:c},template:"<App/>"})}},["NHnr"]);
|
||||||
|
//# sourceMappingURL=app.4f275ae67982aafbbb4b.js.map
|
1
dist/static/js/app.4f275ae67982aafbbb4b.js.map
vendored
Normal file
1
dist/static/js/app.4f275ae67982aafbbb4b.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/static/js/manifest.2ae2e69a05c33dfc65f8.js
vendored
Normal file
2
dist/static/js/manifest.2ae2e69a05c33dfc65f8.js
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={2:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p="/",t.oe=function(r){throw console.error(r),r}}([]);
|
||||||
|
//# sourceMappingURL=manifest.2ae2e69a05c33dfc65f8.js.map
|
1
dist/static/js/manifest.2ae2e69a05c33dfc65f8.js.map
vendored
Normal file
1
dist/static/js/manifest.2ae2e69a05c33dfc65f8.js.map
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["webpack:///webpack/bootstrap b7738f2399e6c2a660a4"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,IAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.2ae2e69a05c33dfc65f8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b7738f2399e6c2a660a4"],"sourceRoot":""}
|
20
dist/static/js/vendor.b80c91c2a6434c966aab.js
vendored
Normal file
20
dist/static/js/vendor.b80c91c2a6434c966aab.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/static/js/vendor.b80c91c2a6434c966aab.js.map
vendored
Normal file
1
dist/static/js/vendor.b80c91c2a6434c966aab.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user