Compare commits
	
		
			16 Commits
		
	
	
		
			b7455e32e1
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 65622fa17b | |||
| a5262894ed | |||
| 056cd60d0d | |||
| 99ae6b1dd0 | |||
| e05627dc36 | |||
| 00e601e246 | |||
| 
						 | 
					c0cf27780d | ||
| 
						 | 
					c03745007a | ||
| 
						 | 
					ea28ac1c37 | ||
| 
						 | 
					4e6b465abf | ||
| 
						 | 
					1adaf55f07 | ||
| 
						 | 
					8a9e5881a0 | ||
| 
						 | 
					3bcec625da | ||
| 
						 | 
					d9a8b042b1 | ||
| 
						 | 
					0af64e435c | ||
| 
						 | 
					b7def95490 | 
							
								
								
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,6 +1,8 @@
 | 
			
		||||
app/cache
 | 
			
		||||
Docker/mariadb/mysql
 | 
			
		||||
# ---> Go
 | 
			
		||||
# If you prefer the allow list template instead of the deny list, see community template:
 | 
			
		||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
 | 
			
		||||
# https:/a/github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
 | 
			
		||||
#
 | 
			
		||||
# Binaries for programs and plugins
 | 
			
		||||
*.exe
 | 
			
		||||
@@ -20,4 +22,3 @@
 | 
			
		||||
 | 
			
		||||
# Go workspace file
 | 
			
		||||
go.work
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,4 +14,10 @@ services:
 | 
			
		||||
    - ./mariadb/mysql:/var/lib/mysql
 | 
			
		||||
    - ./mariadb/backup:/backup
 | 
			
		||||
    ports:
 | 
			
		||||
    - 3306:3306
 | 
			
		||||
    - 3306:3306
 | 
			
		||||
  web:
 | 
			
		||||
    image: nginx
 | 
			
		||||
    volumes:
 | 
			
		||||
    - ../webui:/usr/share/nginx/html:ro
 | 
			
		||||
    ports:
 | 
			
		||||
    - 80:80
 | 
			
		||||
@@ -3,6 +3,7 @@ module gitea.voser.cloud/Golang/GoDown
 | 
			
		||||
go 1.18
 | 
			
		||||
 | 
			
		||||
require (
 | 
			
		||||
	github.com/gin-contrib/cors v1.3.1
 | 
			
		||||
	github.com/gin-gonic/gin v1.7.7
 | 
			
		||||
	github.com/go-sql-driver/mysql v1.6.0
 | 
			
		||||
	github.com/kkdai/youtube/v2 v2.7.11
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								app/go.sum
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								app/go.sum
									
									
									
									
									
								
							@@ -66,8 +66,11 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
 | 
			
		||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
 | 
			
		||||
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
 | 
			
		||||
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
 | 
			
		||||
github.com/gin-contrib/cors v1.3.1 h1:doAsuITavI4IOcd0Y19U4B+O0dNWihRyX//nn4sEmgA=
 | 
			
		||||
github.com/gin-contrib/cors v1.3.1/go.mod h1:jjEJ4268OPZUcU7k9Pm653S7lXUGcqMADzFA61xsmDk=
 | 
			
		||||
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
 | 
			
		||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
 | 
			
		||||
github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do=
 | 
			
		||||
github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs=
 | 
			
		||||
github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U=
 | 
			
		||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
 | 
			
		||||
@@ -75,8 +78,10 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
 | 
			
		||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 | 
			
		||||
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
 | 
			
		||||
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
 | 
			
		||||
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
 | 
			
		||||
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
 | 
			
		||||
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
 | 
			
		||||
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
 | 
			
		||||
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
 | 
			
		||||
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
 | 
			
		||||
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
 | 
			
		||||
@@ -151,6 +156,7 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
 | 
			
		||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
 | 
			
		||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 | 
			
		||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 | 
			
		||||
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
			
		||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 | 
			
		||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
 | 
			
		||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
 | 
			
		||||
@@ -167,10 +173,12 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 | 
			
		||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
 | 
			
		||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
 | 
			
		||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
 | 
			
		||||
github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw=
 | 
			
		||||
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
 | 
			
		||||
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
 | 
			
		||||
github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
 | 
			
		||||
github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
 | 
			
		||||
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
 | 
			
		||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 | 
			
		||||
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
 | 
			
		||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
 | 
			
		||||
@@ -327,6 +335,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w
 | 
			
		||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
@@ -518,6 +527,8 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
 | 
			
		||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
 | 
			
		||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
 | 
			
		||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 | 
			
		||||
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
 | 
			
		||||
gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
 | 
			
		||||
gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4=
 | 
			
		||||
gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
 | 
			
		||||
gopkg.in/vansante/go-ffprobe.v2 v2.0.3 h1:nmR7yLalb5p5UmXhXUYnrsIkbb8j7h2OYMDoLETCQ5U=
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								app/main.go
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								app/main.go
									
									
									
									
									
								
							@@ -3,9 +3,11 @@ package main
 | 
			
		||||
import (
 | 
			
		||||
	"database/sql"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"gitea.voser.cloud/Golang/GoDown/handlers/api"
 | 
			
		||||
	"gitea.voser.cloud/Golang/GoDown/handlers/sqldb"
 | 
			
		||||
	"github.com/gin-contrib/cors"
 | 
			
		||||
	"github.com/gin-gonic/gin"
 | 
			
		||||
	_ "github.com/go-sql-driver/mysql"
 | 
			
		||||
)
 | 
			
		||||
@@ -43,6 +45,19 @@ func main() {
 | 
			
		||||
	sqldb.Dbentrycount()
 | 
			
		||||
 | 
			
		||||
	router := gin.Default()
 | 
			
		||||
	router.Use(cors.New(cors.Config{
 | 
			
		||||
		AllowOrigins: []string{"*"},
 | 
			
		||||
		AllowMethods: []string{"GET", "POST", "PUT"},
 | 
			
		||||
		AllowHeaders: []string{"Origin"},
 | 
			
		||||
		// ExposeHeaders:    []string{"Content-Length"},
 | 
			
		||||
		AllowCredentials: true,
 | 
			
		||||
		// AllowOriginFunc: func(origin string) bool {
 | 
			
		||||
		// 	return origin == "http://127.0.0.1:5555"
 | 
			
		||||
		// 	//return origin == "https://github.com"
 | 
			
		||||
		// },
 | 
			
		||||
		MaxAge: 5 * time.Minute,
 | 
			
		||||
	}))
 | 
			
		||||
	router.StaticFile("/favicon.ico", "./resources/favicon.ico")
 | 
			
		||||
	router.GET("/api/db", api.GET_api_db)
 | 
			
		||||
	router.GET("/api/add/:ytid", api.GET_api_add_ytid)
 | 
			
		||||
	router.GET("/api/get/:ytid", api.GET_api_get_ytid)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								app/resources/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								app/resources/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 15 KiB  | 
							
								
								
									
										8
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								makefile
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
all: docker prerequesits gorunapp
 | 
			
		||||
all: docker prerequesits sass gorunapp 
 | 
			
		||||
 | 
			
		||||
docker:
 | 
			
		||||
	docker-compose -f Docker/compose.yml up -d
 | 
			
		||||
@@ -12,4 +12,8 @@ gorunapp:
 | 
			
		||||
clean:
 | 
			
		||||
	docker-compose -f Docker/compose.yml down
 | 
			
		||||
	sudo rm ./app/cache -rf
 | 
			
		||||
	sudo rm ./Docker/mariadb/mysql/* -rf
 | 
			
		||||
	sudo rm ./Docker/mariadb/mysql/* -rf
 | 
			
		||||
sass:
 | 
			
		||||
	sass --watch ./webui/css/index.scss:./webui/css/index.css &
 | 
			
		||||
ui-test:
 | 
			
		||||
	cd ui; env CHROME_BIN=/usr/bin/chromium npm test
 | 
			
		||||
							
								
								
									
										17
									
								
								ui/.browserslistrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ui/.browserslistrc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
 | 
			
		||||
# For additional information regarding the format and rule options, please see:
 | 
			
		||||
# https://github.com/browserslist/browserslist#queries
 | 
			
		||||
 | 
			
		||||
# For the full list of supported browsers by the Angular framework, please see:
 | 
			
		||||
# https://angular.io/guide/browser-support
 | 
			
		||||
 | 
			
		||||
# You can see what browsers were selected by your queries by running:
 | 
			
		||||
#   npx browserslist
 | 
			
		||||
 | 
			
		||||
last 1 Chrome version
 | 
			
		||||
last 1 Firefox version
 | 
			
		||||
last 2 Edge major versions
 | 
			
		||||
last 2 Safari major versions
 | 
			
		||||
last 2 iOS major versions
 | 
			
		||||
Firefox ESR
 | 
			
		||||
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
 | 
			
		||||
							
								
								
									
										16
									
								
								ui/.editorconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								ui/.editorconfig
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
# Editor configuration, see https://editorconfig.org
 | 
			
		||||
root = true
 | 
			
		||||
 | 
			
		||||
[*]
 | 
			
		||||
charset = utf-8
 | 
			
		||||
indent_style = space
 | 
			
		||||
indent_size = 2
 | 
			
		||||
insert_final_newline = true
 | 
			
		||||
trim_trailing_whitespace = true
 | 
			
		||||
 | 
			
		||||
[*.ts]
 | 
			
		||||
quote_type = single
 | 
			
		||||
 | 
			
		||||
[*.md]
 | 
			
		||||
max_line_length = off
 | 
			
		||||
trim_trailing_whitespace = false
 | 
			
		||||
							
								
								
									
										47
									
								
								ui/.eslintrc.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								ui/.eslintrc.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
{
 | 
			
		||||
  "root": true,
 | 
			
		||||
  "ignorePatterns": ["projects/**/*"],
 | 
			
		||||
  "overrides": [
 | 
			
		||||
    {
 | 
			
		||||
      "files": ["*.ts"],
 | 
			
		||||
      "parserOptions": {
 | 
			
		||||
        "project": ["tsconfig.json", "e2e/tsconfig.json"],
 | 
			
		||||
        "createDefaultProgram": true
 | 
			
		||||
      },
 | 
			
		||||
      "extends": [
 | 
			
		||||
        "plugin:@angular-eslint/ng-cli-compat",
 | 
			
		||||
        "plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
 | 
			
		||||
        "plugin:@angular-eslint/template/process-inline-templates"
 | 
			
		||||
      ],
 | 
			
		||||
      "rules": {
 | 
			
		||||
        "@angular-eslint/component-class-suffix": [
 | 
			
		||||
          "error",
 | 
			
		||||
          {
 | 
			
		||||
            "suffixes": ["Page", "Component"]
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        "@angular-eslint/component-selector": [
 | 
			
		||||
          "error",
 | 
			
		||||
          {
 | 
			
		||||
            "type": "element",
 | 
			
		||||
            "prefix": "app",
 | 
			
		||||
            "style": "kebab-case"
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        "@angular-eslint/directive-selector": [
 | 
			
		||||
          "error",
 | 
			
		||||
          {
 | 
			
		||||
            "type": "attribute",
 | 
			
		||||
            "prefix": "app",
 | 
			
		||||
            "style": "camelCase"
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "files": ["*.html"],
 | 
			
		||||
      "extends": ["plugin:@angular-eslint/template/recommended"],
 | 
			
		||||
      "rules": {}
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										32
									
								
								ui/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								ui/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
# Specifies intentionally untracked files to ignore when using Git
 | 
			
		||||
# http://git-scm.com/docs/gitignore
 | 
			
		||||
 | 
			
		||||
*~
 | 
			
		||||
*.sw[mnpcod]
 | 
			
		||||
.tmp
 | 
			
		||||
*.tmp
 | 
			
		||||
*.tmp.*
 | 
			
		||||
*.sublime-project
 | 
			
		||||
*.sublime-workspace
 | 
			
		||||
.DS_Store
 | 
			
		||||
Thumbs.db
 | 
			
		||||
UserInterfaceState.xcuserstate
 | 
			
		||||
$RECYCLE.BIN/
 | 
			
		||||
 | 
			
		||||
*.log
 | 
			
		||||
log.txt
 | 
			
		||||
npm-debug.log*
 | 
			
		||||
 | 
			
		||||
/.angular
 | 
			
		||||
/.idea
 | 
			
		||||
/.ionic
 | 
			
		||||
/.sass-cache
 | 
			
		||||
/.sourcemaps
 | 
			
		||||
/.versions
 | 
			
		||||
/.vscode
 | 
			
		||||
/coverage
 | 
			
		||||
/dist
 | 
			
		||||
/node_modules
 | 
			
		||||
/platforms
 | 
			
		||||
/plugins
 | 
			
		||||
/www
 | 
			
		||||
							
								
								
									
										162
									
								
								ui/angular.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										162
									
								
								ui/angular.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,162 @@
 | 
			
		||||
{
 | 
			
		||||
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
 | 
			
		||||
  "version": 1,
 | 
			
		||||
  "newProjectRoot": "projects",
 | 
			
		||||
  "projects": {
 | 
			
		||||
    "app": {
 | 
			
		||||
      "root": "",
 | 
			
		||||
      "sourceRoot": "src",
 | 
			
		||||
      "projectType": "application",
 | 
			
		||||
      "prefix": "app",
 | 
			
		||||
      "schematics": {},
 | 
			
		||||
      "architect": {
 | 
			
		||||
        "build": {
 | 
			
		||||
          "builder": "@angular-devkit/build-angular:browser",
 | 
			
		||||
          "options": {
 | 
			
		||||
            "outputPath": "www",
 | 
			
		||||
            "index": "src/index.html",
 | 
			
		||||
            "main": "src/main.ts",
 | 
			
		||||
            "polyfills": "src/polyfills.ts",
 | 
			
		||||
            "tsConfig": "tsconfig.app.json",
 | 
			
		||||
            "assets": [
 | 
			
		||||
              {
 | 
			
		||||
                "glob": "**/*",
 | 
			
		||||
                "input": "src/assets",
 | 
			
		||||
                "output": "assets"
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                "glob": "**/*.svg",
 | 
			
		||||
                "input": "node_modules/ionicons/dist/ionicons/svg",
 | 
			
		||||
                "output": "./svg"
 | 
			
		||||
              }
 | 
			
		||||
            ],
 | 
			
		||||
            "styles": ["src/theme/variables.scss", "src/global.scss"],
 | 
			
		||||
            "scripts": [],
 | 
			
		||||
            "aot": false,
 | 
			
		||||
            "vendorChunk": true,
 | 
			
		||||
            "extractLicenses": false,
 | 
			
		||||
            "buildOptimizer": false,
 | 
			
		||||
            "sourceMap": true,
 | 
			
		||||
            "optimization": false,
 | 
			
		||||
            "namedChunks": true
 | 
			
		||||
          },
 | 
			
		||||
          "configurations": {
 | 
			
		||||
            "production": {
 | 
			
		||||
              "fileReplacements": [
 | 
			
		||||
                {
 | 
			
		||||
                  "replace": "src/environments/environment.ts",
 | 
			
		||||
                  "with": "src/environments/environment.prod.ts"
 | 
			
		||||
                }
 | 
			
		||||
              ],
 | 
			
		||||
              "optimization": true,
 | 
			
		||||
              "outputHashing": "all",
 | 
			
		||||
              "sourceMap": false,
 | 
			
		||||
              "namedChunks": false,
 | 
			
		||||
              "aot": true,
 | 
			
		||||
              "extractLicenses": true,
 | 
			
		||||
              "vendorChunk": false,
 | 
			
		||||
              "buildOptimizer": true,
 | 
			
		||||
              "budgets": [
 | 
			
		||||
                {
 | 
			
		||||
                  "type": "initial",
 | 
			
		||||
                  "maximumWarning": "2mb",
 | 
			
		||||
                  "maximumError": "5mb"
 | 
			
		||||
                }
 | 
			
		||||
              ]
 | 
			
		||||
            },
 | 
			
		||||
            "ci": {
 | 
			
		||||
              "progress": false
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        "serve": {
 | 
			
		||||
          "builder": "@angular-devkit/build-angular:dev-server",
 | 
			
		||||
          "options": {
 | 
			
		||||
            "browserTarget": "app:build"
 | 
			
		||||
          },
 | 
			
		||||
          "configurations": {
 | 
			
		||||
            "production": {
 | 
			
		||||
              "browserTarget": "app:build:production"
 | 
			
		||||
            },
 | 
			
		||||
            "ci": {
 | 
			
		||||
              "progress": false
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        "extract-i18n": {
 | 
			
		||||
          "builder": "@angular-devkit/build-angular:extract-i18n",
 | 
			
		||||
          "options": {
 | 
			
		||||
            "browserTarget": "app:build"
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        "test": {
 | 
			
		||||
          "builder": "@angular-devkit/build-angular:karma",
 | 
			
		||||
          "options": {
 | 
			
		||||
            "main": "src/test.ts",
 | 
			
		||||
            "polyfills": "src/polyfills.ts",
 | 
			
		||||
            "tsConfig": "tsconfig.spec.json",
 | 
			
		||||
            "karmaConfig": "karma.conf.js",
 | 
			
		||||
            "styles": [],
 | 
			
		||||
            "scripts": [],
 | 
			
		||||
            "assets": [
 | 
			
		||||
              {
 | 
			
		||||
                "glob": "favicon.ico",
 | 
			
		||||
                "input": "src/",
 | 
			
		||||
                "output": "/"
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                "glob": "**/*",
 | 
			
		||||
                "input": "src/assets",
 | 
			
		||||
                "output": "/assets"
 | 
			
		||||
              }
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          "configurations": {
 | 
			
		||||
            "ci": {
 | 
			
		||||
              "progress": false,
 | 
			
		||||
              "watch": false
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        "lint": {
 | 
			
		||||
          "builder": "@angular-eslint/builder:lint",
 | 
			
		||||
          "options": {
 | 
			
		||||
            "lintFilePatterns": [
 | 
			
		||||
              "src/**/*.ts",
 | 
			
		||||
              "src/**/*.html"
 | 
			
		||||
            ]
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        "e2e": {
 | 
			
		||||
          "builder": "@angular-devkit/build-angular:protractor",
 | 
			
		||||
          "options": {
 | 
			
		||||
            "protractorConfig": "e2e/protractor.conf.js",
 | 
			
		||||
            "devServerTarget": "app:serve"
 | 
			
		||||
          },
 | 
			
		||||
          "configurations": {
 | 
			
		||||
            "production": {
 | 
			
		||||
              "devServerTarget": "app:serve:production"
 | 
			
		||||
            },
 | 
			
		||||
            "ci": {
 | 
			
		||||
              "devServerTarget": "app:serve:ci"
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "cli": {
 | 
			
		||||
    "schematicCollections": [
 | 
			
		||||
      "@ionic/angular-toolkit"
 | 
			
		||||
    ],
 | 
			
		||||
    "analytics": "9e99e173-a30e-4ae7-bef6-c6526435ef32"
 | 
			
		||||
  },
 | 
			
		||||
  "schematics": {
 | 
			
		||||
    "@ionic/angular-toolkit:component": {
 | 
			
		||||
      "styleext": "scss"
 | 
			
		||||
    },
 | 
			
		||||
    "@ionic/angular-toolkit:page": {
 | 
			
		||||
      "styleext": "scss"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								ui/capacitor.config.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								ui/capacitor.config.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
import { CapacitorConfig } from '@capacitor/cli';
 | 
			
		||||
 | 
			
		||||
const config: CapacitorConfig = {
 | 
			
		||||
  appId: 'io.ionic.starter',
 | 
			
		||||
  appName: 'ui',
 | 
			
		||||
  webDir: 'www',
 | 
			
		||||
  bundledWebRuntime: false
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default config;
 | 
			
		||||
							
								
								
									
										37
									
								
								ui/e2e/protractor.conf.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								ui/e2e/protractor.conf.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
// @ts-check
 | 
			
		||||
// Protractor configuration file, see link for more information
 | 
			
		||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
 | 
			
		||||
 | 
			
		||||
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @type { import("protractor").Config }
 | 
			
		||||
 */
 | 
			
		||||
exports.config = {
 | 
			
		||||
  allScriptsTimeout: 11000,
 | 
			
		||||
  specs: [
 | 
			
		||||
    './src/**/*.e2e-spec.ts'
 | 
			
		||||
  ],
 | 
			
		||||
  capabilities: {
 | 
			
		||||
    browserName: 'chrome'
 | 
			
		||||
  },
 | 
			
		||||
  directConnect: true,
 | 
			
		||||
  SELENIUM_PROMISE_MANAGER: false,
 | 
			
		||||
  baseUrl: 'http://localhost:4200/',
 | 
			
		||||
  framework: 'jasmine',
 | 
			
		||||
  jasmineNodeOpts: {
 | 
			
		||||
    showColors: true,
 | 
			
		||||
    defaultTimeoutInterval: 30000,
 | 
			
		||||
    print: function() {}
 | 
			
		||||
  },
 | 
			
		||||
  onPrepare() {
 | 
			
		||||
    require('ts-node').register({
 | 
			
		||||
      project: require('path').join(__dirname, './tsconfig.json')
 | 
			
		||||
    });
 | 
			
		||||
    jasmine.getEnv().addReporter(new SpecReporter({
 | 
			
		||||
      spec: {
 | 
			
		||||
        displayStacktrace: StacktraceOption.PRETTY
 | 
			
		||||
      }
 | 
			
		||||
    }));
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										17
									
								
								ui/e2e/src/app.e2e-spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ui/e2e/src/app.e2e-spec.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
import { AppPage } from './app.po';
 | 
			
		||||
 | 
			
		||||
describe('new App', () => {
 | 
			
		||||
  let page: AppPage;
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    page = new AppPage();
 | 
			
		||||
  });
 | 
			
		||||
  describe('default screen', () => {
 | 
			
		||||
    beforeEach(() => {
 | 
			
		||||
      page.navigateTo('/Inbox');
 | 
			
		||||
    });
 | 
			
		||||
    it('should say Inbox', () => {
 | 
			
		||||
      expect(page.getParagraphText()).toContain('Inbox');
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										11
									
								
								ui/e2e/src/app.po.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								ui/e2e/src/app.po.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
import { browser, by, element } from 'protractor';
 | 
			
		||||
 | 
			
		||||
export class AppPage {
 | 
			
		||||
  navigateTo(destination) {
 | 
			
		||||
    return browser.get(destination);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getParagraphText() {
 | 
			
		||||
    return element(by.deepCss('app-root ion-content')).getText();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										12
									
								
								ui/e2e/tsconfig.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								ui/e2e/tsconfig.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
{
 | 
			
		||||
  "extends": "../tsconfig.json",
 | 
			
		||||
  "compilerOptions": {
 | 
			
		||||
    "outDir": "../out-tsc/e2e",
 | 
			
		||||
    "module": "commonjs",
 | 
			
		||||
    "target": "es2018",
 | 
			
		||||
    "types": [
 | 
			
		||||
      "jasmine",
 | 
			
		||||
      "node"
 | 
			
		||||
    ]
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								ui/ionic.config.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								ui/ionic.config.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "ui",
 | 
			
		||||
  "integrations": {
 | 
			
		||||
    "capacitor": {}
 | 
			
		||||
  },
 | 
			
		||||
  "type": "angular"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										44
									
								
								ui/karma.conf.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								ui/karma.conf.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
			
		||||
// Karma configuration file, see link for more information
 | 
			
		||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
 | 
			
		||||
 | 
			
		||||
module.exports = function (config) {
 | 
			
		||||
  config.set({
 | 
			
		||||
    basePath: '',
 | 
			
		||||
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
 | 
			
		||||
    plugins: [
 | 
			
		||||
      require('karma-jasmine'),
 | 
			
		||||
      require('karma-chrome-launcher'),
 | 
			
		||||
      require('karma-jasmine-html-reporter'),
 | 
			
		||||
      require('karma-coverage'),
 | 
			
		||||
      require('@angular-devkit/build-angular/plugins/karma')
 | 
			
		||||
    ],
 | 
			
		||||
    client: {
 | 
			
		||||
      jasmine: {
 | 
			
		||||
        // you can add configuration options for Jasmine here
 | 
			
		||||
        // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
 | 
			
		||||
        // for example, you can disable the random execution with `random: false`
 | 
			
		||||
        // or set a specific seed with `seed: 4321`
 | 
			
		||||
      },
 | 
			
		||||
      clearContext: false // leave Jasmine Spec Runner output visible in browser
 | 
			
		||||
    },
 | 
			
		||||
    jasmineHtmlReporter: {
 | 
			
		||||
      suppressAll: true // removes the duplicated traces
 | 
			
		||||
    },
 | 
			
		||||
    coverageReporter: {
 | 
			
		||||
      dir: require('path').join(__dirname, './coverage/ngv'),
 | 
			
		||||
      subdir: '.',
 | 
			
		||||
      reporters: [
 | 
			
		||||
        { type: 'html' },
 | 
			
		||||
        { type: 'text-summary' }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    reporters: ['progress', 'kjhtml'],
 | 
			
		||||
    port: 9876,
 | 
			
		||||
    colors: true,
 | 
			
		||||
    logLevel: config.LOG_INFO,
 | 
			
		||||
    autoWatch: true,
 | 
			
		||||
    browsers: ['Chrome'],
 | 
			
		||||
    singleRun: false,
 | 
			
		||||
    restartOnFileChange: true
 | 
			
		||||
  });
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										29841
									
								
								ui/package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										29841
									
								
								ui/package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										67
									
								
								ui/package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								ui/package.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,67 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "ui",
 | 
			
		||||
  "version": "0.0.1",
 | 
			
		||||
  "author": "Ionic Framework",
 | 
			
		||||
  "homepage": "https://ionicframework.com/",
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "ng": "ng",
 | 
			
		||||
    "start": "ng serve",
 | 
			
		||||
    "build": "ng build",
 | 
			
		||||
    "test": "ng test",
 | 
			
		||||
    "lint": "ng lint",
 | 
			
		||||
    "e2e": "ng e2e"
 | 
			
		||||
  },
 | 
			
		||||
  "private": true,
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@angular/common": "^14.0.0",
 | 
			
		||||
    "@angular/core": "^14.0.0",
 | 
			
		||||
    "@angular/forms": "^14.0.0",
 | 
			
		||||
    "@angular/platform-browser": "^14.0.0",
 | 
			
		||||
    "@angular/platform-browser-dynamic": "^14.0.0",
 | 
			
		||||
    "@angular/router": "^14.0.0",
 | 
			
		||||
    "@capacitor/app": "1.1.1",
 | 
			
		||||
    "@capacitor/core": "3.6.0",
 | 
			
		||||
    "@capacitor/haptics": "1.1.4",
 | 
			
		||||
    "@capacitor/keyboard": "1.2.3",
 | 
			
		||||
    "@capacitor/status-bar": "1.0.8",
 | 
			
		||||
    "@ionic/angular": "^6.1.9",
 | 
			
		||||
    "rxjs": "~6.6.0",
 | 
			
		||||
    "tslib": "^2.2.0",
 | 
			
		||||
    "zone.js": "~0.11.4"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@angular-devkit/build-angular": "^14.0.0",
 | 
			
		||||
    "@angular-eslint/builder": "~13.0.1",
 | 
			
		||||
    "@angular-eslint/eslint-plugin": "~13.0.1",
 | 
			
		||||
    "@angular-eslint/eslint-plugin-template": "~13.0.1",
 | 
			
		||||
    "@angular-eslint/template-parser": "~13.0.1",
 | 
			
		||||
    "@angular/cli": "^14.0.0",
 | 
			
		||||
    "@angular/compiler": "^14.0.0",
 | 
			
		||||
    "@angular/compiler-cli": "^14.0.0",
 | 
			
		||||
    "@angular/language-service": "^14.0.0",
 | 
			
		||||
    "@capacitor/cli": "3.6.0",
 | 
			
		||||
    "@ionic/angular-toolkit": "^6.0.0",
 | 
			
		||||
    "@ionic/lab": "3.2.15",
 | 
			
		||||
    "@types/jasmine": "~3.6.0",
 | 
			
		||||
    "@types/jasminewd2": "~2.0.3",
 | 
			
		||||
    "@types/node": "^12.11.1",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "5.3.0",
 | 
			
		||||
    "@typescript-eslint/parser": "5.3.0",
 | 
			
		||||
    "eslint": "^7.6.0",
 | 
			
		||||
    "eslint-plugin-import": "2.22.1",
 | 
			
		||||
    "eslint-plugin-jsdoc": "30.7.6",
 | 
			
		||||
    "eslint-plugin-prefer-arrow": "1.2.2",
 | 
			
		||||
    "jasmine-core": "~3.8.0",
 | 
			
		||||
    "jasmine-spec-reporter": "~5.0.0",
 | 
			
		||||
    "karma": "~6.3.2",
 | 
			
		||||
    "karma-chrome-launcher": "~3.1.0",
 | 
			
		||||
    "karma-coverage": "~2.0.3",
 | 
			
		||||
    "karma-coverage-istanbul-reporter": "~3.0.2",
 | 
			
		||||
    "karma-jasmine": "~4.0.0",
 | 
			
		||||
    "karma-jasmine-html-reporter": "^1.5.0",
 | 
			
		||||
    "protractor": "~7.0.0",
 | 
			
		||||
    "ts-node": "~8.3.0",
 | 
			
		||||
    "typescript": "~4.7.3"
 | 
			
		||||
  },
 | 
			
		||||
  "description": "An Ionic project"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										37
									
								
								ui/src/app/app-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								ui/src/app/app-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
const routes: Routes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: '',
 | 
			
		||||
    redirectTo: '/loader', pathMatch: 'full'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'loader',
 | 
			
		||||
    loadChildren: () => import('./pages/loader/loader.module').then( m => m.LoaderPageModule)
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'login',
 | 
			
		||||
    loadChildren: () => import('./pages/login/login.module').then( m => m.LoginPageModule)
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'download',
 | 
			
		||||
    loadChildren: () => import('./pages/download/download.module').then( m => m.DownloadPageModule)
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'all-songs',
 | 
			
		||||
    loadChildren: () => import('./pages/all-songs/all-songs.module').then( m => m.AllSongsPageModule)
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'register',
 | 
			
		||||
    loadChildren: () => import('./pages/register/register.module').then( m => m.RegisterPageModule)
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [
 | 
			
		||||
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
 | 
			
		||||
  ],
 | 
			
		||||
  exports: [RouterModule]
 | 
			
		||||
})
 | 
			
		||||
export class AppRoutingModule {}
 | 
			
		||||
							
								
								
									
										21
									
								
								ui/src/app/app.component.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								ui/src/app/app.component.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
<ion-app>
 | 
			
		||||
  <ion-split-pane contentId="main-content">
 | 
			
		||||
    <ion-menu contentId="main-content" type="overlay">
 | 
			
		||||
      <ion-content>
 | 
			
		||||
        <ion-list id="inbox-list">
 | 
			
		||||
          <ion-list-header>GoDown
 | 
			
		||||
            <ion-icon name="code-download-outline"></ion-icon>
 | 
			
		||||
          </ion-list-header>
 | 
			
		||||
          <ion-note>janic@voser.cloud</ion-note>
 | 
			
		||||
          <ion-menu-toggle auto-hide="false" *ngFor="let p of appPages; let i = index">
 | 
			
		||||
            <ion-item routerDirection="root" [routerLink]="[p.url]" lines="none" detail="false" routerLinkActive="selected">
 | 
			
		||||
              <ion-icon slot="start" [ios]="p.icon + '-outline'" [md]="p.icon + '-sharp'"></ion-icon>
 | 
			
		||||
              <ion-label>{{ p.title }}</ion-label>
 | 
			
		||||
            </ion-item>
 | 
			
		||||
          </ion-menu-toggle>
 | 
			
		||||
        </ion-list>
 | 
			
		||||
      </ion-content>
 | 
			
		||||
    </ion-menu>
 | 
			
		||||
    <ion-router-outlet id="main-content"></ion-router-outlet>
 | 
			
		||||
  </ion-split-pane>
 | 
			
		||||
</ion-app>
 | 
			
		||||
							
								
								
									
										119
									
								
								ui/src/app/app.component.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										119
									
								
								ui/src/app/app.component.scss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,119 @@
 | 
			
		||||
ion-menu ion-content {
 | 
			
		||||
  --background: var(--ion-item-background, var(--ion-background-color, #fff));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-content {
 | 
			
		||||
  --padding-start: 8px;
 | 
			
		||||
  --padding-end: 8px;
 | 
			
		||||
  --padding-top: 20px;
 | 
			
		||||
  --padding-bottom: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-list {
 | 
			
		||||
  padding: 20px 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-note {
 | 
			
		||||
  margin-bottom: 30px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-list-header,
 | 
			
		||||
ion-menu.md ion-note {
 | 
			
		||||
  padding-left: 10px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-list#inbox-list {
 | 
			
		||||
  border-bottom: 1px solid var(--ion-color-step-150, #d7d8da);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-list#inbox-list ion-list-header {
 | 
			
		||||
  font-size: 22px;
 | 
			
		||||
  font-weight: 600;
 | 
			
		||||
 | 
			
		||||
  min-height: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-list#labels-list ion-list-header {
 | 
			
		||||
  font-size: 16px;
 | 
			
		||||
 | 
			
		||||
  margin-bottom: 18px;
 | 
			
		||||
 | 
			
		||||
  color: #757575;
 | 
			
		||||
 | 
			
		||||
  min-height: 26px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-item {
 | 
			
		||||
  --padding-start: 10px;
 | 
			
		||||
  --padding-end: 10px;
 | 
			
		||||
  border-radius: 4px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-item.selected {
 | 
			
		||||
  --background: rgba(var(--ion-color-primary-rgb), 0.14);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-item.selected ion-icon {
 | 
			
		||||
  color: var(--ion-color-primary);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-item ion-icon {
 | 
			
		||||
  color: #616e7e;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.md ion-item ion-label {
 | 
			
		||||
  font-weight: 500;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.ios ion-content {
 | 
			
		||||
  --padding-bottom: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.ios ion-list {
 | 
			
		||||
  padding: 20px 0 0 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.ios ion-note {
 | 
			
		||||
  line-height: 24px;
 | 
			
		||||
  margin-bottom: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.ios ion-item {
 | 
			
		||||
  --padding-start: 16px;
 | 
			
		||||
  --padding-end: 16px;
 | 
			
		||||
  --min-height: 50px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.ios ion-item.selected ion-icon {
 | 
			
		||||
  color: var(--ion-color-primary);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.ios ion-item ion-icon {
 | 
			
		||||
  font-size: 24px;
 | 
			
		||||
  color: #73849a;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.ios ion-list#labels-list ion-list-header {
 | 
			
		||||
  margin-bottom: 8px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.ios ion-list-header,
 | 
			
		||||
ion-menu.ios ion-note {
 | 
			
		||||
  padding-left: 16px;
 | 
			
		||||
  padding-right: 16px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-menu.ios ion-note {
 | 
			
		||||
  margin-bottom: 8px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-note {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  font-size: 16px;
 | 
			
		||||
 | 
			
		||||
  color: var(--ion-color-medium-shade);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ion-item.selected {
 | 
			
		||||
  --color: var(--ion-color-primary);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										46
									
								
								ui/src/app/app.component.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								ui/src/app/app.component.spec.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
 | 
			
		||||
import { TestBed, waitForAsync } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { RouterTestingModule } from '@angular/router/testing';
 | 
			
		||||
 | 
			
		||||
import { AppComponent } from './app.component';
 | 
			
		||||
 | 
			
		||||
describe('AppComponent', () => {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  beforeEach(waitForAsync(() => {
 | 
			
		||||
 | 
			
		||||
    TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [AppComponent],
 | 
			
		||||
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
 | 
			
		||||
      imports: [ RouterTestingModule.withRoutes([])],
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
  it('should create the app', waitForAsync(() => {
 | 
			
		||||
    const fixture = TestBed.createComponent(AppComponent);
 | 
			
		||||
    const app = fixture.debugElement.componentInstance;
 | 
			
		||||
    expect(app).toBeTruthy();
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
  it('should have menu labels', waitForAsync(() => {
 | 
			
		||||
    const fixture = TestBed.createComponent(AppComponent);
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
    const app = fixture.nativeElement;
 | 
			
		||||
    const menuItems = app.querySelectorAll('ion-label');
 | 
			
		||||
    expect(menuItems.length).toEqual(4);
 | 
			
		||||
    expect(menuItems[0].textContent).toContain('Login');
 | 
			
		||||
    expect(menuItems[1].textContent).toContain('Register');
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
  it('should have urls', waitForAsync(() => {
 | 
			
		||||
    const fixture = TestBed.createComponent(AppComponent);
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
    const app = fixture.nativeElement;
 | 
			
		||||
    const menuItems = app.querySelectorAll('ion-item');
 | 
			
		||||
    expect(menuItems.length).toEqual(4);
 | 
			
		||||
    expect(menuItems[0].getAttribute('ng-reflect-router-link')).toEqual('/login');
 | 
			
		||||
    expect(menuItems[1].getAttribute('ng-reflect-router-link')).toEqual('/register');
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										15
									
								
								ui/src/app/app.component.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								ui/src/app/app.component.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
import { Component } from '@angular/core';
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-root',
 | 
			
		||||
  templateUrl: 'app.component.html',
 | 
			
		||||
  styleUrls: ['app.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class AppComponent {
 | 
			
		||||
  public appPages = [
 | 
			
		||||
    { title: 'Login', url: '/login', icon: 'log-in' },
 | 
			
		||||
    { title: 'Register', url: '/register', icon: 'key' },
 | 
			
		||||
    { title: 'Download', url: '/download', icon: 'cloud-download' },
 | 
			
		||||
    { title: 'All Songs', url: '/all-songs', icon: 'musical-notes' },
 | 
			
		||||
  ];
 | 
			
		||||
  constructor() {}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										16
									
								
								ui/src/app/app.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								ui/src/app/app.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { BrowserModule } from '@angular/platform-browser';
 | 
			
		||||
import { RouteReuseStrategy } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
 | 
			
		||||
 | 
			
		||||
import { AppComponent } from './app.component';
 | 
			
		||||
import { AppRoutingModule } from './app-routing.module';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  declarations: [AppComponent],
 | 
			
		||||
  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
 | 
			
		||||
  providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
 | 
			
		||||
  bootstrap: [AppComponent],
 | 
			
		||||
})
 | 
			
		||||
export class AppModule {}
 | 
			
		||||
							
								
								
									
										17
									
								
								ui/src/app/pages/all-songs/all-songs-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ui/src/app/pages/all-songs/all-songs-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { Routes, RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { AllSongsPage } from './all-songs.page';
 | 
			
		||||
 | 
			
		||||
const routes: Routes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: '',
 | 
			
		||||
    component: AllSongsPage
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [RouterModule.forChild(routes)],
 | 
			
		||||
  exports: [RouterModule],
 | 
			
		||||
})
 | 
			
		||||
export class AllSongsPageRoutingModule {}
 | 
			
		||||
							
								
								
									
										20
									
								
								ui/src/app/pages/all-songs/all-songs.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								ui/src/app/pages/all-songs/all-songs.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { CommonModule } from '@angular/common';
 | 
			
		||||
import { FormsModule } from '@angular/forms';
 | 
			
		||||
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
 | 
			
		||||
import { AllSongsPageRoutingModule } from './all-songs-routing.module';
 | 
			
		||||
 | 
			
		||||
import { AllSongsPage } from './all-songs.page';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [
 | 
			
		||||
    CommonModule,
 | 
			
		||||
    FormsModule,
 | 
			
		||||
    IonicModule,
 | 
			
		||||
    AllSongsPageRoutingModule
 | 
			
		||||
  ],
 | 
			
		||||
  declarations: [AllSongsPage]
 | 
			
		||||
})
 | 
			
		||||
export class AllSongsPageModule {}
 | 
			
		||||
							
								
								
									
										9
									
								
								ui/src/app/pages/all-songs/all-songs.page.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								ui/src/app/pages/all-songs/all-songs.page.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
<ion-header>
 | 
			
		||||
  <ion-toolbar>
 | 
			
		||||
    <ion-title>all_songs</ion-title>
 | 
			
		||||
  </ion-toolbar>
 | 
			
		||||
</ion-header>
 | 
			
		||||
 | 
			
		||||
<ion-content>
 | 
			
		||||
 | 
			
		||||
</ion-content>
 | 
			
		||||
							
								
								
									
										0
									
								
								ui/src/app/pages/all-songs/all-songs.page.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								ui/src/app/pages/all-songs/all-songs.page.scss
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										24
									
								
								ui/src/app/pages/all-songs/all-songs.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								ui/src/app/pages/all-songs/all-songs.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
 | 
			
		||||
import { AllSongsPage } from './all-songs.page';
 | 
			
		||||
 | 
			
		||||
describe('AllSongsPage', () => {
 | 
			
		||||
  let component: AllSongsPage;
 | 
			
		||||
  let fixture: ComponentFixture<AllSongsPage>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(waitForAsync(() => {
 | 
			
		||||
    TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [ AllSongsPage ],
 | 
			
		||||
      imports: [IonicModule.forRoot()]
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
 | 
			
		||||
    fixture = TestBed.createComponent(AllSongsPage);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										15
									
								
								ui/src/app/pages/all-songs/all-songs.page.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								ui/src/app/pages/all-songs/all-songs.page.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-all-songs',
 | 
			
		||||
  templateUrl: './all-songs.page.html',
 | 
			
		||||
  styleUrls: ['./all-songs.page.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class AllSongsPage implements OnInit {
 | 
			
		||||
 | 
			
		||||
  constructor() { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										17
									
								
								ui/src/app/pages/download/download-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ui/src/app/pages/download/download-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { Routes, RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { DownloadPage } from './download.page';
 | 
			
		||||
 | 
			
		||||
const routes: Routes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: '',
 | 
			
		||||
    component: DownloadPage
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [RouterModule.forChild(routes)],
 | 
			
		||||
  exports: [RouterModule],
 | 
			
		||||
})
 | 
			
		||||
export class DownloadPageRoutingModule {}
 | 
			
		||||
							
								
								
									
										20
									
								
								ui/src/app/pages/download/download.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								ui/src/app/pages/download/download.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { CommonModule } from '@angular/common';
 | 
			
		||||
import { FormsModule } from '@angular/forms';
 | 
			
		||||
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
 | 
			
		||||
import { DownloadPageRoutingModule } from './download-routing.module';
 | 
			
		||||
 | 
			
		||||
import { DownloadPage } from './download.page';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [
 | 
			
		||||
    CommonModule,
 | 
			
		||||
    FormsModule,
 | 
			
		||||
    IonicModule,
 | 
			
		||||
    DownloadPageRoutingModule
 | 
			
		||||
  ],
 | 
			
		||||
  declarations: [DownloadPage]
 | 
			
		||||
})
 | 
			
		||||
export class DownloadPageModule {}
 | 
			
		||||
							
								
								
									
										41
									
								
								ui/src/app/pages/download/download.page.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								ui/src/app/pages/download/download.page.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
<ion-header>
 | 
			
		||||
  <ion-toolbar>
 | 
			
		||||
    <ion-title>Download</ion-title>
 | 
			
		||||
  </ion-toolbar>
 | 
			
		||||
</ion-header>
 | 
			
		||||
<ion-content>
 | 
			
		||||
  <div class="flex-center">
 | 
			
		||||
    <ion-card>
 | 
			
		||||
      <!-- Input with placeholder -->
 | 
			
		||||
      <section>
 | 
			
		||||
        <ion-item fill="solid">
 | 
			
		||||
          <ion-label position="floating">Enter URL</ion-label>
 | 
			
		||||
          <ion-input type="url" expand="full" pattern="url"></ion-input>
 | 
			
		||||
        </ion-item>
 | 
			
		||||
        <div class="bottom-buttons">
 | 
			
		||||
          <ion-label>Download to Device</ion-label>
 | 
			
		||||
          <ion-button expand="full" color="secondary">
 | 
			
		||||
            <ion-icon slot="start" name="musical-note-outline"></ion-icon>
 | 
			
		||||
            MP3 - Download to my Device
 | 
			
		||||
            <ion-icon slot="end" name="download-outline"></ion-icon>
 | 
			
		||||
          </ion-button>
 | 
			
		||||
          <ion-button expand="full" color="secondary">
 | 
			
		||||
            <ion-icon slot="start" name="videocam-outline"></ion-icon>
 | 
			
		||||
            MP4 - Download to my Device
 | 
			
		||||
            <ion-icon slot="end" name="download-outline"></ion-icon>
 | 
			
		||||
          </ion-button>
 | 
			
		||||
          <ion-button expand="full" color="primary">
 | 
			
		||||
            <ion-icon slot="start" name="musical-note-outline"></ion-icon>
 | 
			
		||||
            MP3 - Upload to Music Store
 | 
			
		||||
            <ion-icon slot="end" name="cloud-upload-outline"></ion-icon>
 | 
			
		||||
          </ion-button>
 | 
			
		||||
          <ion-button expand="full" color="primary">
 | 
			
		||||
            <ion-icon slot="start" name="videocam-outline"></ion-icon>
 | 
			
		||||
            MP4 - Upload to Video Store
 | 
			
		||||
            <ion-icon slot="end" name="cloud-upload-outline"></ion-icon>
 | 
			
		||||
          </ion-button>
 | 
			
		||||
        </div>
 | 
			
		||||
      </section>
 | 
			
		||||
    </ion-card>
 | 
			
		||||
  </div>
 | 
			
		||||
</ion-content>
 | 
			
		||||
							
								
								
									
										6
									
								
								ui/src/app/pages/download/download.page.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								ui/src/app/pages/download/download.page.scss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
ion-card {
 | 
			
		||||
    padding: 1em;
 | 
			
		||||
}
 | 
			
		||||
ion-button {
 | 
			
		||||
    margin-top: 1em;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										24
									
								
								ui/src/app/pages/download/download.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								ui/src/app/pages/download/download.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
 | 
			
		||||
import { DownloadPage } from './download.page';
 | 
			
		||||
 | 
			
		||||
describe('DownloadPage', () => {
 | 
			
		||||
  let component: DownloadPage;
 | 
			
		||||
  let fixture: ComponentFixture<DownloadPage>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(waitForAsync(() => {
 | 
			
		||||
    TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [ DownloadPage ],
 | 
			
		||||
      imports: [IonicModule.forRoot()]
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
 | 
			
		||||
    fixture = TestBed.createComponent(DownloadPage);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										15
									
								
								ui/src/app/pages/download/download.page.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								ui/src/app/pages/download/download.page.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-download',
 | 
			
		||||
  templateUrl: './download.page.html',
 | 
			
		||||
  styleUrls: ['./download.page.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class DownloadPage implements OnInit {
 | 
			
		||||
 | 
			
		||||
  constructor() { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										17
									
								
								ui/src/app/pages/loader/loader-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ui/src/app/pages/loader/loader-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { Routes, RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { LoaderPage } from './loader.page';
 | 
			
		||||
 | 
			
		||||
const routes: Routes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: '',
 | 
			
		||||
    component: LoaderPage
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [RouterModule.forChild(routes)],
 | 
			
		||||
  exports: [RouterModule],
 | 
			
		||||
})
 | 
			
		||||
export class LoaderPageRoutingModule {}
 | 
			
		||||
							
								
								
									
										20
									
								
								ui/src/app/pages/loader/loader.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								ui/src/app/pages/loader/loader.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { CommonModule } from '@angular/common';
 | 
			
		||||
import { FormsModule } from '@angular/forms';
 | 
			
		||||
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
 | 
			
		||||
import { LoaderPageRoutingModule } from './loader-routing.module';
 | 
			
		||||
 | 
			
		||||
import { LoaderPage } from './loader.page';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [
 | 
			
		||||
    CommonModule,
 | 
			
		||||
    FormsModule,
 | 
			
		||||
    IonicModule,
 | 
			
		||||
    LoaderPageRoutingModule
 | 
			
		||||
  ],
 | 
			
		||||
  declarations: [LoaderPage]
 | 
			
		||||
})
 | 
			
		||||
export class LoaderPageModule {}
 | 
			
		||||
							
								
								
									
										5
									
								
								ui/src/app/pages/loader/loader.page.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								ui/src/app/pages/loader/loader.page.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
<ion-content>
 | 
			
		||||
  <div class="flex-center">
 | 
			
		||||
    <ion-spinner name="crescent" color="primary"></ion-spinner>
 | 
			
		||||
  </div>
 | 
			
		||||
</ion-content>
 | 
			
		||||
							
								
								
									
										0
									
								
								ui/src/app/pages/loader/loader.page.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								ui/src/app/pages/loader/loader.page.scss
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										33
									
								
								ui/src/app/pages/loader/loader.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								ui/src/app/pages/loader/loader.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
import { AppRoutingModule } from 'src/app/app-routing.module';
 | 
			
		||||
 | 
			
		||||
import { LoaderPage } from './loader.page';
 | 
			
		||||
 | 
			
		||||
describe('LoaderPage', () => {
 | 
			
		||||
  let component: LoaderPage;
 | 
			
		||||
  let fixture: ComponentFixture<LoaderPage>;
 | 
			
		||||
  let router: Router;
 | 
			
		||||
 | 
			
		||||
  beforeEach(waitForAsync(() => {
 | 
			
		||||
    TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [ LoaderPage ],
 | 
			
		||||
      imports: [
 | 
			
		||||
        IonicModule.forRoot(),
 | 
			
		||||
        AppRoutingModule
 | 
			
		||||
      ]
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
 | 
			
		||||
    fixture = TestBed.createComponent(LoaderPage);
 | 
			
		||||
    router = TestBed.get(Router);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
  it('should go to login page after load', () => {
 | 
			
		||||
    spyOn(router, 'navigate');
 | 
			
		||||
    component.ngOnInit();
 | 
			
		||||
    expect(router.navigate).toHaveBeenCalledWith(['login']);
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										17
									
								
								ui/src/app/pages/loader/loader.page.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ui/src/app/pages/loader/loader.page.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { Router } from '@angular/router'
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-loader',
 | 
			
		||||
  templateUrl: './loader.page.html',
 | 
			
		||||
  styleUrls: ['./loader.page.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class LoaderPage implements OnInit {
 | 
			
		||||
 | 
			
		||||
  constructor(private router: Router) { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
    // setTimeout(() => { this.router.navigate(['login']); }, 500);  < Could be used if connection would be tested
 | 
			
		||||
    this.router.navigate(['login']);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										17
									
								
								ui/src/app/pages/login/login-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ui/src/app/pages/login/login-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { Routes, RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { LoginPage } from './login.page';
 | 
			
		||||
 | 
			
		||||
const routes: Routes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: '',
 | 
			
		||||
    component: LoginPage
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [RouterModule.forChild(routes)],
 | 
			
		||||
  exports: [RouterModule],
 | 
			
		||||
})
 | 
			
		||||
export class LoginPageRoutingModule {}
 | 
			
		||||
							
								
								
									
										21
									
								
								ui/src/app/pages/login/login.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								ui/src/app/pages/login/login.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { CommonModule } from '@angular/common';
 | 
			
		||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 | 
			
		||||
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
 | 
			
		||||
import { LoginPageRoutingModule } from './login-routing.module';
 | 
			
		||||
 | 
			
		||||
import { LoginPage } from './login.page';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [
 | 
			
		||||
    CommonModule,
 | 
			
		||||
    FormsModule,
 | 
			
		||||
    IonicModule,
 | 
			
		||||
    LoginPageRoutingModule,
 | 
			
		||||
    ReactiveFormsModule
 | 
			
		||||
  ],
 | 
			
		||||
  declarations: [LoginPage]
 | 
			
		||||
})
 | 
			
		||||
export class LoginPageModule {}
 | 
			
		||||
							
								
								
									
										44
									
								
								ui/src/app/pages/login/login.page.form.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								ui/src/app/pages/login/login.page.form.spec.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
			
		||||
import { FormBuilder, FormGroup } from "@angular/forms";
 | 
			
		||||
import { LoginPageForm } from "./login.page.form";
 | 
			
		||||
 | 
			
		||||
describe(`LoginPageForm`, () => {
 | 
			
		||||
 | 
			
		||||
    let loginPageForm : LoginPageForm;
 | 
			
		||||
    let form: FormGroup
 | 
			
		||||
 | 
			
		||||
    beforeEach(() =>{
 | 
			
		||||
        loginPageForm = new LoginPageForm(new FormBuilder());
 | 
			
		||||
        form = loginPageForm.createForm();
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    it('should create login form empty', () => {
 | 
			
		||||
        const loginPageForm = new LoginPageForm(new FormBuilder());
 | 
			
		||||
        const form = loginPageForm.createForm();
 | 
			
		||||
        expect(form).not.toBeNull();
 | 
			
		||||
        expect(form.get('email')).not.toBeNull();
 | 
			
		||||
        expect(form.get('email').value).toEqual("");
 | 
			
		||||
        expect(form.get('email').valid).toBeFalsy();
 | 
			
		||||
        expect(form.get('password')).not.toBeNull();
 | 
			
		||||
        expect(form.get('password').value).toEqual("");
 | 
			
		||||
        expect(form.get('password').valid).toBeFalsy();
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    it('should have email invalid if email is not valid', () => {
 | 
			
		||||
        form.get('email').setValue('invalid email');
 | 
			
		||||
 | 
			
		||||
        expect(form.get('email').valid).toBeFalsy();
 | 
			
		||||
    })
 | 
			
		||||
    
 | 
			
		||||
    it('should have email valid if email is valid', () => {
 | 
			
		||||
        form.get('email').setValue('valid@email.test');
 | 
			
		||||
 | 
			
		||||
        expect(form.get('email').valid).toBeTruthy();
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    it('should have a valid from', () => {
 | 
			
		||||
        form.get('email').setValue('valid@email.test');
 | 
			
		||||
        form.get('password').setValue('12345678');
 | 
			
		||||
 | 
			
		||||
        expect(form.valid).toBeTruthy();
 | 
			
		||||
    })
 | 
			
		||||
})
 | 
			
		||||
							
								
								
									
										14
									
								
								ui/src/app/pages/login/login.page.form.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								ui/src/app/pages/login/login.page.form.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
 | 
			
		||||
 | 
			
		||||
export class LoginPageForm {
 | 
			
		||||
    private formBuilder: FormBuilder
 | 
			
		||||
    constructor(formBuilder: FormBuilder){
 | 
			
		||||
        this.formBuilder = formBuilder;
 | 
			
		||||
    }
 | 
			
		||||
    createForm() : FormGroup {
 | 
			
		||||
        return this.formBuilder.group({
 | 
			
		||||
            email: ['', [Validators.required, Validators.email]],
 | 
			
		||||
            password: ['', [Validators.required]]
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										36
									
								
								ui/src/app/pages/login/login.page.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								ui/src/app/pages/login/login.page.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
<ion-content>
 | 
			
		||||
  <div class="flex-center">
 | 
			
		||||
    <form [formGroup]="form">
 | 
			
		||||
      <ion-card>
 | 
			
		||||
        <ion-card-header>
 | 
			
		||||
          <ion-card-title color="primary">Login</ion-card-title>
 | 
			
		||||
          <ion-card-subtitle color="secondary">Please sign in with your credentials</ion-card-subtitle>
 | 
			
		||||
        </ion-card-header>
 | 
			
		||||
        <ion-card-content>
 | 
			
		||||
          <ion-item fill="solid">
 | 
			
		||||
            <ion-label position="floating">Email</ion-label>
 | 
			
		||||
            <ion-input type="email" formControlName="email"></ion-input>
 | 
			
		||||
            <ion-note color="danger" *ngIf="form.get('email').touched && form.get('email').errors?.required">Email is mandatory</ion-note>
 | 
			
		||||
            <ion-note color="danger" *ngIf="form.get('email').touched && form.get('email').errors?.email">Email is invalid</ion-note>
 | 
			
		||||
          </ion-item>
 | 
			
		||||
          <ion-item fill="solid">
 | 
			
		||||
            <ion-label position="floating">Password</ion-label>
 | 
			
		||||
            <ion-input type="Password" formControlName="password"></ion-input>
 | 
			
		||||
            <ion-note color="danger" *ngIf="form.get('password').touched && form.get('password').errors?.required">Password is mandatory</ion-note>
 | 
			
		||||
          </ion-item>  
 | 
			
		||||
          <ion-button fill="clear" [disabled]="!form.get('email').valid" >
 | 
			
		||||
            Forgot Password
 | 
			
		||||
          </ion-button>
 | 
			
		||||
          <ion-button size="full" [disabled]="!form.valid">
 | 
			
		||||
            Login
 | 
			
		||||
            <ion-icon slot="end" name="log-in-outline"></ion-icon>
 | 
			
		||||
          </ion-button>
 | 
			
		||||
          <ion-button fill="clear" color="secondary" size="full">
 | 
			
		||||
          Register
 | 
			
		||||
          <ion-icon slot="end" name="create-outline"></ion-icon>
 | 
			
		||||
        </ion-button>
 | 
			
		||||
      </ion-card-content>
 | 
			
		||||
    </ion-card>
 | 
			
		||||
  </form>
 | 
			
		||||
  </div>
 | 
			
		||||
</ion-content>
 | 
			
		||||
							
								
								
									
										3
									
								
								ui/src/app/pages/login/login.page.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								ui/src/app/pages/login/login.page.scss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
ion-button[fill="clear"]{
 | 
			
		||||
    text-transform: initial;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										32
									
								
								ui/src/app/pages/login/login.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								ui/src/app/pages/login/login.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
 | 
			
		||||
import { ReactiveFormsModule } from '@angular/forms';
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
import { AppRoutingModule } from 'src/app/app-routing.module';
 | 
			
		||||
 | 
			
		||||
import { LoginPage } from './login.page';
 | 
			
		||||
 | 
			
		||||
describe('LoginPage', () => {
 | 
			
		||||
  let component: LoginPage;
 | 
			
		||||
  let fixture: ComponentFixture<LoginPage>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(waitForAsync(() => {
 | 
			
		||||
    TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [ LoginPage ],
 | 
			
		||||
      imports: [
 | 
			
		||||
        IonicModule.forRoot(),
 | 
			
		||||
        AppRoutingModule,
 | 
			
		||||
        ReactiveFormsModule
 | 
			
		||||
      ]
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
 | 
			
		||||
    fixture = TestBed.createComponent(LoginPage);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
  it('should create form on init', () => {
 | 
			
		||||
    component.ngOnInit();
 | 
			
		||||
 | 
			
		||||
    expect(component.form).not.toBeUndefined();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										21
									
								
								ui/src/app/pages/login/login.page.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								ui/src/app/pages/login/login.page.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { FormBuilder, FormGroup } from '@angular/forms';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
import { LoginPageForm } from './login.page.form';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-login',
 | 
			
		||||
  templateUrl: './login.page.html',
 | 
			
		||||
  styleUrls: ['./login.page.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class LoginPage implements OnInit {
 | 
			
		||||
 | 
			
		||||
  form: FormGroup;
 | 
			
		||||
 | 
			
		||||
  constructor(private router: Router, private formBuilder: FormBuilder) { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
    this.form = new LoginPageForm(this.formBuilder).createForm();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										17
									
								
								ui/src/app/pages/register/register-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ui/src/app/pages/register/register-routing.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { Routes, RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { RegisterPage } from './register.page';
 | 
			
		||||
 | 
			
		||||
const routes: Routes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: '',
 | 
			
		||||
    component: RegisterPage
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [RouterModule.forChild(routes)],
 | 
			
		||||
  exports: [RouterModule],
 | 
			
		||||
})
 | 
			
		||||
export class RegisterPageRoutingModule {}
 | 
			
		||||
							
								
								
									
										20
									
								
								ui/src/app/pages/register/register.module.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								ui/src/app/pages/register/register.module.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { CommonModule } from '@angular/common';
 | 
			
		||||
import { FormsModule } from '@angular/forms';
 | 
			
		||||
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
 | 
			
		||||
import { RegisterPageRoutingModule } from './register-routing.module';
 | 
			
		||||
 | 
			
		||||
import { RegisterPage } from './register.page';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [
 | 
			
		||||
    CommonModule,
 | 
			
		||||
    FormsModule,
 | 
			
		||||
    IonicModule,
 | 
			
		||||
    RegisterPageRoutingModule
 | 
			
		||||
  ],
 | 
			
		||||
  declarations: [RegisterPage]
 | 
			
		||||
})
 | 
			
		||||
export class RegisterPageModule {}
 | 
			
		||||
							
								
								
									
										52
									
								
								ui/src/app/pages/register/register.page.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								ui/src/app/pages/register/register.page.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,52 @@
 | 
			
		||||
<ion-header>
 | 
			
		||||
  <ion-toolbar>
 | 
			
		||||
    <ion-title>Register</ion-title>
 | 
			
		||||
  </ion-toolbar>
 | 
			
		||||
</ion-header>
 | 
			
		||||
 | 
			
		||||
<ion-content>
 | 
			
		||||
  <ion-content>
 | 
			
		||||
    <div class="flex-center">
 | 
			
		||||
      <ion-card>
 | 
			
		||||
        <ion-card-header>
 | 
			
		||||
          <ion-card-title color="primary">Create an Account</ion-card-title>
 | 
			
		||||
          <ion-card-subtitle color="secondary">Please enter your Information</ion-card-subtitle>
 | 
			
		||||
        </ion-card-header>
 | 
			
		||||
        <ion-card-content>
 | 
			
		||||
          <!-- First/Last Name Password --> 
 | 
			
		||||
          <ion-item fill="solid">
 | 
			
		||||
            <ion-label position="floating">First Name</ion-label>
 | 
			
		||||
            <ion-input type="text"></ion-input>
 | 
			
		||||
            <ion-label position="floating">Last Name</ion-label>
 | 
			
		||||
            <ion-input type="text"></ion-input>
 | 
			
		||||
            <ion-icon slot="end" name="accessibility-outline"></ion-icon>
 | 
			
		||||
          </ion-item>
 | 
			
		||||
          <!-- Set Email --> 
 | 
			
		||||
          <ion-item fill="solid">
 | 
			
		||||
            <ion-label position="floating">Email</ion-label>
 | 
			
		||||
            <ion-input type="email" ngModel email></ion-input>
 | 
			
		||||
            <ion-note slot="helper">Enter a valid email</ion-note>
 | 
			
		||||
            <ion-note slot="error">Invalid email</ion-note>
 | 
			
		||||
            <ion-note slot="success">Valid email</ion-note>
 | 
			
		||||
            <ion-icon slot="end" name="mail-outline"></ion-icon>
 | 
			
		||||
          </ion-item>
 | 
			
		||||
          <!-- Set Password --> 
 | 
			
		||||
          <ion-item fill="solid">
 | 
			
		||||
            <ion-label position="floating">Password</ion-label>
 | 
			
		||||
            <ion-input type="Password" ngModel password></ion-input>
 | 
			
		||||
            <ion-note slot="helper">Choose a secure password</ion-note>
 | 
			
		||||
            <ion-label position="floating">Password Confirmation</ion-label>
 | 
			
		||||
            <ion-input type="Password" ngModel password></ion-input>
 | 
			
		||||
            <ion-icon slot="end" name="key-outline"></ion-icon>
 | 
			
		||||
          </ion-item>
 | 
			
		||||
          <!-- Create Account Button --> 
 | 
			
		||||
          <ion-button size="full">
 | 
			
		||||
            Create Account
 | 
			
		||||
            <ion-icon slot="end" name="key-outline"></ion-icon>
 | 
			
		||||
          </ion-button>
 | 
			
		||||
        </ion-card-content>
 | 
			
		||||
      </ion-card>
 | 
			
		||||
    </div>
 | 
			
		||||
  </ion-content>
 | 
			
		||||
  
 | 
			
		||||
</ion-content>
 | 
			
		||||
							
								
								
									
										0
									
								
								ui/src/app/pages/register/register.page.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								ui/src/app/pages/register/register.page.scss
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										24
									
								
								ui/src/app/pages/register/register.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								ui/src/app/pages/register/register.page.spec.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
 | 
			
		||||
import { IonicModule } from '@ionic/angular';
 | 
			
		||||
 | 
			
		||||
import { RegisterPage } from './register.page';
 | 
			
		||||
 | 
			
		||||
describe('RegisterPage', () => {
 | 
			
		||||
  let component: RegisterPage;
 | 
			
		||||
  let fixture: ComponentFixture<RegisterPage>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(waitForAsync(() => {
 | 
			
		||||
    TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [ RegisterPage ],
 | 
			
		||||
      imports: [IonicModule.forRoot()]
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
 | 
			
		||||
    fixture = TestBed.createComponent(RegisterPage);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										15
									
								
								ui/src/app/pages/register/register.page.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								ui/src/app/pages/register/register.page.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-register',
 | 
			
		||||
  templateUrl: './register.page.html',
 | 
			
		||||
  styleUrls: ['./register.page.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class RegisterPage implements OnInit {
 | 
			
		||||
 | 
			
		||||
  constructor() { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								ui/src/assets/icon/favicon.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								ui/src/assets/icon/favicon.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 930 B  | 
							
								
								
									
										1
									
								
								ui/src/assets/shapes.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								ui/src/assets/shapes.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
<svg width="350" height="140" xmlns="http://www.w3.org/2000/svg" style="background:#f6f7f9"><g fill="none" fill-rule="evenodd"><path fill="#F04141" style="mix-blend-mode:multiply" d="M61.905-34.23l96.194 54.51-66.982 54.512L22 34.887z"/><circle fill="#10DC60" style="mix-blend-mode:multiply" cx="155.5" cy="135.5" r="57.5"/><path fill="#3880FF" style="mix-blend-mode:multiply" d="M208.538 9.513l84.417 15.392L223.93 93.93z"/><path fill="#FFCE00" style="mix-blend-mode:multiply" d="M268.625 106.557l46.332-26.75 46.332 26.75v53.5l-46.332 26.75-46.332-26.75z"/><circle fill="#7044FF" style="mix-blend-mode:multiply" cx="299.5" cy="9.5" r="38.5"/><rect fill="#11D3EA" style="mix-blend-mode:multiply" transform="rotate(-60 148.47 37.886)" x="143.372" y="-7.056" width="10.196" height="89.884" rx="5.098"/><path d="M-25.389 74.253l84.86 8.107c5.498.525 9.53 5.407 9.004 10.905a10 10 0 0 1-.057.477l-12.36 85.671a10.002 10.002 0 0 1-11.634 8.42l-86.351-15.226c-5.44-.959-9.07-6.145-8.112-11.584l13.851-78.551a10 10 0 0 1 10.799-8.219z" fill="#7044FF" style="mix-blend-mode:multiply"/><circle fill="#0CD1E8" style="mix-blend-mode:multiply" cx="273.5" cy="106.5" r="20.5"/></g></svg>
 | 
			
		||||
| 
		 After Width: | Height: | Size: 1.1 KiB  | 
							
								
								
									
										3
									
								
								ui/src/environments/environment.prod.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								ui/src/environments/environment.prod.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
export const environment = {
 | 
			
		||||
  production: true
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										16
									
								
								ui/src/environments/environment.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								ui/src/environments/environment.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
// This file can be replaced during build by using the `fileReplacements` array.
 | 
			
		||||
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
 | 
			
		||||
// The list of file replacements can be found in `angular.json`.
 | 
			
		||||
 | 
			
		||||
export const environment = {
 | 
			
		||||
  production: false
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * For easier debugging in development mode, you can import the following file
 | 
			
		||||
 * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
 | 
			
		||||
 *
 | 
			
		||||
 * This import should be commented out in production mode because it will have a negative impact
 | 
			
		||||
 * on performance if an error is thrown.
 | 
			
		||||
 */
 | 
			
		||||
// import 'zone.js/dist/zone-error';  // Included with Angular CLI.
 | 
			
		||||
							
								
								
									
										33
									
								
								ui/src/global.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								ui/src/global.scss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
/*
 | 
			
		||||
 * App Global CSS
 | 
			
		||||
 * ----------------------------------------------------------------------------
 | 
			
		||||
 * Put style rules here that you want to apply globally. These styles are for
 | 
			
		||||
 * the entire app and not just one component. Additionally, this file can be
 | 
			
		||||
 * used as an entry point to import other CSS/Sass files to be included in the
 | 
			
		||||
 * output CSS.
 | 
			
		||||
 * For more information on global stylesheets, visit the documentation:
 | 
			
		||||
 * https://ionicframework.com/docs/layout/global-stylesheets
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Core CSS required for Ionic components to work properly */
 | 
			
		||||
@import "~@ionic/angular/css/core.css";
 | 
			
		||||
 | 
			
		||||
/* Basic CSS for apps built with Ionic */
 | 
			
		||||
@import "~@ionic/angular/css/normalize.css";
 | 
			
		||||
@import "~@ionic/angular/css/structure.css";
 | 
			
		||||
@import "~@ionic/angular/css/typography.css";
 | 
			
		||||
@import '~@ionic/angular/css/display.css';
 | 
			
		||||
 | 
			
		||||
/* Optional CSS utils that can be commented out */
 | 
			
		||||
@import "~@ionic/angular/css/padding.css";
 | 
			
		||||
@import "~@ionic/angular/css/float-elements.css";
 | 
			
		||||
@import "~@ionic/angular/css/text-alignment.css";
 | 
			
		||||
@import "~@ionic/angular/css/text-transformation.css";
 | 
			
		||||
@import "~@ionic/angular/css/flex-utils.css";
 | 
			
		||||
 | 
			
		||||
.flex-center {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    justify-content: center;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
    height: 100%;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										26
									
								
								ui/src/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								ui/src/index.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
 | 
			
		||||
<head>
 | 
			
		||||
  <meta charset="utf-8" />
 | 
			
		||||
  <title>Ionic App</title>
 | 
			
		||||
 | 
			
		||||
  <base href="/" />
 | 
			
		||||
 | 
			
		||||
  <meta name="color-scheme" content="light dark" />
 | 
			
		||||
  <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
 | 
			
		||||
  <meta name="format-detection" content="telephone=no" />
 | 
			
		||||
  <meta name="msapplication-tap-highlight" content="no" />
 | 
			
		||||
 | 
			
		||||
  <link rel="icon" type="image/png" href="assets/icon/favicon.png" />
 | 
			
		||||
 | 
			
		||||
  <!-- add to homescreen for ios -->
 | 
			
		||||
  <meta name="apple-mobile-web-app-capable" content="yes" />
 | 
			
		||||
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
<body>
 | 
			
		||||
  <app-root></app-root>
 | 
			
		||||
</body>
 | 
			
		||||
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										12
									
								
								ui/src/main.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								ui/src/main.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
import { enableProdMode } from '@angular/core';
 | 
			
		||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 | 
			
		||||
 | 
			
		||||
import { AppModule } from './app/app.module';
 | 
			
		||||
import { environment } from './environments/environment';
 | 
			
		||||
 | 
			
		||||
if (environment.production) {
 | 
			
		||||
  enableProdMode();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
platformBrowserDynamic().bootstrapModule(AppModule)
 | 
			
		||||
  .catch(err => console.log(err));
 | 
			
		||||
							
								
								
									
										65
									
								
								ui/src/polyfills.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								ui/src/polyfills.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
/**
 | 
			
		||||
 * This file includes polyfills needed by Angular and is loaded before the app.
 | 
			
		||||
 * You can add your own extra polyfills to this file.
 | 
			
		||||
 *
 | 
			
		||||
 * This file is divided into 2 sections:
 | 
			
		||||
 *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
 | 
			
		||||
 *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
 | 
			
		||||
 *      file.
 | 
			
		||||
 *
 | 
			
		||||
 * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
 | 
			
		||||
 * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
 | 
			
		||||
 * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
 | 
			
		||||
 *
 | 
			
		||||
 * Learn more in https://angular.io/guide/browser-support
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/***************************************************************************************************
 | 
			
		||||
 * BROWSER POLYFILLS
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** IE11 requires the following for NgClass support on SVG elements */
 | 
			
		||||
// import 'classlist.js';  // Run `npm install --save classlist.js`.
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Web Animations `@angular/platform-browser/animations`
 | 
			
		||||
 * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
 | 
			
		||||
 * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
 | 
			
		||||
 */
 | 
			
		||||
// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * By default, zone.js will patch all possible macroTask and DomEvents
 | 
			
		||||
 * user can disable parts of macroTask/DomEvents patch by setting following flags
 | 
			
		||||
 * because those flags need to be set before `zone.js` being loaded, and webpack
 | 
			
		||||
 * will put import in the top of bundle, so user need to create a separate file
 | 
			
		||||
 * in this directory (for example: zone-flags.ts), and put the following flags
 | 
			
		||||
 * into that file, and then add the following code before importing zone.js.
 | 
			
		||||
 * import './zone-flags';
 | 
			
		||||
 *
 | 
			
		||||
 * The flags allowed in zone-flags.ts are listed here.
 | 
			
		||||
 *
 | 
			
		||||
 * The following flags will work for all browsers.
 | 
			
		||||
 *
 | 
			
		||||
 * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
 | 
			
		||||
 * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
 | 
			
		||||
 * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
 | 
			
		||||
 *
 | 
			
		||||
 *  in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
 | 
			
		||||
 *  with the following flag, it will bypass `zone.js` patch for IE/Edge
 | 
			
		||||
 *
 | 
			
		||||
 *  (window as any).__Zone_enable_cross_context_check = true;
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import './zone-flags';
 | 
			
		||||
 | 
			
		||||
/***************************************************************************************************
 | 
			
		||||
 * Zone JS is required by default for Angular itself.
 | 
			
		||||
 */
 | 
			
		||||
import 'zone.js/dist/zone';  // Included with Angular CLI.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***************************************************************************************************
 | 
			
		||||
 * APPLICATION IMPORTS
 | 
			
		||||
 */
 | 
			
		||||
							
								
								
									
										25
									
								
								ui/src/test.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								ui/src/test.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
 | 
			
		||||
 | 
			
		||||
import 'zone.js/dist/zone-testing';
 | 
			
		||||
import { getTestBed } from '@angular/core/testing';
 | 
			
		||||
import {
 | 
			
		||||
  BrowserDynamicTestingModule,
 | 
			
		||||
  platformBrowserDynamicTesting
 | 
			
		||||
} from '@angular/platform-browser-dynamic/testing';
 | 
			
		||||
 | 
			
		||||
declare const require: {
 | 
			
		||||
  context(path: string, deep?: boolean, filter?: RegExp): {
 | 
			
		||||
    <T>(id: string): T;
 | 
			
		||||
    keys(): string[];
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// First, initialize the Angular testing environment.
 | 
			
		||||
getTestBed().initTestEnvironment(
 | 
			
		||||
  BrowserDynamicTestingModule,
 | 
			
		||||
  platformBrowserDynamicTesting()
 | 
			
		||||
);
 | 
			
		||||
// Then we find all the tests.
 | 
			
		||||
const context = require.context('./', true, /\.spec\.ts$/);
 | 
			
		||||
// And load the modules.
 | 
			
		||||
context.keys().map(context);
 | 
			
		||||
							
								
								
									
										236
									
								
								ui/src/theme/variables.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										236
									
								
								ui/src/theme/variables.scss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,236 @@
 | 
			
		||||
// Ionic Variables and Theming. For more info, please see:
 | 
			
		||||
// http://ionicframework.com/docs/theming/
 | 
			
		||||
 | 
			
		||||
/** Ionic CSS Variables **/
 | 
			
		||||
:root {
 | 
			
		||||
  /** primary **/
 | 
			
		||||
  --ion-color-primary: #3880ff;
 | 
			
		||||
  --ion-color-primary-rgb: 56, 128, 255;
 | 
			
		||||
  --ion-color-primary-contrast: #ffffff;
 | 
			
		||||
  --ion-color-primary-contrast-rgb: 255, 255, 255;
 | 
			
		||||
  --ion-color-primary-shade: #3171e0;
 | 
			
		||||
  --ion-color-primary-tint: #4c8dff;
 | 
			
		||||
 | 
			
		||||
  /** secondary **/
 | 
			
		||||
  --ion-color-secondary: #3dc2ff;
 | 
			
		||||
  --ion-color-secondary-rgb: 61, 194, 255;
 | 
			
		||||
  --ion-color-secondary-contrast: #ffffff;
 | 
			
		||||
  --ion-color-secondary-contrast-rgb: 255, 255, 255;
 | 
			
		||||
  --ion-color-secondary-shade: #36abe0;
 | 
			
		||||
  --ion-color-secondary-tint: #50c8ff;
 | 
			
		||||
 | 
			
		||||
  /** tertiary **/
 | 
			
		||||
  --ion-color-tertiary: #5260ff;
 | 
			
		||||
  --ion-color-tertiary-rgb: 82, 96, 255;
 | 
			
		||||
  --ion-color-tertiary-contrast: #ffffff;
 | 
			
		||||
  --ion-color-tertiary-contrast-rgb: 255, 255, 255;
 | 
			
		||||
  --ion-color-tertiary-shade: #4854e0;
 | 
			
		||||
  --ion-color-tertiary-tint: #6370ff;
 | 
			
		||||
 | 
			
		||||
  /** success **/
 | 
			
		||||
  --ion-color-success: #2dd36f;
 | 
			
		||||
  --ion-color-success-rgb: 45, 211, 111;
 | 
			
		||||
  --ion-color-success-contrast: #ffffff;
 | 
			
		||||
  --ion-color-success-contrast-rgb: 255, 255, 255;
 | 
			
		||||
  --ion-color-success-shade: #28ba62;
 | 
			
		||||
  --ion-color-success-tint: #42d77d;
 | 
			
		||||
 | 
			
		||||
  /** warning **/
 | 
			
		||||
  --ion-color-warning: #ffc409;
 | 
			
		||||
  --ion-color-warning-rgb: 255, 196, 9;
 | 
			
		||||
  --ion-color-warning-contrast: #000000;
 | 
			
		||||
  --ion-color-warning-contrast-rgb: 0, 0, 0;
 | 
			
		||||
  --ion-color-warning-shade: #e0ac08;
 | 
			
		||||
  --ion-color-warning-tint: #ffca22;
 | 
			
		||||
 | 
			
		||||
  /** danger **/
 | 
			
		||||
  --ion-color-danger: #eb445a;
 | 
			
		||||
  --ion-color-danger-rgb: 235, 68, 90;
 | 
			
		||||
  --ion-color-danger-contrast: #ffffff;
 | 
			
		||||
  --ion-color-danger-contrast-rgb: 255, 255, 255;
 | 
			
		||||
  --ion-color-danger-shade: #cf3c4f;
 | 
			
		||||
  --ion-color-danger-tint: #ed576b;
 | 
			
		||||
 | 
			
		||||
  /** dark **/
 | 
			
		||||
  --ion-color-dark: #222428;
 | 
			
		||||
  --ion-color-dark-rgb: 34, 36, 40;
 | 
			
		||||
  --ion-color-dark-contrast: #ffffff;
 | 
			
		||||
  --ion-color-dark-contrast-rgb: 255, 255, 255;
 | 
			
		||||
  --ion-color-dark-shade: #1e2023;
 | 
			
		||||
  --ion-color-dark-tint: #383a3e;
 | 
			
		||||
 | 
			
		||||
  /** medium **/
 | 
			
		||||
  --ion-color-medium: #92949c;
 | 
			
		||||
  --ion-color-medium-rgb: 146, 148, 156;
 | 
			
		||||
  --ion-color-medium-contrast: #ffffff;
 | 
			
		||||
  --ion-color-medium-contrast-rgb: 255, 255, 255;
 | 
			
		||||
  --ion-color-medium-shade: #808289;
 | 
			
		||||
  --ion-color-medium-tint: #9d9fa6;
 | 
			
		||||
 | 
			
		||||
  /** light **/
 | 
			
		||||
  --ion-color-light: #f4f5f8;
 | 
			
		||||
  --ion-color-light-rgb: 244, 245, 248;
 | 
			
		||||
  --ion-color-light-contrast: #000000;
 | 
			
		||||
  --ion-color-light-contrast-rgb: 0, 0, 0;
 | 
			
		||||
  --ion-color-light-shade: #d7d8da;
 | 
			
		||||
  --ion-color-light-tint: #f5f6f9;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media (prefers-color-scheme: dark) {
 | 
			
		||||
  /*
 | 
			
		||||
   * Dark Colors
 | 
			
		||||
   * -------------------------------------------
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  body {
 | 
			
		||||
    --ion-color-primary: #428cff;
 | 
			
		||||
    --ion-color-primary-rgb: 66,140,255;
 | 
			
		||||
    --ion-color-primary-contrast: #ffffff;
 | 
			
		||||
    --ion-color-primary-contrast-rgb: 255,255,255;
 | 
			
		||||
    --ion-color-primary-shade: #3a7be0;
 | 
			
		||||
    --ion-color-primary-tint: #5598ff;
 | 
			
		||||
 | 
			
		||||
    --ion-color-secondary: #50c8ff;
 | 
			
		||||
    --ion-color-secondary-rgb: 80,200,255;
 | 
			
		||||
    --ion-color-secondary-contrast: #ffffff;
 | 
			
		||||
    --ion-color-secondary-contrast-rgb: 255,255,255;
 | 
			
		||||
    --ion-color-secondary-shade: #46b0e0;
 | 
			
		||||
    --ion-color-secondary-tint: #62ceff;
 | 
			
		||||
 | 
			
		||||
    --ion-color-tertiary: #6a64ff;
 | 
			
		||||
    --ion-color-tertiary-rgb: 106,100,255;
 | 
			
		||||
    --ion-color-tertiary-contrast: #ffffff;
 | 
			
		||||
    --ion-color-tertiary-contrast-rgb: 255,255,255;
 | 
			
		||||
    --ion-color-tertiary-shade: #5d58e0;
 | 
			
		||||
    --ion-color-tertiary-tint: #7974ff;
 | 
			
		||||
 | 
			
		||||
    --ion-color-success: #2fdf75;
 | 
			
		||||
    --ion-color-success-rgb: 47,223,117;
 | 
			
		||||
    --ion-color-success-contrast: #000000;
 | 
			
		||||
    --ion-color-success-contrast-rgb: 0,0,0;
 | 
			
		||||
    --ion-color-success-shade: #29c467;
 | 
			
		||||
    --ion-color-success-tint: #44e283;
 | 
			
		||||
 | 
			
		||||
    --ion-color-warning: #ffd534;
 | 
			
		||||
    --ion-color-warning-rgb: 255,213,52;
 | 
			
		||||
    --ion-color-warning-contrast: #000000;
 | 
			
		||||
    --ion-color-warning-contrast-rgb: 0,0,0;
 | 
			
		||||
    --ion-color-warning-shade: #e0bb2e;
 | 
			
		||||
    --ion-color-warning-tint: #ffd948;
 | 
			
		||||
 | 
			
		||||
    --ion-color-danger: #ff4961;
 | 
			
		||||
    --ion-color-danger-rgb: 255,73,97;
 | 
			
		||||
    --ion-color-danger-contrast: #ffffff;
 | 
			
		||||
    --ion-color-danger-contrast-rgb: 255,255,255;
 | 
			
		||||
    --ion-color-danger-shade: #e04055;
 | 
			
		||||
    --ion-color-danger-tint: #ff5b71;
 | 
			
		||||
 | 
			
		||||
    --ion-color-dark: #f4f5f8;
 | 
			
		||||
    --ion-color-dark-rgb: 244,245,248;
 | 
			
		||||
    --ion-color-dark-contrast: #000000;
 | 
			
		||||
    --ion-color-dark-contrast-rgb: 0,0,0;
 | 
			
		||||
    --ion-color-dark-shade: #d7d8da;
 | 
			
		||||
    --ion-color-dark-tint: #f5f6f9;
 | 
			
		||||
 | 
			
		||||
    --ion-color-medium: #989aa2;
 | 
			
		||||
    --ion-color-medium-rgb: 152,154,162;
 | 
			
		||||
    --ion-color-medium-contrast: #000000;
 | 
			
		||||
    --ion-color-medium-contrast-rgb: 0,0,0;
 | 
			
		||||
    --ion-color-medium-shade: #86888f;
 | 
			
		||||
    --ion-color-medium-tint: #a2a4ab;
 | 
			
		||||
 | 
			
		||||
    --ion-color-light: #222428;
 | 
			
		||||
    --ion-color-light-rgb: 34,36,40;
 | 
			
		||||
    --ion-color-light-contrast: #ffffff;
 | 
			
		||||
    --ion-color-light-contrast-rgb: 255,255,255;
 | 
			
		||||
    --ion-color-light-shade: #1e2023;
 | 
			
		||||
    --ion-color-light-tint: #383a3e;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * iOS Dark Theme
 | 
			
		||||
   * -------------------------------------------
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  .ios body {
 | 
			
		||||
    --ion-background-color: #000000;
 | 
			
		||||
    --ion-background-color-rgb: 0,0,0;
 | 
			
		||||
 | 
			
		||||
    --ion-text-color: #ffffff;
 | 
			
		||||
    --ion-text-color-rgb: 255,255,255;
 | 
			
		||||
 | 
			
		||||
    --ion-color-step-50: #0d0d0d;
 | 
			
		||||
    --ion-color-step-100: #1a1a1a;
 | 
			
		||||
    --ion-color-step-150: #262626;
 | 
			
		||||
    --ion-color-step-200: #333333;
 | 
			
		||||
    --ion-color-step-250: #404040;
 | 
			
		||||
    --ion-color-step-300: #4d4d4d;
 | 
			
		||||
    --ion-color-step-350: #595959;
 | 
			
		||||
    --ion-color-step-400: #666666;
 | 
			
		||||
    --ion-color-step-450: #737373;
 | 
			
		||||
    --ion-color-step-500: #808080;
 | 
			
		||||
    --ion-color-step-550: #8c8c8c;
 | 
			
		||||
    --ion-color-step-600: #999999;
 | 
			
		||||
    --ion-color-step-650: #a6a6a6;
 | 
			
		||||
    --ion-color-step-700: #b3b3b3;
 | 
			
		||||
    --ion-color-step-750: #bfbfbf;
 | 
			
		||||
    --ion-color-step-800: #cccccc;
 | 
			
		||||
    --ion-color-step-850: #d9d9d9;
 | 
			
		||||
    --ion-color-step-900: #e6e6e6;
 | 
			
		||||
    --ion-color-step-950: #f2f2f2;
 | 
			
		||||
 | 
			
		||||
    --ion-item-background: #000000;
 | 
			
		||||
 | 
			
		||||
    --ion-card-background: #1c1c1d;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  .ios ion-modal {
 | 
			
		||||
    --ion-background-color: var(--ion-color-step-100);
 | 
			
		||||
    --ion-toolbar-background: var(--ion-color-step-150);
 | 
			
		||||
    --ion-toolbar-border-color: var(--ion-color-step-250);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * Material Design Dark Theme
 | 
			
		||||
   * -------------------------------------------
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  .md body {
 | 
			
		||||
    --ion-background-color: #121212;
 | 
			
		||||
    --ion-background-color-rgb: 18,18,18;
 | 
			
		||||
 | 
			
		||||
    --ion-text-color: #ffffff;
 | 
			
		||||
    --ion-text-color-rgb: 255,255,255;
 | 
			
		||||
 | 
			
		||||
    --ion-border-color: #222222;
 | 
			
		||||
 | 
			
		||||
    --ion-color-step-50: #1e1e1e;
 | 
			
		||||
    --ion-color-step-100: #2a2a2a;
 | 
			
		||||
    --ion-color-step-150: #363636;
 | 
			
		||||
    --ion-color-step-200: #414141;
 | 
			
		||||
    --ion-color-step-250: #4d4d4d;
 | 
			
		||||
    --ion-color-step-300: #595959;
 | 
			
		||||
    --ion-color-step-350: #656565;
 | 
			
		||||
    --ion-color-step-400: #717171;
 | 
			
		||||
    --ion-color-step-450: #7d7d7d;
 | 
			
		||||
    --ion-color-step-500: #898989;
 | 
			
		||||
    --ion-color-step-550: #949494;
 | 
			
		||||
    --ion-color-step-600: #a0a0a0;
 | 
			
		||||
    --ion-color-step-650: #acacac;
 | 
			
		||||
    --ion-color-step-700: #b8b8b8;
 | 
			
		||||
    --ion-color-step-750: #c4c4c4;
 | 
			
		||||
    --ion-color-step-800: #d0d0d0;
 | 
			
		||||
    --ion-color-step-850: #dbdbdb;
 | 
			
		||||
    --ion-color-step-900: #e7e7e7;
 | 
			
		||||
    --ion-color-step-950: #f3f3f3;
 | 
			
		||||
 | 
			
		||||
    --ion-item-background: #1e1e1e;
 | 
			
		||||
 | 
			
		||||
    --ion-toolbar-background: #1f1f1f;
 | 
			
		||||
 | 
			
		||||
    --ion-tab-bar-background: #1f1f1f;
 | 
			
		||||
 | 
			
		||||
    --ion-card-background: #1e1e1e;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										6
									
								
								ui/src/zone-flags.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								ui/src/zone-flags.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Prevents Angular change detection from
 | 
			
		||||
 * running with certain Web Component callbacks
 | 
			
		||||
 */
 | 
			
		||||
// eslint-disable-next-line no-underscore-dangle
 | 
			
		||||
(window as any).__Zone_disable_customElements = true;
 | 
			
		||||
							
								
								
									
										15
									
								
								ui/tsconfig.app.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								ui/tsconfig.app.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
 | 
			
		||||
{
 | 
			
		||||
  "extends": "./tsconfig.json",
 | 
			
		||||
  "compilerOptions": {
 | 
			
		||||
    "outDir": "./out-tsc/app",
 | 
			
		||||
    "types": []
 | 
			
		||||
  },
 | 
			
		||||
  "files": [
 | 
			
		||||
    "src/main.ts",
 | 
			
		||||
    "src/polyfills.ts"
 | 
			
		||||
  ],
 | 
			
		||||
  "include": [
 | 
			
		||||
    "src/**/*.d.ts"
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										23
									
								
								ui/tsconfig.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								ui/tsconfig.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
 | 
			
		||||
{
 | 
			
		||||
  "compileOnSave": false,
 | 
			
		||||
  "compilerOptions": {
 | 
			
		||||
    "baseUrl": "./",
 | 
			
		||||
    "outDir": "./dist/out-tsc",
 | 
			
		||||
    "sourceMap": true,
 | 
			
		||||
    "declaration": false,
 | 
			
		||||
    "downlevelIteration": true,
 | 
			
		||||
    "experimentalDecorators": true,
 | 
			
		||||
    "moduleResolution": "node",
 | 
			
		||||
    "importHelpers": true,
 | 
			
		||||
    "target": "es2020",
 | 
			
		||||
    "module": "es2020",
 | 
			
		||||
    "lib": ["es2018", "dom"]
 | 
			
		||||
  },
 | 
			
		||||
  "angularCompilerOptions": {
 | 
			
		||||
    "enableI18nLegacyMessageIdFormat": false,
 | 
			
		||||
    "strictInjectionParameters": true,
 | 
			
		||||
    "strictInputAccessModifiers": true,
 | 
			
		||||
    "strictTemplates": true
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								ui/tsconfig.spec.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								ui/tsconfig.spec.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
 | 
			
		||||
{
 | 
			
		||||
  "extends": "./tsconfig.json",
 | 
			
		||||
  "compilerOptions": {
 | 
			
		||||
    "outDir": "./out-tsc/spec",
 | 
			
		||||
    "types": [
 | 
			
		||||
      "jasmine"
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  "files": [
 | 
			
		||||
    "src/test.ts",
 | 
			
		||||
    "src/polyfills.ts"
 | 
			
		||||
  ],
 | 
			
		||||
  "include": [
 | 
			
		||||
    "src/**/*.spec.ts",
 | 
			
		||||
    "src/**/*.d.ts"
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								webui/config.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								webui/config.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
var base_url = "http://localhost:8000/api/add/";
 | 
			
		||||
@@ -62,7 +62,7 @@ button {
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  margin-left: auto;
 | 
			
		||||
  margin-right: auto;
 | 
			
		||||
  width: 30%;
 | 
			
		||||
  width: auto;
 | 
			
		||||
  padding: 1em;
 | 
			
		||||
  padding-left: 4em;
 | 
			
		||||
  box-sizing: border-box;
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,7 @@ button {
 | 
			
		||||
    text-align: center;
 | 
			
		||||
    margin-left: auto;
 | 
			
		||||
    margin-right: auto;
 | 
			
		||||
    width: 30%;
 | 
			
		||||
    width: auto;
 | 
			
		||||
    padding: 1em;
 | 
			
		||||
    padding-left: 4em;
 | 
			
		||||
    box-sizing: border-box;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								webui/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								webui/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 264 KiB  | 
@@ -8,13 +8,12 @@
 | 
			
		||||
    <link rel="stylesheet" href="css/index.css"
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
    <script src="js/index.js"></script>
 | 
			
		||||
    <script src="config.js"></script>
 | 
			
		||||
    <script src="index.js"></script>
 | 
			
		||||
    <h1>Video Downloader</h1>
 | 
			
		||||
    <center>
 | 
			
		||||
        <form id="DownloadForm">
 | 
			
		||||
            <input type="text" name="url" id="url" placeholder="Enter your url here">
 | 
			
		||||
            <button type="submit" id="downloadbutton" onclick="ytdl()">Download</button>
 | 
			
		||||
        </form>
 | 
			
		||||
        <input type="text" name="url" id="url" placeholder="Enter your url here">
 | 
			
		||||
        <button type="submit" id="downloadbutton" onclick="ytdl()">Download</button>
 | 
			
		||||
    </center>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										51
									
								
								webui/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								webui/index.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,51 @@
 | 
			
		||||
// https://www.youtube.com/watch?v=HzqnQThFSX8&list=RDHzqnQThFSX8&start_radio=1
 | 
			
		||||
function ytdl() {
 | 
			
		||||
    var url = document.getElementById("url").value;
 | 
			
		||||
    const ytid = get_ytid(url);
 | 
			
		||||
    add_db(ytid);
 | 
			
		||||
    return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function get_ytid(url) {
 | 
			
		||||
    if (url === "") {
 | 
			
		||||
        alert("Please enter a URL");
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    if (url.includes("youtube.com/watch?v=")) {
 | 
			
		||||
        var ytid_prep1 = url.split("=");
 | 
			
		||||
        if (ytid_prep1[1].includes("&")) {
 | 
			
		||||
            var ytid_prep2 = ytid_prep1[1].split("&");
 | 
			
		||||
            var ytid = ytid_prep2[0];
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            var ytid = ytid_prep1[1];
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else if (url.includes("youtu.be/")) {
 | 
			
		||||
        var ytid_prep1 = url.split(".be/");
 | 
			
		||||
        var ytid = ytid_prep1[1];
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        alert("URL is not compliant with this website - I am kinda sorry(Just kidding)");
 | 
			
		||||
    }
 | 
			
		||||
    return ytid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function add_db(ytid) {
 | 
			
		||||
    var url = base_url.concat(ytid);
 | 
			
		||||
    console.log(url);
 | 
			
		||||
    let send_response = add_song(url);
 | 
			
		||||
    console.log("Send response:", send_response)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function add_song(url){
 | 
			
		||||
    var requestOptions = {
 | 
			
		||||
        method: 'GET',
 | 
			
		||||
        redirect: 'follow'
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    let response = await fetch(url, requestOptions);
 | 
			
		||||
    let data = await response.text();
 | 
			
		||||
    console.log(data)
 | 
			
		||||
    return data;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,27 +0,0 @@
 | 
			
		||||
// https://www.youtube.com/watch?v=HzqnQThFSX8&list=RDHzqnQThFSX8&start_radio=1
 | 
			
		||||
console.log("Log test");
 | 
			
		||||
 | 
			
		||||
function ytdl(){
 | 
			
		||||
    var url = document.getElementById("url");
 | 
			
		||||
    if(url.value === ""){
 | 
			
		||||
        alert("Please enter a URL")
 | 
			
		||||
        return
 | 
			
		||||
    }
 | 
			
		||||
    console.log(url.value);
 | 
			
		||||
    if(url.value.includes("youtube.com/watch?v=")){
 | 
			
		||||
        var ytid_prep1 = url.value.split("=");
 | 
			
		||||
        if(ytid_prep1[1].includes("&")){
 | 
			
		||||
            var ytid_prep2 = ytid_prep1[1].split("&");
 | 
			
		||||
            var ytid = ytid_prep2[0];
 | 
			
		||||
        } else {
 | 
			
		||||
            var ytid = ytid_prep1[1];
 | 
			
		||||
        }
 | 
			
		||||
    } else if(url.value.includes("youtu.be/")){
 | 
			
		||||
        var ytid_prep1 = url.value.split(".be/");
 | 
			
		||||
        var ytid = ytid_prep1[1];
 | 
			
		||||
    } else {
 | 
			
		||||
        alert("URL is not compliant with this website - I am kinda sorry(Just kidding)")
 | 
			
		||||
    }
 | 
			
		||||
    console.log(ytid);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user