[DEV] try to correct angular and sanic

This commit is contained in:
Edouard DUPIN 2020-01-03 21:45:49 +01:00
parent b7719edccf
commit dd6a6719f8
7 changed files with 2683 additions and 9096 deletions

View File

@ -1,11 +1,16 @@
FROM python:alpine3.6 FROM python:alpine3.6
RUN apk update \ RUN apk update && \
&& apk add build-base apk upgrade && \
apk add --update-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
build-base mediainfo
RUN pip3 install --upgrade pip RUN pip3 install --upgrade pip
RUN pip3 install sanic RUN pip3 install sanic==19.9.0
RUN pip3 install sanic-cors RUN pip3 install sanic-cors

View File

@ -85,7 +85,7 @@ def add(_app, _name_api):
args_with_blank_values = _request.headers args_with_blank_values = _request.headers
debug.info("List arguments: " + str(args_with_blank_values)); debug.info("List arguments: " + str(args_with_blank_values));
async def streaming(_response): async def streaming(_response):
debug.info("streaming " + str(_response)); #debug.info("streaming " + str(_response));
total_size = 0 total_size = 0
temporary_file = os.path.join(_app.config['REST_TMP_DATA'], str(tmp_value) + ".tmp") temporary_file = os.path.join(_app.config['REST_TMP_DATA'], str(tmp_value) + ".tmp")
if not os.path.exists(_app.config['REST_TMP_DATA']): if not os.path.exists(_app.config['REST_TMP_DATA']):
@ -95,7 +95,7 @@ def add(_app, _name_api):
file_stream = open(temporary_file,"wb") file_stream = open(temporary_file,"wb")
sha1 = hashlib.sha512() sha1 = hashlib.sha512()
while True: while True:
debug.warning("ploufffff " + str(dir(_request.stream))) #debug.warning("ploufffff " + str(dir(_request.stream)))
body = await _request.stream.read() body = await _request.stream.read()
if body is None: if body is None:
debug.warning("empty body"); debug.warning("empty body");

View File

@ -37,7 +37,7 @@ class upload_in_chunks(object):
self.readsofar += len(data) self.readsofar += len(data)
percent = self.readsofar * 1e2 / self.totalsize percent = self.readsofar * 1e2 / self.totalsize
since_time = datetime.datetime.utcnow() - self.start_time since_time = datetime.datetime.utcnow() - self.start_time
sys.stderr.write("\rSending data: {percent:3.0f}% {size:14.0f} / {total_size} {time}".format(percent=percent, size=self.readsofar, total_size=self.totalsize), time=since_time) sys.stderr.write("\rSending data: {percent:3.0f}% {size:14.0f} / {total_size} {timeee}".format(percent=percent, size=self.readsofar, total_size=self.totalsize, timeee=str(since_time)))
yield data yield data
def __len__(self): def __len__(self):

16
front/Dockerfile Normal file
View File

@ -0,0 +1,16 @@
# base image
FROM node:latest
ADD src /application/src
ADD package.json /application/
WORKDIR /application/
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# install and cache app dependencies
RUN npm install
# start app
CMD ["ng", "serve", "--host", "0.0.0.0"]

10
front/docker-compose.yaml Executable file
View File

@ -0,0 +1,10 @@
version: '3'
services:
karideo_service:
build: .
restart: always
image: yui.heero/karideo
container_name: karideo
ports:
- 15081:4200

11676
front/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,37 +12,37 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^5.2.0", "@angular/animations": "^8.2.14",
"@angular/common": "^5.2.0", "@angular/common": "^8.2.14",
"@angular/compiler": "^5.2.0", "@angular/compiler": "^8.2.14",
"@angular/core": "^5.2.0", "@angular/core": "^8.2.14",
"@angular/forms": "^5.2.0", "@angular/forms": "^8.2.14",
"@angular/http": "^5.2.0", "@angular/http": "^7.2.15",
"@angular/platform-browser": "^5.2.0", "@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^5.2.0", "@angular/platform-browser-dynamic": "^8.2.14",
"@angular/router": "^5.2.0", "@angular/router": "^8.2.14",
"core-js": "^2.4.1", "core-js": "^3.6.1",
"rxjs": "^5.5.6", "rxjs": "^6.5.4",
"zone.js": "^0.8.19" "zone.js": "^0.10.2"
}, },
"devDependencies": { "devDependencies": {
"@angular/cli": "~1.7.3", "@angular/cli": "^8.3.21",
"@angular/compiler-cli": "^5.2.0", "@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^5.2.0", "@angular/language-service": "^8.2.14",
"@types/jasmine": "~2.8.3", "@types/jasmine": "^3.5.0",
"@types/jasminewd2": "~2.0.2", "@types/jasminewd2": "x",
"@types/node": "~6.0.60", "@types/node": "^13.1.2",
"codelyzer": "^4.0.1", "codelyzer": "^5.2.1",
"jasmine-core": "~2.8.0", "jasmine-core": "^3.5.0",
"jasmine-spec-reporter": "~4.2.1", "jasmine-spec-reporter": "x",
"karma": "~2.0.0", "karma": "^4.4.1",
"karma-chrome-launcher": "~2.2.0", "karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-reporter": "^1.2.1", "karma-coverage-istanbul-reporter": "^2.1.1",
"karma-jasmine": "~1.1.0", "karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^0.2.2", "karma-jasmine-html-reporter": "^1.5.1",
"protractor": "~5.1.2", "protractor": "x",
"ts-node": "~4.1.0", "ts-node": "^8.5.4",
"tslint": "~5.9.1", "tslint": "x",
"typescript": "~2.5.3" "typescript": "^3.6.0"
} }
} }