diff --git a/.gitignore b/.gitignore index 4df95404..e0060526 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,7 @@ jspm_packages/ *.log components/core/debug-server.log -downloads/ + # UI ui/dist @@ -88,7 +88,6 @@ __pycache__/ build/ develop-eggs/ dist/ -downloads/ eggs/ .eggs/ lib/ @@ -235,3 +234,7 @@ tags .vscode/* # End of https://www.gitignore.io/api/vim,node,python,sublimetext,visualstudiocode + +###make empty folder in downloads +downloads/* +!downloads/.gitkeep \ No newline at end of file diff --git a/Bassa.sql b/Bassa.sql new file mode 100644 index 00000000..46c5a04a --- /dev/null +++ b/Bassa.sql @@ -0,0 +1,153 @@ +-- phpMyAdmin SQL Dump +-- version 4.7.4 +-- https://www.phpmyadmin.net/ +-- +-- Host: localhost +-- Generation Time: Dec 22, 2017 at 02:57 PM +-- Server version: 10.1.28-MariaDB +-- PHP Version: 7.1.11 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Database: `Bassa` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `compression` +-- + +CREATE TABLE IF NOT EXISTS `compression` ( + `id` varchar(255) NOT NULL, + `progress` tinyint(4) DEFAULT NULL, + `start_time` bigint(20) DEFAULT NULL, + `completed_time` bigint(20) DEFAULT NULL, + `deleted` tinyint(1) DEFAULT NULL, + UNIQUE KEY `id` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `download` +-- + +CREATE TABLE IF NOT EXISTS `download` ( + `id` bigint(20) NOT NULL, + `link` text NOT NULL, + `user_name` varchar(256) NOT NULL, + `download_name` varchar(256) NOT NULL, + `added_time` bigint(20) NOT NULL, + `status` tinyint(4) NOT NULL DEFAULT '0', + `rating` tinyint(4) NOT NULL DEFAULT '0', + `gid` varchar(256) DEFAULT NULL, + `completed_time` bigint(20) NOT NULL DEFAULT '0', + `size` varchar(7) NOT NULL DEFAULT '0', + `path` text +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `rate` +-- + +CREATE TABLE IF NOT EXISTS `rate` ( + `user_name` varchar(256) NOT NULL, + `id` bigint(20) NOT NULL, + `rate` tinyint(1) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `user` +-- + +CREATE TABLE IF NOT EXISTS `user` ( + `user_name` varchar(256) NOT NULL, + `password` varchar(256) NOT NULL, + `auth` tinyint(11) NOT NULL, + `email` varchar(256) NOT NULL, + `blocked` tinyint(1) NOT NULL DEFAULT '0', + `approved` tinyint(1) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `user` +-- + +INSERT INTO `user` (`user_name`, `password`, `auth`, `email`, `blocked`, `approved`) VALUES +('rand', '1a1dc91c907325c69271ddf0c944bc72', 0, 'dilankachathurangi@gmail.com', 0, 1), +('rush', '1a1dc91c907325c69271ddf0c944bc72', 1, 'mgdmadusanka@gmail.com', 0, 0), +('tom', '1a1dc91c907325c69271ddf0c944bc72', 0, 'tom@mail.com', 0, 0); + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `download` +-- +ALTER TABLE `download` + ADD PRIMARY KEY (`id`), + ADD UNIQUE KEY `id` (`id`), + ADD KEY `user_name` (`user_name`); + +-- +-- Indexes for table `rate` +-- +ALTER TABLE `rate` + ADD PRIMARY KEY (`user_name`,`id`), + ADD KEY `id` (`id`); + +-- +-- Indexes for table `user` +-- +ALTER TABLE `user` + ADD PRIMARY KEY (`user_name`), + ADD UNIQUE KEY `user_name` (`user_name`), + ADD UNIQUE KEY `email` (`email`); + +-- +-- AUTO_INCREMENT for dumped tables +-- + +-- +-- AUTO_INCREMENT for table `download` +-- +ALTER TABLE `download` + MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `download` +-- +ALTER TABLE `download` + ADD CONSTRAINT `download_ibfk_1` FOREIGN KEY (`user_name`) REFERENCES `user` (`user_name`); + +-- +-- Constraints for table `rate` +-- +ALTER TABLE `rate` + ADD CONSTRAINT `rate_ibfk_1` FOREIGN KEY (`user_name`) REFERENCES `user` (`user_name`), + ADD CONSTRAINT `rate_ibfk_2` FOREIGN KEY (`id`) REFERENCES `download` (`id`); +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file diff --git a/components/core/DBCon.py b/components/core/DBCon.py index 123340af..3d2b3380 100644 --- a/components/core/DBCon.py +++ b/components/core/DBCon.py @@ -7,7 +7,8 @@ def get_db_con () : global _db if _db==None: try: - _db=MySQLdb.connect("db", os.environ.get('BASSA_DB_USERNAME'), os.environ.get('BASSA_DB_PASSWORD'), os.environ.get('BASSA_DB_NAME')) + _db=MySQLdb.connect(host="localhost", user="root", passwd="",db= "Bassa") + return _db except: return None diff --git a/components/frontend-react/public/logo.png b/components/frontend-react/public/logo.png index b9553ff5..4ce25e17 100644 Binary files a/components/frontend-react/public/logo.png and b/components/frontend-react/public/logo.png differ diff --git a/downloads/.gitkeep b/downloads/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/ui/src/app/views/dashboard.html b/ui/src/app/views/dashboard.html index aeb638dd..c8b0650c 100755 --- a/ui/src/app/views/dashboard.html +++ b/ui/src/app/views/dashboard.html @@ -2,7 +2,7 @@ - + @@ -39,6 +39,4 @@

On going downloads

There are no queued downloads, please add some!

- - - + diff --git a/ui/src/app/views/login.html b/ui/src/app/views/login.html index 75cfc8a4..2dd6ac4b 100755 --- a/ui/src/app/views/login.html +++ b/ui/src/app/views/login.html @@ -16,10 +16,33 @@
-
+ + + + + + + +
+ + + + + + + +
+ + + + + + +
× Incorrect Credentials
× Please confirm your account -
-
\ No newline at end of file + + +