diff --git a/canisters/imgTank/main.mo b/canisters/imgTank/main.mo deleted file mode 100644 index 5105ad70..00000000 --- a/canisters/imgTank/main.mo +++ /dev/null @@ -1,167 +0,0 @@ -import Text "mo:base/Text"; -import Nat "mo:base/Nat"; -import Nat32 "mo:base/Nat32"; -import Nat64 "mo:base/Nat64"; -import Iter "mo:base/Iter"; - -import Blob "mo:base/Blob"; -import Array "mo:base/Array"; -import HttpTypes "../ext/HttpTypes"; - -import Memory "mo:base/ExperimentalStableMemory"; -import HashMap "mo:base/HashMap"; - -actor { - - type ImgId = Text; - - private stable var _currentMemoryOffset : Nat64 = 2; - private stable var _imgOffset : [(ImgId, Nat64)] = []; - private var imgOffset : HashMap.HashMap = HashMap.fromIter(_imgOffset.vals(), 0, Text.equal, Text.hash); - private stable var _imgSize : [(ImgId, Nat)] = []; - private var imgSize : HashMap.HashMap = HashMap.fromIter(_imgSize.vals(), 0, Text.equal, Text.hash); - - // thumbnail handling - private stable var _thumbs : [(ImgId, Blob)] = []; - private var thumbs = HashMap.HashMap(0, Text.equal, Text.hash); - - system func preupgrade() { - _imgOffset := Iter.toArray(imgOffset.entries()); - _imgSize := Iter.toArray(imgSize.entries()); - - _thumbs := Iter.toArray(thumbs.entries()); - }; - - system func postupgrade() { - _imgOffset := []; - _imgSize := []; - - thumbs := HashMap.fromIter(_thumbs.vals(), 10, Text.equal, Text.hash); - _thumbs := []; - }; - - public shared(msg) func uploadImg(imgId : ImgId, image : Blob) { - storeBlobImg(imgId, image); - }; - - public shared(msg) func uploadThumbnail(imgId : ImgId, thumbnail : Blob) { - thumbs.put(imgId, thumbnail); - }; - - public query({ caller }) func getPic(id : ImgId): async Blob { - var pic = loadBlobImg(id); - switch(pic) { - case (null) { - return Blob.fromArray([]); - }; - case (?existingPic) { - return existingPic; - }; - }; - }; - - public query({ caller }) func getThumbnail(id : ImgId): async Blob { - var pic = thumbs.get(id); - switch(pic) { - case (null) { - return Blob.fromArray([]); - }; - case (?existingPic) { - return existingPic; - }; - }; - }; - - private func storeBlobImg(imgId : ImgId, value : Blob) { - var size : Nat = Nat32.toNat(Nat32.fromIntWrap(value.size())); - // Each page is 64KiB (65536 bytes) - var growBy : Nat = size / 65536 + 1; - let a = Memory.grow(Nat64.fromNat(growBy)); - Memory.storeBlob(_currentMemoryOffset, value); - imgOffset.put(imgId, _currentMemoryOffset); - imgSize.put(imgId, size); - size := size + 4; - _currentMemoryOffset += Nat64.fromNat(size); - }; - - private func loadBlobImg(imgId : ImgId) : ?Blob { - let offset = imgOffset.get(imgId); - switch(offset) { - case (null) { - return null; - }; - case (?offset) { - let size = imgSize.get(imgId); - switch(size) { - case (null) { - return null; - }; - case (?size) { - return ?Memory.loadBlob(offset, size); - }; - }; - }; - }; - }; - - public query func http_request(request : HttpTypes.Request) : async HttpTypes.Response { - if (Text.contains(request.url, #text("imgid"))) { - let imgId = Iter.toArray(Text.tokens(request.url, #text("imgid=")))[1]; - - if (Text.contains(request.url, #text("thumbnail"))) { - var pic = thumbs.get(imgId); - switch(pic) { - case (null) { - return http404(?"no pic available"); - }; - case (?existingPic) { - return picture(existingPic); - }; - }; - } else { - var pic = loadBlobImg(imgId); - switch(pic) { - case (null) { - return http404(?"no thumbnail available"); - }; - case (?existingPic) { - return picture(existingPic); - }; - }; - }; - }; - return http404(?"Path not found."); - }; - - // A 200 Ok response with picture - private func picture(pic : Blob) : HttpTypes.Response { - { - body = pic; - headers = [ - ("Content-Type", "image/jpg"), - ("Access-Control-Allow-Origin", "*"), - ("Expires", "Wed, 9 Jan 2099 09:09:09 GMT") - ]; - status_code = 200; - streaming_strategy = null; - }; - }; - - // A 404 response with an optional error message. - private func http404(msg : ?Text) : HttpTypes.Response { - { - body = Text.encodeUtf8( - switch (msg) { - case (?msg) msg; - case null "Not found."; - } - ); - headers = [ - ("Content-Type", "text/plain"), - ]; - status_code = 404; - streaming_strategy = null; - }; - }; - -}; diff --git a/frontend/Home.vue b/frontend/Home.vue deleted file mode 100644 index f9fa4f53..00000000 --- a/frontend/Home.vue +++ /dev/null @@ -1,400 +0,0 @@ - - - - - diff --git a/frontend/assets/add-circle.png b/frontend/assets/add-circle.png deleted file mode 100644 index 9a8a289d..00000000 Binary files a/frontend/assets/add-circle.png and /dev/null differ diff --git a/frontend/assets/attendance.png b/frontend/assets/attendance.png deleted file mode 100644 index 0f6f0286..00000000 Binary files a/frontend/assets/attendance.png and /dev/null differ diff --git a/frontend/assets/briefcase 04.png b/frontend/assets/briefcase 04.png deleted file mode 100644 index b8bd15ca..00000000 Binary files a/frontend/assets/briefcase 04.png and /dev/null differ diff --git a/frontend/assets/candidates.png b/frontend/assets/candidates.png deleted file mode 100644 index 426fcdcc..00000000 Binary files a/frontend/assets/candidates.png and /dev/null differ diff --git a/frontend/assets/darklogo.png b/frontend/assets/darklogo.png deleted file mode 100644 index f26c34dc..00000000 Binary files a/frontend/assets/darklogo.png and /dev/null differ diff --git a/frontend/assets/dashboard.png b/frontend/assets/dashboard.png deleted file mode 100644 index f8ebf682..00000000 Binary files a/frontend/assets/dashboard.png and /dev/null differ diff --git a/frontend/assets/departments.png b/frontend/assets/departments.png deleted file mode 100644 index 10402cb2..00000000 Binary files a/frontend/assets/departments.png and /dev/null differ diff --git a/frontend/assets/direction-down 01.png b/frontend/assets/direction-down 01.png deleted file mode 100644 index 375abdaa..00000000 Binary files a/frontend/assets/direction-down 01.png and /dev/null differ diff --git a/frontend/assets/direction-down 02.png b/frontend/assets/direction-down 02.png deleted file mode 100644 index d04f74cf..00000000 Binary files a/frontend/assets/direction-down 02.png and /dev/null differ diff --git a/frontend/assets/direction-right.png b/frontend/assets/direction-right.png deleted file mode 100644 index 22994ebe..00000000 Binary files a/frontend/assets/direction-right.png and /dev/null differ diff --git a/frontend/assets/down-arrow.png b/frontend/assets/down-arrow.png deleted file mode 100644 index 53a444c1..00000000 Binary files a/frontend/assets/down-arrow.png and /dev/null differ diff --git a/frontend/assets/dp.png b/frontend/assets/dp.png deleted file mode 100644 index 31ef1a98..00000000 Binary files a/frontend/assets/dp.png and /dev/null differ diff --git a/frontend/assets/edit.png b/frontend/assets/edit.png deleted file mode 100644 index 0686da8d..00000000 Binary files a/frontend/assets/edit.png and /dev/null differ diff --git a/frontend/assets/employees.png b/frontend/assets/employees.png deleted file mode 100644 index d186b515..00000000 Binary files a/frontend/assets/employees.png and /dev/null differ diff --git a/frontend/assets/favicon.svg b/frontend/assets/favicon.svg deleted file mode 100644 index de4aeddc..00000000 --- a/frontend/assets/favicon.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/frontend/assets/filter.png b/frontend/assets/filter.png deleted file mode 100644 index fced76cf..00000000 Binary files a/frontend/assets/filter.png and /dev/null differ diff --git a/frontend/assets/holidays.png b/frontend/assets/holidays.png deleted file mode 100644 index e2f95349..00000000 Binary files a/frontend/assets/holidays.png and /dev/null differ diff --git a/frontend/assets/jobs.png b/frontend/assets/jobs.png deleted file mode 100644 index e64a1307..00000000 Binary files a/frontend/assets/jobs.png and /dev/null differ diff --git a/frontend/assets/leaves.png b/frontend/assets/leaves.png deleted file mode 100644 index 8fd3c43a..00000000 Binary files a/frontend/assets/leaves.png and /dev/null differ diff --git a/frontend/assets/logo-dark.svg b/frontend/assets/logo-dark.svg deleted file mode 100644 index c3e79d44..00000000 --- a/frontend/assets/logo-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/assets/logo.png b/frontend/assets/logo.png deleted file mode 100644 index a0a61701..00000000 Binary files a/frontend/assets/logo.png and /dev/null differ diff --git a/frontend/assets/payroll.png b/frontend/assets/payroll.png deleted file mode 100644 index 872dae66..00000000 Binary files a/frontend/assets/payroll.png and /dev/null differ diff --git a/frontend/assets/photo.png b/frontend/assets/photo.png deleted file mode 100644 index 9dc745df..00000000 Binary files a/frontend/assets/photo.png and /dev/null differ diff --git a/frontend/assets/settings.png b/frontend/assets/settings.png deleted file mode 100644 index f931496d..00000000 Binary files a/frontend/assets/settings.png and /dev/null differ diff --git a/frontend/assets/totalemp.png b/frontend/assets/totalemp.png deleted file mode 100644 index cffbe4b5..00000000 Binary files a/frontend/assets/totalemp.png and /dev/null differ diff --git a/frontend/assets/trash.png b/frontend/assets/trash.png deleted file mode 100644 index dfa06190..00000000 Binary files a/frontend/assets/trash.png and /dev/null differ diff --git a/frontend/assets/up-arrow.png b/frontend/assets/up-arrow.png deleted file mode 100644 index a50d9b33..00000000 Binary files a/frontend/assets/up-arrow.png and /dev/null differ diff --git a/frontend/assets/view.png b/frontend/assets/view.png deleted file mode 100644 index 900c7644..00000000 Binary files a/frontend/assets/view.png and /dev/null differ diff --git a/frontend/components/AccountAccess.vue b/frontend/components/AccountAccess.vue deleted file mode 100644 index 8334b169..00000000 --- a/frontend/components/AccountAccess.vue +++ /dev/null @@ -1,308 +0,0 @@ - - \ No newline at end of file diff --git a/frontend/components/AccountSwitcher.vue b/frontend/components/AccountSwitcher.vue deleted file mode 100644 index b9ef8472..00000000 --- a/frontend/components/AccountSwitcher.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - diff --git a/frontend/components/AssetUpload.vue b/frontend/components/AssetUpload.vue deleted file mode 100644 index 3c7c0853..00000000 --- a/frontend/components/AssetUpload.vue +++ /dev/null @@ -1,24 +0,0 @@ - - diff --git a/frontend/components/BtnPill.vue b/frontend/components/BtnPill.vue deleted file mode 100644 index 28c508f4..00000000 --- a/frontend/components/BtnPill.vue +++ /dev/null @@ -1,27 +0,0 @@ - - diff --git a/frontend/components/Button.vue b/frontend/components/Button.vue deleted file mode 100644 index afcd980f..00000000 --- a/frontend/components/Button.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/frontend/components/ButtonWhite.vue b/frontend/components/ButtonWhite.vue deleted file mode 100644 index 01cb85be..00000000 --- a/frontend/components/ButtonWhite.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/frontend/components/Calendar.vue b/frontend/components/Calendar.vue deleted file mode 100644 index d632f5ea..00000000 --- a/frontend/components/Calendar.vue +++ /dev/null @@ -1,215 +0,0 @@ - - - diff --git a/frontend/components/DepartmentCard.vue b/frontend/components/DepartmentCard.vue deleted file mode 100644 index 6435cf86..00000000 --- a/frontend/components/DepartmentCard.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - - - diff --git a/frontend/components/Documents.vue b/frontend/components/Documents.vue deleted file mode 100644 index 4c691500..00000000 --- a/frontend/components/Documents.vue +++ /dev/null @@ -1,71 +0,0 @@ - - \ No newline at end of file diff --git a/frontend/components/EmployeeDepartmentCard.vue b/frontend/components/EmployeeDepartmentCard.vue deleted file mode 100644 index 04529e29..00000000 --- a/frontend/components/EmployeeDepartmentCard.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/frontend/components/Employees/DatePicker.vue b/frontend/components/Employees/DatePicker.vue deleted file mode 100644 index fa6b0ce1..00000000 --- a/frontend/components/Employees/DatePicker.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - \ No newline at end of file diff --git a/frontend/components/Employees/EmployeeSideBar.vue b/frontend/components/Employees/EmployeeSideBar.vue deleted file mode 100644 index d8f6225e..00000000 --- a/frontend/components/Employees/EmployeeSideBar.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/frontend/components/Employees/MenuItem.vue b/frontend/components/Employees/MenuItem.vue deleted file mode 100644 index f36466d2..00000000 --- a/frontend/components/Employees/MenuItem.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/frontend/components/Gender.vue b/frontend/components/Gender.vue deleted file mode 100644 index 2c86125f..00000000 --- a/frontend/components/Gender.vue +++ /dev/null @@ -1,30 +0,0 @@ - - diff --git a/frontend/components/Header.vue b/frontend/components/Header.vue deleted file mode 100644 index 009d16fa..00000000 --- a/frontend/components/Header.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - diff --git a/frontend/components/JobCard.vue b/frontend/components/JobCard.vue deleted file mode 100644 index c472ea3a..00000000 --- a/frontend/components/JobCard.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/frontend/components/LoggedIn.vue b/frontend/components/LoggedIn.vue deleted file mode 100644 index 14182007..00000000 --- a/frontend/components/LoggedIn.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - diff --git a/frontend/components/MainHeader.vue b/frontend/components/MainHeader.vue deleted file mode 100644 index 7e0467e4..00000000 --- a/frontend/components/MainHeader.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - diff --git a/frontend/components/Marital.vue b/frontend/components/Marital.vue deleted file mode 100644 index 6788aa3e..00000000 --- a/frontend/components/Marital.vue +++ /dev/null @@ -1,26 +0,0 @@ - - diff --git a/frontend/components/Modal.vue b/frontend/components/Modal.vue deleted file mode 100644 index db948c81..00000000 --- a/frontend/components/Modal.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - diff --git a/frontend/components/MultiStepForm.vue b/frontend/components/MultiStepForm.vue deleted file mode 100644 index 1fecb0c4..00000000 --- a/frontend/components/MultiStepForm.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - - - diff --git a/frontend/components/Nationality.vue b/frontend/components/Nationality.vue deleted file mode 100644 index ac58632c..00000000 --- a/frontend/components/Nationality.vue +++ /dev/null @@ -1,25 +0,0 @@ - - diff --git a/frontend/components/Navbar.vue b/frontend/components/Navbar.vue deleted file mode 100644 index f8bd6bfb..00000000 --- a/frontend/components/Navbar.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/components/NotificationCard.vue b/frontend/components/NotificationCard.vue deleted file mode 100644 index 28182fdb..00000000 --- a/frontend/components/NotificationCard.vue +++ /dev/null @@ -1,39 +0,0 @@ - - diff --git a/frontend/components/OverviewCard.vue b/frontend/components/OverviewCard.vue deleted file mode 100644 index bf2dca5f..00000000 --- a/frontend/components/OverviewCard.vue +++ /dev/null @@ -1,35 +0,0 @@ - - diff --git a/frontend/components/PersonalInformation.vue b/frontend/components/PersonalInformation.vue deleted file mode 100644 index 89c46fb3..00000000 --- a/frontend/components/PersonalInformation.vue +++ /dev/null @@ -1,15 +0,0 @@ - - \ No newline at end of file diff --git a/frontend/components/ProfessionalInformation.vue b/frontend/components/ProfessionalInformation.vue deleted file mode 100644 index 07aff344..00000000 --- a/frontend/components/ProfessionalInformation.vue +++ /dev/null @@ -1,309 +0,0 @@ - - \ No newline at end of file diff --git a/frontend/components/ProfileHeader.vue b/frontend/components/ProfileHeader.vue deleted file mode 100644 index 7f080414..00000000 --- a/frontend/components/ProfileHeader.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - diff --git a/frontend/components/Searchbar.vue b/frontend/components/Searchbar.vue deleted file mode 100644 index 78d30a80..00000000 --- a/frontend/components/Searchbar.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - - - diff --git a/frontend/components/SettingsCard.vue b/frontend/components/SettingsCard.vue deleted file mode 100644 index 1344865f..00000000 --- a/frontend/components/SettingsCard.vue +++ /dev/null @@ -1,31 +0,0 @@ - - diff --git a/frontend/components/Sidebar.vue b/frontend/components/Sidebar.vue deleted file mode 100644 index 17eebbbe..00000000 --- a/frontend/components/Sidebar.vue +++ /dev/null @@ -1,236 +0,0 @@ - - diff --git a/frontend/components/SkeletonLoader.vue b/frontend/components/SkeletonLoader.vue deleted file mode 100644 index 2057a1de..00000000 --- a/frontend/components/SkeletonLoader.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - diff --git a/frontend/components/StatusButton.vue b/frontend/components/StatusButton.vue deleted file mode 100644 index f80d57d4..00000000 --- a/frontend/components/StatusButton.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/frontend/components/StatusPill.vue b/frontend/components/StatusPill.vue deleted file mode 100644 index 51cb8e56..00000000 --- a/frontend/components/StatusPill.vue +++ /dev/null @@ -1,19 +0,0 @@ - - diff --git a/frontend/components/TableComponent.vue b/frontend/components/TableComponent.vue deleted file mode 100644 index 8a7f236d..00000000 --- a/frontend/components/TableComponent.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - - - diff --git a/frontend/components/TextInput.vue b/frontend/components/TextInput.vue deleted file mode 100644 index 51b4de8a..00000000 --- a/frontend/components/TextInput.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/frontend/components/TransactionCard.vue b/frontend/components/TransactionCard.vue deleted file mode 100644 index 07299c99..00000000 --- a/frontend/components/TransactionCard.vue +++ /dev/null @@ -1,112 +0,0 @@ - - diff --git a/frontend/components/TrendCard.vue b/frontend/components/TrendCard.vue deleted file mode 100644 index 5e2b83bf..00000000 --- a/frontend/components/TrendCard.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - - - diff --git a/frontend/components/ViewAccountAccess.vue b/frontend/components/ViewAccountAccess.vue deleted file mode 100644 index 27e0f695..00000000 --- a/frontend/components/ViewAccountAccess.vue +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/frontend/components/ViewDocuments.vue b/frontend/components/ViewDocuments.vue deleted file mode 100644 index 27e0f695..00000000 --- a/frontend/components/ViewDocuments.vue +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/frontend/components/ViewPersonalInformation.vue b/frontend/components/ViewPersonalInformation.vue deleted file mode 100644 index 27e0f695..00000000 --- a/frontend/components/ViewPersonalInformation.vue +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/frontend/components/ViewProfessionalInformation.vue b/frontend/components/ViewProfessionalInformation.vue deleted file mode 100644 index 27e0f695..00000000 --- a/frontend/components/ViewProfessionalInformation.vue +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/frontend/components/freelancers/AccountAccess.vue b/frontend/components/freelancers/AccountAccess.vue deleted file mode 100644 index 48738bab..00000000 --- a/frontend/components/freelancers/AccountAccess.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/frontend/components/freelancers/Documents.vue b/frontend/components/freelancers/Documents.vue deleted file mode 100644 index 05b1c7f2..00000000 --- a/frontend/components/freelancers/Documents.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - - - diff --git a/frontend/components/freelancers/PaymentMethods.vue b/frontend/components/freelancers/PaymentMethods.vue deleted file mode 100644 index ca2fd481..00000000 --- a/frontend/components/freelancers/PaymentMethods.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - diff --git a/frontend/components/freelancers/PersonalInformation.vue b/frontend/components/freelancers/PersonalInformation.vue deleted file mode 100644 index 8dfe79a4..00000000 --- a/frontend/components/freelancers/PersonalInformation.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - diff --git a/frontend/components/freelancers/ProfessionalInformation.vue b/frontend/components/freelancers/ProfessionalInformation.vue deleted file mode 100644 index dfcd0294..00000000 --- a/frontend/components/freelancers/ProfessionalInformation.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/frontend/components/onboarding/UserType.vue b/frontend/components/onboarding/UserType.vue deleted file mode 100644 index 6b26d95d..00000000 --- a/frontend/components/onboarding/UserType.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/frontend/data/data.json b/frontend/data/data.json deleted file mode 100644 index 6050a42d..00000000 --- a/frontend/data/data.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "company": { - "name": "ABC Corporation", - "departments": [ - { - "name": "Human Resources", - "employees": [ - { - "firstname": "John", - "lastname": "Doe", - "mobile": "123-456-7890", - "email": "john.doe@example.com", - "address": "123 Main St, Cityville", - "gender": "Male", - "nationality": "American", - "state": "CA", - "zip": "90001", - "code": "HR001", - "employeeId": "EMP001", - "username": "john_doe" - }, - { - "firstname": "Jane", - "lastname": "Smith", - "mobile": "987-654-3210", - "email": "jane.smith@example.com", - "address": "456 Oak St, Townsville", - "gender": "Female", - "nationality": "Canadian", - "state": "ON", - "zip": "M5A 1A1", - "code": "HR002", - "employeeId": "EMP002", - "username": "jane_smith" - } - ] - }, - { - "name": "Finance", - "employees": [ - { - "firstname": "Robert", - "lastname": "Johnson", - "mobile": "555-123-4567", - "email": "robert.johnson@example.com", - "address": "789 Pine St, Villageton", - "gender": "Male", - "nationality": "British", - "state": "NY", - "zip": "10001", - "code": "FN001", - "employeeId": "EMP003", - "username": "robert_johnson" - }, - { - "firstname": "Elena", - "lastname": "Garcia", - "mobile": "888-987-6543", - "email": "elena.garcia@example.com", - "address": "321 Elm St, Hamletville", - "gender": "Female", - "nationality": "Spanish", - "state": "TX", - "zip": "75001", - "code": "FN002", - "employeeId": "EMP004", - "username": "elena_garcia" - } - ] - }, - { - "name": "Engineering", - "employees": [ - { - "firstname": "Robert", - "lastname": "Johnson", - "mobile": "555-123-4567", - "email": "robert.johnson@example.com", - "address": "789 Pine St, Villageton", - "gender": "Male", - "nationality": "British", - "state": "NY", - "zip": "10001", - "code": "FN001", - "employeeId": "EMP003", - "username": "robert_johnson" - }, - { - "firstname": "Elena", - "lastname": "Garcia", - "mobile": "888-987-6543", - "email": "elena.garcia@example.com", - "address": "321 Elm St, Hamletville", - "gender": "Female", - "nationality": "Spanish", - "state": "TX", - "zip": "75001", - "code": "FN002", - "employeeId": "EMP004", - "username": "elena_garcia" - } - ] - }, - { - "name": "Frontend", - "employees": [ - { - "firstname": "Robert", - "lastname": "Johnson", - "mobile": "555-123-4567", - "email": "robert.johnson@example.com", - "address": "789 Pine St, Villageton", - "gender": "Male", - "nationality": "British", - "state": "NY", - "zip": "10001", - "code": "FN001", - "employeeId": "EMP003", - "username": "robert_johnson" - }, - { - "firstname": "Elena", - "lastname": "Garcia", - "mobile": "888-987-6543", - "email": "elena.garcia@example.com", - "address": "321 Elm St, Hamletville", - "gender": "Female", - "nationality": "Spanish", - "state": "TX", - "zip": "75001", - "code": "FN002", - "employeeId": "EMP004", - "username": "elena_garcia" - } - ] - } - ] - } -} diff --git a/frontend/freelancer/Dashboard.vue b/frontend/freelancer/Dashboard.vue deleted file mode 100644 index 2170cd19..00000000 --- a/frontend/freelancer/Dashboard.vue +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/frontend/index.css b/frontend/index.css deleted file mode 100644 index 0752b29d..00000000 --- a/frontend/index.css +++ /dev/null @@ -1,6 +0,0 @@ -@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap"); -@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@100;200;300;400;500;600;700;800;900&display=swap"); - -@tailwind base; -@tailwind components; -@tailwind utilities; diff --git a/frontend/store/auth.js b/frontend/store/auth.js index 3a623bcd..f4b252be 100644 --- a/frontend/store/auth.js +++ b/frontend/store/auth.js @@ -1,9 +1,39 @@ import { defineStore } from "pinia"; import { AuthClient } from "@dfinity/auth-client"; +<<<<<<< HEAD +import { createActor, canisterId } from "../../src/declarations/backend"; +import { toRaw } from "vue"; +import { ethers } from 'ethers'; +import { ref } from "vue"; +import { Actor } from '@dfinity/agent'; +import { Ed25519KeyIdentity } from '@dfinity/identity'; +import { useMetaMaskWallet } from "vue-connect-wallet"; +import { SiweMessage } from 'siwe'; +import { siwe_ic, canisterId as canID } from "../../src/declarations/siwe_ic"; +import { Principal } from "@dfinity/principal"; + +const address = ref(""); +const principal = ref(""); +const wallet = useMetaMaskWallet(); + + + + + + +const isConnected = async () => { + const accounts = await wallet.getAccounts(); + if (typeof accounts === "string") return false; + return accounts.length > 0; +}; + + +======= import {HttpAgent} from '@dfinity/agent'; import { createActor, canisterId } from "../../src/declarations/backend"; import { toRaw } from "vue"; import Swal from "sweetalert2"; +>>>>>>> workingpoint const defaultOptions = { /** @@ -33,9 +63,21 @@ function actorFromIdentity(identity) { identity, }, }); +<<<<<<< HEAD +} + +function actorFromEthIdentity(identity) { + return createActor(canId, { + agentOptions: { + identity, + }, + }); +} +======= }; +>>>>>>> workingpoint export const useAuthStore = defineStore("auth", { id: "auth", state: () => { @@ -73,12 +115,61 @@ export const useAuthStore = defineStore("auth", { }, actions: { async init() { +<<<<<<< HEAD + // const authClient = await AuthClient.create(defaultOptions.createOptions); + // this.authClient = authClient; + // const isAuthenticated = await authClient.isAuthenticated(); + // const identity = isAuthenticated ? authClient.getIdentity() : null; + // const whoamiActor = identity ? actorFromIdentity(identity) : null; + + // this.isAuthenticated = isAuthenticated; + // this.identity = identity; + // this.whoamiActor = whoamiActor; + // this.isReady = true; + // this.isRegistered = false; + if (this.authType === "internet-identity"){ + const authClient = await AuthClient.create(defaultOptions.createOptions); + this.authClient = authClient; + const isAuthenticated = await authClient.isAuthenticated(); + const identity = isAuthenticated ? authClient.getIdentity() : null; + const whoamiActor = identity ? actorFromIdentity(identity) : null; + + console.log('internet-identity' + whoamiActor); + + this.isAuthenticated = isAuthenticated; + this.identity = identity; + this.whoamiActor = whoamiActor; + this.isReady = true; + this.isRegistered = false; + }else if(this.authType === "connect2ic"){ + this.isReady = true; + this.isRegistered = false; + }else if(this.authType === "siwe"){ + const wallet = useMetaMaskWallet(); + const accounts = await wallet.getAccounts(); + const isAuthenticated = async () => { + return Array.isArray(accounts) && accounts.length > 0; + }; + const identity = isAuthenticated ? Ed25519KeyIdentity.generate() : null; + const whoamiActor = identity ? actorFromIdentity(identity) : null; + + console.log('siwe' + whoamiActor); + + this.isAuthenticated = isAuthenticated; + this.identity = identity; + this.whoamiActor = whoamiActor; + this.isReady = true; + this.isRegistered = false; + } + +======= const authClient = await AuthClient.create(defaultOptions.createOptions); this.authClient = authClient; const isAuthenticated = await authClient.isAuthenticated(); const identity = isAuthenticated ? authClient.getIdentity() : null; const whoamiActor = identity ? actorFromIdentity(identity) : null; +>>>>>>> workingpoint this.isAuthenticated = isAuthenticated; this.identity = identity; @@ -108,8 +199,31 @@ export const useAuthStore = defineStore("auth", { }, async connect2ic() {}, +<<<<<<< HEAD + + async connect () { + const accounts = await wallet.connect(); + if (typeof accounts === "string") { + console.log("An error occurred" + accounts); + } + + console.log('accounts' + accounts) + + const statement = 'Sign in with Ethereum'; + const identity = await Ed25519KeyIdentity.generate(); + principal.value = identity.getPrincipal(); + console.log('identity' + identity.getPrincipal()); + + address.value = accounts[0]; + console.log("Connected to account: ", accounts[0]); + }, + async switchAccount () { + await wallet.switchAccounts(); + await this.connect(); +======= async siwe() { // const { login, clear, identity } = useSiweIdentity(); +>>>>>>> workingpoint }, async getBalance() { @@ -118,6 +232,8 @@ export const useAuthStore = defineStore("auth", { this.tradingbalance = await balance; }, +<<<<<<< HEAD +======= async decodeAddress(){ //pseudocode for decoding address // decodeAccount(text) = case Principal.fromText(text) of @@ -135,6 +251,7 @@ export const useAuthStore = defineStore("auth", { }, +>>>>>>> workingpoint async refresh() { //const whoamiActor = toRaw(this.whoamiActor); @@ -161,8 +278,13 @@ export const useAuthStore = defineStore("auth", { this.identity = null; this.whoamiActor = null; }, +<<<<<<< HEAD + + async siwelogout(){ +======= async siwelogout() { +>>>>>>> workingpoint await siwe.clear_session(); }, updateRegistrationData(data) { diff --git a/frontend/utils/formatCkBtc.ts b/frontend/utils/formatCkBtc.ts deleted file mode 100644 index 530e8e72..00000000 --- a/frontend/utils/formatCkBtc.ts +++ /dev/null @@ -1,10 +0,0 @@ -export function formatCkBtc(amount: bigint | number | null | undefined) { - if (amount === undefined) return "0"; - amount = typeof amount === "number" ? BigInt(amount) : amount; - if (!amount) return "0"; - const integerPart = amount / 100000000n; - const fractionalPart = amount % 100000000n; - const fractionalPartString = fractionalPart.toString().padStart(8, "0"); - const fractionalPartTrimmed = fractionalPartString.replace(/0+$/, ""); // Removes trailing zeroes - return `${integerPart.toLocaleString()}.${fractionalPartTrimmed}`; -} diff --git a/frontend/utils/idl.js b/frontend/utils/idl.js deleted file mode 100644 index 9afc6640..00000000 --- a/frontend/utils/idl.js +++ /dev/null @@ -1,39 +0,0 @@ -// Convert a Motoko list to a JavaScript array. -export function fromList(list) { - if (list.length == 0) { - return []; - } else { - const tuple = list[0]; - const array = fromList(tuple[1]); - array.unshift(tuple[0]); - return array; - } -} - -// Convert a JavaScript array to a Motoko list. -export function toList(array) { - return array.reduceRight((accum, x) => { - return [[x, accum]]; - }, []); -} - -// Convert a Motoko optional to a JavaScript object. -export function fromOptional(optional) { - return optional.length > 0 ? optional[0] : null; -} - -// Convert a JavaScript object to a Motoko optional. -export function toOptional(object) { - return object ? [object] : []; -} - -export function formatCkBtc(amount) { - if (amount === undefined) return "0"; - amount = typeof amount === "number" ? BigInt(amount) : amount; - if (!amount) return "0"; - const integerPart = amount / 100000000n; - const fractionalPart = amount % 100000000n; - const fractionalPartString = fractionalPart.toString().padStart(8, "0"); - const fractionalPartTrimmed = fractionalPartString.replace(/0+$/, ""); // Removes trailing zeroes - return `${integerPart.toLocaleString()}.${fractionalPartTrimmed}`; -} diff --git a/frontend/views/AddEmployee.vue b/frontend/views/AddEmployee.vue deleted file mode 100644 index ceeaefb9..00000000 --- a/frontend/views/AddEmployee.vue +++ /dev/null @@ -1,152 +0,0 @@ - - - diff --git a/frontend/views/AllEmployees.vue b/frontend/views/AllEmployees.vue deleted file mode 100644 index eaa9e663..00000000 --- a/frontend/views/AllEmployees.vue +++ /dev/null @@ -1,441 +0,0 @@ - - diff --git a/frontend/views/Attendance.vue b/frontend/views/Attendance.vue deleted file mode 100644 index 8c5bf953..00000000 --- a/frontend/views/Attendance.vue +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/frontend/views/Candidates.vue b/frontend/views/Candidates.vue deleted file mode 100644 index 8c5bf953..00000000 --- a/frontend/views/Candidates.vue +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/frontend/views/Contacts.vue b/frontend/views/Contacts.vue deleted file mode 100644 index db855d3c..00000000 --- a/frontend/views/Contacts.vue +++ /dev/null @@ -1,428 +0,0 @@ - - diff --git a/frontend/views/Dashboard.vue b/frontend/views/Dashboard.vue deleted file mode 100644 index eb7a4498..00000000 --- a/frontend/views/Dashboard.vue +++ /dev/null @@ -1,364 +0,0 @@ - - diff --git a/frontend/views/DashboardFreealncer.vue b/frontend/views/DashboardFreealncer.vue deleted file mode 100644 index 96a6b863..00000000 --- a/frontend/views/DashboardFreealncer.vue +++ /dev/null @@ -1,69 +0,0 @@ - diff --git a/frontend/views/Departments.vue b/frontend/views/Departments.vue deleted file mode 100644 index 5a4b9434..00000000 --- a/frontend/views/Departments.vue +++ /dev/null @@ -1,18 +0,0 @@ - - diff --git a/frontend/views/Employee.vue b/frontend/views/Employee.vue deleted file mode 100644 index c82c3890..00000000 --- a/frontend/views/Employee.vue +++ /dev/null @@ -1,56 +0,0 @@ - - diff --git a/frontend/views/Holidays.vue b/frontend/views/Holidays.vue deleted file mode 100644 index 8c5bf953..00000000 --- a/frontend/views/Holidays.vue +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/frontend/views/Invoices.vue b/frontend/views/Invoices.vue deleted file mode 100644 index 44a6c62c..00000000 --- a/frontend/views/Invoices.vue +++ /dev/null @@ -1,34 +0,0 @@ - - diff --git a/frontend/views/Jobs.vue b/frontend/views/Jobs.vue deleted file mode 100644 index 81b65a2e..00000000 --- a/frontend/views/Jobs.vue +++ /dev/null @@ -1,100 +0,0 @@ - - diff --git a/frontend/views/Leaves.vue b/frontend/views/Leaves.vue deleted file mode 100644 index 8c5bf953..00000000 --- a/frontend/views/Leaves.vue +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/frontend/views/Loans.vue b/frontend/views/Loans.vue deleted file mode 100644 index c41ac2b1..00000000 --- a/frontend/views/Loans.vue +++ /dev/null @@ -1,252 +0,0 @@ - - diff --git a/frontend/views/Notifications.vue b/frontend/views/Notifications.vue deleted file mode 100644 index 84755a8a..00000000 --- a/frontend/views/Notifications.vue +++ /dev/null @@ -1,50 +0,0 @@ - - diff --git a/frontend/views/Payroll.vue b/frontend/views/Payroll.vue deleted file mode 100644 index aa47d8dc..00000000 --- a/frontend/views/Payroll.vue +++ /dev/null @@ -1,264 +0,0 @@ - - diff --git a/frontend/views/Profile.vue b/frontend/views/Profile.vue deleted file mode 100644 index 51db92ff..00000000 --- a/frontend/views/Profile.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/frontend/views/Settings.vue b/frontend/views/Settings.vue deleted file mode 100644 index 941ff8c4..00000000 --- a/frontend/views/Settings.vue +++ /dev/null @@ -1,97 +0,0 @@ - - diff --git a/frontend/views/Transactions.vue b/frontend/views/Transactions.vue deleted file mode 100644 index 16b93275..00000000 --- a/frontend/views/Transactions.vue +++ /dev/null @@ -1,28 +0,0 @@ - - diff --git a/frontend/views/Transfer.vue b/frontend/views/Transfer.vue deleted file mode 100644 index c41ac2b1..00000000 --- a/frontend/views/Transfer.vue +++ /dev/null @@ -1,252 +0,0 @@ - - diff --git a/frontend/views/ViewContact.vue b/frontend/views/ViewContact.vue deleted file mode 100644 index 54e286ee..00000000 --- a/frontend/views/ViewContact.vue +++ /dev/null @@ -1,89 +0,0 @@ - - diff --git a/frontend/views/ViewDepartments.vue b/frontend/views/ViewDepartments.vue deleted file mode 100644 index e54b7c73..00000000 --- a/frontend/views/ViewDepartments.vue +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/frontend/views/ViewEmployee.vue b/frontend/views/ViewEmployee.vue deleted file mode 100644 index a6d4cfea..00000000 --- a/frontend/views/ViewEmployee.vue +++ /dev/null @@ -1,63 +0,0 @@ - - diff --git a/frontend/wagmi/is-chain-id-supported.tsx b/frontend/wagmi/is-chain-id-supported.tsx deleted file mode 100644 index 1054cf2f..00000000 --- a/frontend/wagmi/is-chain-id-supported.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { supportedChains } from "./wagmi.config"; - -export function isChainIdSupported(id?: number) { - return supportedChains.find((c) => c.id === id) !== undefined; -} diff --git a/frontend/wagmi/wagmi.config.ts b/frontend/wagmi/wagmi.config.ts deleted file mode 100644 index 6c25d895..00000000 --- a/frontend/wagmi/wagmi.config.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { arbitrum, base, mainnet, optimism, polygon, zora } from "wagmi/chains"; -import { configureChains, createConfig } from "wagmi"; - -import { getDefaultWallets } from "@rainbow-me/rainbowkit"; -import { publicProvider } from "wagmi/providers/public"; - -export const supportedChains = [ - mainnet, - polygon, - optimism, - arbitrum, - base, - zora, -]; - -export const { chains, publicClient } = configureChains(supportedChains, [ - publicProvider(), -]); - -const { connectors } = getDefaultWallets({ - appName: "ic-siwe-demo-react", - projectId: "3936b3795b20eea5fe9282a3a80be958", - chains, -}); - -export const wagmiConfig = createConfig({ - autoConnect: true, - connectors, - publicClient, -});