diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6fbf59f --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +run: + @cd src/ && uvicorn server.asgi:application --reload --port 2121 && cd .. + +test: + @cd src/ && pytest -s server/ + +testws: + @cd src/ && pytest -s server/tests/test_websockets.py \ No newline at end of file diff --git a/src/client/package-lock.json b/src/client/package-lock.json index 2720f63..963df6a 100644 --- a/src/client/package-lock.json +++ b/src/client/package-lock.json @@ -2434,6 +2434,12 @@ "yarn": ">= 1.13.0" } }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", + "dev": true + }, "node_modules/@tootallnate/once": { "version": "1.1.2", "dev": true, @@ -2464,11 +2470,6 @@ "@types/node": "*" } }, - "node_modules/@types/component-emitter": { - "version": "1.2.11", - "dev": true, - "license": "MIT" - }, "node_modules/@types/connect": { "version": "3.4.35", "dev": true, @@ -2488,13 +2489,18 @@ }, "node_modules/@types/cookie": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", + "dev": true }, "node_modules/@types/cors": { - "version": "2.8.12", + "version": "2.8.13", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", + "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", "dev": true, - "license": "MIT" + "dependencies": { + "@types/node": "*" + } }, "node_modules/@types/eslint": { "version": "8.4.2", @@ -3207,8 +3213,9 @@ }, "node_modules/base64id": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true, - "license": "MIT", "engines": { "node": "^4.5.0 || >= 5.9" } @@ -3645,11 +3652,6 @@ "dev": true, "license": "MIT" }, - "node_modules/component-emitter": { - "version": "1.3.0", - "dev": true, - "license": "MIT" - }, "node_modules/compressible": { "version": "2.0.18", "dev": true, @@ -3792,8 +3794,9 @@ }, "node_modules/cookie": { "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -3904,8 +3907,9 @@ }, "node_modules/cors": { "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "dev": true, - "license": "MIT", "dependencies": { "object-assign": "^4", "vary": "^1" @@ -4504,9 +4508,10 @@ } }, "node_modules/engine.io": { - "version": "6.2.1", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.2.tgz", + "integrity": "sha512-FKn/3oMiJjrOEOeUub2WCox6JhxBXq/Zn3fZOMCBxKnNYtsdKjxhl7yR3fZhM9PV+rdE75SU5SYMc+2PGzo+Tg==", "dev": true, - "license": "MIT", "dependencies": { "@types/cookie": "^0.4.1", "@types/cors": "^2.8.12", @@ -4517,16 +4522,17 @@ "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.0.3", - "ws": "~8.2.3" + "ws": "~8.11.0" }, "engines": { "node": ">=10.0.0" } }, "node_modules/engine.io-parser": { - "version": "5.0.4", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz", + "integrity": "sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==", "dev": true, - "license": "MIT", "engines": { "node": ">=10.0.0" } @@ -7532,8 +7538,9 @@ }, "node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9357,33 +9364,38 @@ } }, "node_modules/socket.io": { - "version": "4.5.1", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.1.tgz", + "integrity": "sha512-KMcaAi4l/8+xEjkRICl6ak8ySoxsYG+gG6/XfRCPJPQ/haCRIJBTL4wIl8YCsmtaBovcAXGLOShyVWQ/FG8GZA==", "dev": true, - "license": "MIT", "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", "debug": "~4.3.2", - "engine.io": "~6.2.0", - "socket.io-adapter": "~2.4.0", - "socket.io-parser": "~4.0.4" + "engine.io": "~6.4.1", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.1" }, "engines": { "node": ">=10.0.0" } }, "node_modules/socket.io-adapter": { - "version": "2.4.0", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", + "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", "dev": true, - "license": "MIT" + "dependencies": { + "ws": "~8.11.0" + } }, "node_modules/socket.io-parser": { - "version": "4.0.5", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz", + "integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==", "dev": true, - "license": "MIT", "dependencies": { - "@types/component-emitter": "^1.2.10", - "component-emitter": "~1.3.0", + "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1" }, "engines": { @@ -9959,9 +9971,9 @@ } }, "node_modules/ua-parser-js": { - "version": "0.7.34", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.34.tgz", - "integrity": "sha512-cJMeh/eOILyGu0ejgTKB95yKT3zOenSe9UGE3vj6WfiOwgGYnmATUsnDixMFvdU+rNMvWih83hrUP8VwhF9yXQ==", + "version": "0.7.35", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.35.tgz", + "integrity": "sha512-veRf7dawaj9xaWEu9HoTVn5Pggtc/qj+kqTOFvNiN1l0YdxwC1kvel57UCjThjGa3BHBihE8/UJAHI+uQHmd/g==", "dev": true, "funding": [ { @@ -10487,9 +10499,10 @@ "license": "ISC" }, "node_modules/ws": { - "version": "8.2.3", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10.0.0" }, diff --git a/src/client/package.json b/src/client/package.json index 4d3bf1a..27c7c12 100644 --- a/src/client/package.json +++ b/src/client/package.json @@ -7,7 +7,7 @@ "url": "http://github.com/AbduazizZiyodov" }, "license": "MIT", - "version": "2.2.0", + "version": "2.3.0", "main": "main.js", "productName": "Docker Dashboard", "keywords": [ diff --git a/src/client/src-tauri/Cargo.lock b/src/client/src-tauri/Cargo.lock index d76f011..a574eb9 100644 --- a/src/client/src-tauri/Cargo.lock +++ b/src/client/src-tauri/Cargo.lock @@ -494,7 +494,7 @@ checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] name = "docker-dashboard" -version = "0.1.0" +version = "2.3.0" dependencies = [ "serde", "serde_json", diff --git a/src/client/src-tauri/Cargo.toml b/src/client/src-tauri/Cargo.toml index d172ac0..15551c7 100644 --- a/src/client/src-tauri/Cargo.toml +++ b/src/client/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "docker-dashboard" -version = "0.1.0" +version = "2.3.0" description = "Simple lightweight GUI application for working with Docker" authors = ["abduaziz.ziyodov@mail.ru"] license = "" diff --git a/src/client/src-tauri/tauri.conf.json b/src/client/src-tauri/tauri.conf.json index c9d96f1..ee4d2fd 100644 --- a/src/client/src-tauri/tauri.conf.json +++ b/src/client/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "docker-dashboard", - "version": "2.2.0" + "version": "2.3.0" }, "tauri": { "allowlist": { diff --git a/src/client/src/app/components/modal/run-container-modal/run-container-modal.component.ts b/src/client/src/app/components/modal/run-container-modal/run-container-modal.component.ts index 430fcf7..1ae8236 100644 --- a/src/client/src/app/components/modal/run-container-modal/run-container-modal.component.ts +++ b/src/client/src/app/components/modal/run-container-modal/run-container-modal.component.ts @@ -67,9 +67,6 @@ export class RunContainerModalComponent implements OnInit { for (let key of ['env', 'firstPort', 'secondPort']) { delete containerData[key]; } - - console.log(containerData); - return containerData; } diff --git a/src/client/src/app/core/image/pull-image/pull-image.component.ts b/src/client/src/app/core/image/pull-image/pull-image.component.ts index 97caec4..ecd227a 100644 --- a/src/client/src/app/core/image/pull-image/pull-image.component.ts +++ b/src/client/src/app/core/image/pull-image/pull-image.component.ts @@ -1,5 +1,5 @@ -import { ActivatedRoute, Router } from '@angular/router'; import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; import { environment } from '@env'; import { Image } from '@models/image'; @@ -25,13 +25,11 @@ export class PullImageComponent implements OnInit { ) {} ngOnInit(): void { - let limit: number = 1; - this.imageService - .searchImages(this.repository, limit) - .subscribe((image: Image[]) => { - this.imageInfo = image ? image[0] : null; - }); + this.performSearch(); + this.fetchImages(); + } + fetchImages(): void { this.imageService.getImages().subscribe((images: Image[]) => { this.pulledVersions = images.filter( (image: Image) => image.name == this.repository @@ -40,11 +38,20 @@ export class PullImageComponent implements OnInit { }); } + performSearch(): void { + let limit: number = 1; + this.imageService + .searchImages(this.repository, limit) + .subscribe((image: Image[]) => { + this.imageInfo = image ? image[0] : null; + }); + } + addImageToTasks(): void { this.ws.next({ repository: this.repository, tag: this.selectedTag, - action: 'create', + action: 'add', }); this.ws.asObservable().subscribe((data: any) => { diff --git a/src/client/src/app/core/image/pull-list/pull-list.component.html b/src/client/src/app/core/image/pull-list/pull-list.component.html index 7ec4e2e..ae0ffe2 100644 --- a/src/client/src/app/core/image/pull-list/pull-list.component.html +++ b/src/client/src/app/core/image/pull-list/pull-list.component.html @@ -18,48 +18,47 @@
No pending tasks yet ..
- {{ task.repository }} - + {{ tasks[key].repository }} - {{ task.tag }} -