From c97d229cf237456d3445fefb5e481ba69853af46 Mon Sep 17 00:00:00 2001 From: risadmin_prod Date: Sat, 18 Oct 2025 10:41:38 +0000 Subject: [PATCH] build_app --- .../Builders/Services/BuilderService.java | 9 + .../Controllers/StopwatchController.java | 107 +++++ .../tokenFree_StopwatchController.java | 107 +++++ .../realnet/stopwatch/Entity/Stopwatch.java | 36 ++ .../Repository/StopwatchRepository.java | 32 ++ .../stopwatch/Services/StopwatchService.java | 103 +++++ .../authsec_mysql/mysql/wf_table/wf_table.sql | 6 + .../Stopwatch/Stopwatch.component.html | 414 ++++++++++++++++++ .../Stopwatch/Stopwatch.component.scss | 85 ++++ .../Stopwatch/Stopwatch.component.ts | 297 +++++++++++++ .../stopwatch/Stopwatch/Stopwatch.service.ts | 41 ++ .../Stopwatch/Stopwatch_cardvariable.ts | 4 + .../app/modules/main/main-routing.module.ts | 10 + .../src/app/modules/main/main.module.ts | 10 + .../src/assets/i18n/en.json | 12 + 15 files changed, 1273 insertions(+) create mode 100644 stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Controllers/StopwatchController.java create mode 100644 stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Controllers/tokenFree_StopwatchController.java create mode 100644 stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Entity/Stopwatch.java create mode 100644 stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Repository/StopwatchRepository.java create mode 100644 stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Services/StopwatchService.java create mode 100755 stop_watch_app-stop_watch_app-d-d/authsec_mysql/mysql/wf_table/wf_table.sql create mode 100644 stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.html create mode 100644 stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.scss create mode 100644 stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.ts create mode 100644 stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.service.ts create mode 100644 stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch_cardvariable.ts diff --git a/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java index f9801fb..882a8f7 100644 --- a/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java +++ b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java @@ -69,6 +69,15 @@ public class BuilderService { executeDump(true); // ADD OTHER SERVICE +addCustomMenu( "Stopwatch","Stopwatch", "Transcations"); + + +addCustomMenu( "Stopwatch","Stopwatch", "Transcations"); + + +addCustomMenu( "Stopwatch","Stopwatch", "Transcations"); + + System.out.println("dashboard and menu inserted..."); diff --git a/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Controllers/StopwatchController.java b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Controllers/StopwatchController.java new file mode 100644 index 0000000..2c578e5 --- /dev/null +++ b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Controllers/StopwatchController.java @@ -0,0 +1,107 @@ +package com.realnet.stopwatch.Controllers; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import com.fasterxml.jackson.core.JsonProcessingException; +import org.springframework.web.bind.annotation.CrossOrigin; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.realnet.config.EmailService; +import com.realnet.users.entity1.AppUser; +import com.realnet.users.service1.AppUserServiceImpl; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.data.domain.*; +import com.realnet.fnd.response.EntityResponse; +import org.springframework.http.*; +import org.springframework.beans.factory.annotation.*; +import com.realnet.stopwatch.Entity.Stopwatch; +import com.realnet.stopwatch.Services.StopwatchService ; + + + + + + + + +@RequestMapping(value = "/Stopwatch") + @CrossOrigin("*") +@RestController +public class StopwatchController { + @Autowired + private StopwatchService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + + + + + @PostMapping("/Stopwatch") + public Stopwatch Savedata(@RequestBody Stopwatch data) { + Stopwatch save = Service.Savedata(data) ; + + + + + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Stopwatch/{id}") + public Stopwatch update(@RequestBody Stopwatch data,@PathVariable Integer id ) { + Stopwatch update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Stopwatch/getall/page") + public Page getall(@RequestParam(value = "page", required = false) Integer page, + @RequestParam(value = "size", required = false) Integer size) { + Pageable paging = PageRequest.of(page, size); + Page get = Service.getAllWithPagination(paging); + + return get; + + } + @GetMapping("/Stopwatch") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Stopwatch") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Stopwatch/{id}") + public Stopwatch getdetailsbyId(@PathVariable Integer id ) { + Stopwatch get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Stopwatch/{id}") + public ResponseEntity delete_by_id(@PathVariable Integer id ) { + Service.delete_by_id(id); + return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK); + + } + + + + + + + + + +} \ No newline at end of file diff --git a/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Controllers/tokenFree_StopwatchController.java b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Controllers/tokenFree_StopwatchController.java new file mode 100644 index 0000000..ce87920 --- /dev/null +++ b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Controllers/tokenFree_StopwatchController.java @@ -0,0 +1,107 @@ +package com.realnet.stopwatch.Controllers; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import com.fasterxml.jackson.core.JsonProcessingException; +import org.springframework.web.bind.annotation.CrossOrigin; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.realnet.config.EmailService; +import com.realnet.users.entity1.AppUser; +import com.realnet.users.service1.AppUserServiceImpl; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.data.domain.*; +import com.realnet.fnd.response.EntityResponse; +import org.springframework.http.*; +import org.springframework.beans.factory.annotation.*; +import com.realnet.stopwatch.Entity.Stopwatch; +import com.realnet.stopwatch.Services.StopwatchService ; + + + + + + + + +@RequestMapping(value = "/token/Stopwatch") + @CrossOrigin("*") +@RestController +public class tokenFree_StopwatchController { + @Autowired + private StopwatchService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + + + + + @PostMapping("/Stopwatch") + public Stopwatch Savedata(@RequestBody Stopwatch data) { + Stopwatch save = Service.Savedata(data) ; + + + + + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Stopwatch/{id}") + public Stopwatch update(@RequestBody Stopwatch data,@PathVariable Integer id ) { + Stopwatch update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Stopwatch/getall/page") + public Page getall(@RequestParam(value = "page", required = false) Integer page, + @RequestParam(value = "size", required = false) Integer size) { + Pageable paging = PageRequest.of(page, size); + Page get = Service.getAllWithPagination(paging); + + return get; + + } + @GetMapping("/Stopwatch") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Stopwatch") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Stopwatch/{id}") + public Stopwatch getdetailsbyId(@PathVariable Integer id ) { + Stopwatch get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Stopwatch/{id}") + public ResponseEntity delete_by_id(@PathVariable Integer id ) { + Service.delete_by_id(id); + return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK); + + } + + + + + + + + + +} \ No newline at end of file diff --git a/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Entity/Stopwatch.java b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Entity/Stopwatch.java new file mode 100644 index 0000000..2170760 --- /dev/null +++ b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Entity/Stopwatch.java @@ -0,0 +1,36 @@ +package com.realnet.stopwatch.Entity; + import lombok.*; +import com.realnet.WhoColumn.Entity.Extension; + import javax.persistence.*; + import java.time.LocalDateTime; + import java.util.*; + + + + + + + + + @Entity + @Data + public class Stopwatch extends Extension { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + +private int hours; + +private int minutes; + +private int seconds; + +private int milliseconds; + + +} diff --git a/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Repository/StopwatchRepository.java b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Repository/StopwatchRepository.java new file mode 100644 index 0000000..a0a710d --- /dev/null +++ b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Repository/StopwatchRepository.java @@ -0,0 +1,32 @@ +package com.realnet.stopwatch.Repository; + + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import org.springframework.stereotype.Repository; +import java.util.*; + + + + + + + + + + + +import com.realnet.stopwatch.Entity.Stopwatch; + +@Repository +public interface StopwatchRepository extends JpaRepository { + +@Query(value = "select * from stopwatch where created_by=?1", nativeQuery = true) + List findAll(Long creayedBy); + +@Query(value = "select * from stopwatch where created_by=?1", nativeQuery = true) + Page findAll( Long creayedBy,Pageable page); +} \ No newline at end of file diff --git a/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Services/StopwatchService.java b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Services/StopwatchService.java new file mode 100644 index 0000000..3a16b59 --- /dev/null +++ b/stop_watch_app-stop_watch_app-b-b/authsec_springboot/backend/src/main/java/com/realnet/stopwatch/Services/StopwatchService.java @@ -0,0 +1,103 @@ +package com.realnet.stopwatch.Services; +import com.realnet.stopwatch.Repository.StopwatchRepository; +import com.realnet.stopwatch.Entity.Stopwatch +;import java.util.*; + +import org.springframework.beans.factory.annotation.Autowired; +import com.realnet.SequenceGenerator.Service.SequenceService; +import org.springframework.data.domain.Page; +import com.realnet.realm.Entity.Realm; +import com.realnet.realm.Services.RealmService; +import org.springframework.data.domain.Pageable; +import org.springframework.http.*; +import com.realnet.users.service1.AppUserServiceImpl; +import com.realnet.users.entity1.AppUser; + + + + + + + + + import org.springframework.stereotype.Service; + +@Service + public class StopwatchService { +@Autowired +private StopwatchRepository Repository; + @Autowired + private AppUserServiceImpl userService; +@Autowired + private RealmService realmService; + + + + + + + +public Stopwatch Savedata(Stopwatch data) { + + + + + + + + + data.setUpdatedBy(getUser().getUserId()); + data.setCreatedBy(getUser().getUserId()); + data.setAccountId(getUser().getAccount().getAccount_id()); +Stopwatch save = Repository.save(data); + return save; + } + + +// get all with pagination + public Page getAllWithPagination(Pageable page) { + return Repository.findAll( getUser().getUserId(),page); + } +public List getdetails() { + List realm = realmService.findByUserId(getUser().getUserId()); +List all = Repository.findAll(getUser().getUserId()); + + return all ; } + + +public Stopwatch getdetailsbyId(Integer id) { + return Repository.findById(id).get(); + } + + + public void delete_by_id(Integer id) { + Repository.deleteById(id); +} + + +public Stopwatch update(Stopwatch data,Integer id) { + Stopwatch old = Repository.findById(id).get(); +old.setHours(data.getHours()); + +old.setMinutes(data.getMinutes()); + +old.setSeconds(data.getSeconds()); + +old.setMilliseconds(data.getMilliseconds()); + +final Stopwatch test = Repository.save(old); + data.setUpdatedBy(getUser().getUserId()); + return test;} + + + + + + + + + public AppUser getUser() { + AppUser user = userService.getLoggedInUser(); + return user; + + }} diff --git a/stop_watch_app-stop_watch_app-d-d/authsec_mysql/mysql/wf_table/wf_table.sql b/stop_watch_app-stop_watch_app-d-d/authsec_mysql/mysql/wf_table/wf_table.sql new file mode 100755 index 0000000..21201bc --- /dev/null +++ b/stop_watch_app-stop_watch_app-d-d/authsec_mysql/mysql/wf_table/wf_table.sql @@ -0,0 +1,6 @@ +CREATE TABLE stop_watch_app-d.Stopwatch(id BIGINT NOT NULL AUTO_INCREMENT, currenttime int, laptime VARCHAR(400), isrunning bit(1), PRIMARY KEY (id)); + +CREATE TABLE stop_watch_app-d.Stopwatch(id BIGINT NOT NULL AUTO_INCREMENT, duration int, starttime Date, stoptime Date, status VARCHAR(400), PRIMARY KEY (id)); + +CREATE TABLE stop_watch_app-d.Stopwatch(id BIGINT NOT NULL AUTO_INCREMENT, milliseconds int, hours int, seconds int, minutes int, PRIMARY KEY (id)); + diff --git a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.html b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.html new file mode 100644 index 0000000..3c9748a --- /dev/null +++ b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.html @@ -0,0 +1,414 @@ + +
+
+
+

StopWatch

+
+
+ + + +
+ + + + Loading ... + +
{{error}}
+
+ + hours + + + + minutes + + + + seconds + + + + milliseconds + + + + + + Action + + + + + +{{user.hours }} + + +{{user.minutes }} + + +{{user.seconds }} + + +{{user.milliseconds }} + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + +
+ + + Users per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} users + + +
+ + + +
+
+
+
+
+
+ +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] }} + {{afterText(item.fieldtext)}} +
+ +
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ] | date}} + {{afterText(item.fieldtext)}} +
+
+ {{beforeText(item.fieldtext)}} + {{ app[transform(item.fieldtext) ]}} + {{afterText(item.fieldtext)}} +
+ +
+
+
+ + +
+ +
+ +
File Preview
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.scss b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.scss new file mode 100644 index 0000000..12f7fc8 --- /dev/null +++ b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.scss @@ -0,0 +1,85 @@ +//@import "../../../../assets/scss/var"; +.s-info-bar { + display: flex; + flex-direction: row; + justify-content: space-between; + button { + outline: none; + } +} +.delete,.heading{ + text-align: center; + color: red; +} +.entry-pg { + width: 750px; +} + +.button1::after { + content: none; +} +.button1:hover::after { + content: "ADD ROWS"; +} + +.section { + background-color: #dddddd; + height: 40px; +} + +.section p { + //color: white; + padding: 10px; + font-size: 18px; +} + +.clr-input { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + padding: 0.75rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.clr-file { + color: #212529; + border: 1px solid #ced4da; + border-radius: 0.25rem; + //padding: 0.6rem 0.75rem; + margin-top: 3px; + width: 100%; + margin-bottom: 10px; +} + +.center { + text-align: center; +} +select{ + width: 100%; + margin-top: 3px; + padding: 5px 5px; + border: 1px solid #ccc; + border-radius: 4px; +} +input[type=text],[type=date],[type=number],textarea { + width: 100%; + padding: 15px 15px; + background-color:rgb(255, 255, 255); + // margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} +.error_mess { + color: red; +} +.universal-section-header { + margin: 24px 0 10px 0; + font-weight: 600; + color: #1a237e; + letter-spacing: 0.5px; + font-size: 1.25rem; +} \ No newline at end of file diff --git a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.ts b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.ts new file mode 100644 index 0000000..a4b5e4c --- /dev/null +++ b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.component.ts @@ -0,0 +1,297 @@ +import { Component, OnInit } from '@angular/core'; +import { ToastrService } from 'ngx-toastr'; +import { AlertService } from 'src/app/services/alert.service'; +import { Stopwatchservice} from './Stopwatch.service'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { ExtensionService } from 'src/app/services/fnd/extension.service'; +import { DashboardContentModel2 } from 'src/app/models/builder/dashboard'; +import { Stopwatchcardvariable } from './Stopwatch_cardvariable'; +import { UserInfoService } from 'src/app/services/user-info.service'; +declare var JsBarcode: any; +@Component({ + selector: 'app-Stopwatch', + templateUrl: './Stopwatch.component.html', + styleUrls: ['./Stopwatch.component.scss'] +}) +export class StopwatchComponent implements OnInit { + cardButton = Stopwatchcardvariable.cardButton; + cardmodeldata = Stopwatchcardvariable.cardmodeldata; + public dashboardArray: DashboardContentModel2[]; + isCardview = Stopwatchcardvariable.cardButton; + cardmodal; changeView(){ + this.isCardview = !this.isCardview; + } + beforeText(fieldtext: string): string { // Extract the text before the first '<' + const index = fieldtext.indexOf('<'); + return index !== -1 ? fieldtext.substring(0, index) : fieldtext; + } + afterText(fieldtext: string): string { // Extract the text after the last '>' + const index = fieldtext.lastIndexOf('>'); + return index !== -1 ? fieldtext.substring(index + 1) : ''; + } + transform(fieldtext: string): string { + const match = fieldtext.match(/<([^>]*)>/); + return match ? match[1] : ''; // Extract the text between '<' and '>' + } + userrole; + rowSelected :any= {}; + modaldelete=false; + modalEdit=false; + modalAdd= false; + public entryForm: FormGroup; + loading = false; + product; + modalOpenedforNewLine = false; + newLine:any; + additionalFieldsFromBackend: any[] = []; + formcode = 'Stopwatch_formCode' +tableName = 'Stopwatch'; checkFormCode; selected: any[] = []; constructor( + private extensionService: ExtensionService, +private userInfoService:UserInfoService, + private mainService:Stopwatchservice, + private alertService: AlertService, + private toastr: ToastrService, + private _fb: FormBuilder, + ) { } + private editInterval: any; +// component button + ngOnInit(): void { + if(this.cardmodeldata !== ''){ + this.cardmodal = JSON.parse(this.cardmodeldata); + this.dashboardArray = this.cardmodal.dashboard.slice(); + console.log(this.dashboardArray) + } + this.userrole=this.userInfoService.getRoles(); + this.getData(); + this.entryForm = this._fb.group({ +hours : [null,[Validators.required]], + +minutes : [null,[Validators.required]], + +seconds : [null,[Validators.required]], + +milliseconds : [null,[Validators.required]], + + + + + + + + + + + }); // component_button200 + // form code start + this.extensionService.getJsonObjectsByFormCodeList(this.formcode).subscribe(data => { + console.log(data); + const jsonArray = data.map((str) => JSON.parse(str)); + this.additionalFieldsFromBackend = jsonArray; + this.checkFormCode = this.additionalFieldsFromBackend.some(field => field.formCode === "Stopwatch_formCode"); + console.log(this.checkFormCode); + console.log(this.additionalFieldsFromBackend); + if (this.additionalFieldsFromBackend && this.additionalFieldsFromBackend.length > 0) { + this.additionalFieldsFromBackend.forEach(field => { + if (field.formCode === this.formcode) { + if (!this.entryForm.contains(field.extValue)) { + // Add the control only if it doesn't exist in the form + this.entryForm.addControl(field.extValue, this._fb.control(field.fieldValue)); + } + } + }); + } + }); + console.log(this.entryForm.value); + // form code end + + + + + + + + + + } + ngOnDestroy(): void { + if (this.editInterval) { + clearInterval(this.editInterval); + } + } + + + + + + + + error; + getData() { + this.mainService.getAll().subscribe((data) => { + console.log(data); + this.product = data; +this.product = [...this.product].reverse(); if(this.product.length==0){ + this.error="No Data Available" + } + },(error) => { + console.log(error); + if(error){ + this.error="Server Error"; + } + }); + } + onEdit(row) { + this.rowSelected = row; + + + + + + + + + + this.modalEdit = true; + } + onDelete(row) { + this.rowSelected = row; + this.modaldelete=true; + } + delete(id) + { + this.modaldelete = false; + console.log("in delete "+id); + this.mainService.delete(id).subscribe( + (data) => { + console.log(data); + this.ngOnInit(); + if (data) { this.toastr.success('Deleted successfully'); } + }); + } + onUpdate(id) { + this.modalEdit = false; + + + + + + + + + //console.log("in update"); + console.log("id " + id); + console.log(this.rowSelected); + //console.log("out update"); + this.mainService.update(id, this.rowSelected).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("update Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Updated"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Updated"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } +onCreate() { + this.modalAdd=false; + + + + + + + + + this.mainService.create(this.entryForm.value).subscribe( + (data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Added Successfully"); + } +setTimeout(() => { + this.ngOnInit(); + }, 500); + + + + + + + + + }, (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + // this.toastr.success("Added Succesfully"); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Added"); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Not Added"); + } + }); + setTimeout(() => { + this.ngOnInit(); + }, 500); + } + goToAdd(row) { +this.modalAdd = true; this.submitted = false; + + + + + + + + + } + submitted = false; +onSubmit() { + console.log(this.entryForm.value); + this.submitted = true; + if (this.entryForm.invalid) { + return; + }this.onCreate(); + +} + + + + + + + + +// updateaction +} + + + + + + + diff --git a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.service.ts b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.service.ts new file mode 100644 index 0000000..2df483f --- /dev/null +++ b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch.service.ts @@ -0,0 +1,41 @@ +import { Injectable } from '@angular/core'; +import { Observable } from "rxjs"; +import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http"; +import { ApiRequestService } from "src/app/services/api/api-request.service"; +import { environment } from 'src/environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class Stopwatchservice{ + private baseURL = "Stopwatch/Stopwatch" ; constructor( + private http: HttpClient, + private apiRequest: ApiRequestService, + ) { } + getAll(page?: number, size?: number): Observable { + return this.apiRequest.get(this.baseURL); + } + getById(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.get(_http); + } + create(data: any): Observable { + return this.apiRequest.post(this.baseURL, data); + } + update(id: number, data: any): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.put(_http, data); + } + delete(id: number): Observable { + const _http = this.baseURL + "/" + id; + return this.apiRequest.delete(_http); + } + + + + + + + + +// updateaction +} \ No newline at end of file diff --git a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch_cardvariable.ts b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch_cardvariable.ts new file mode 100644 index 0000000..de1493f --- /dev/null +++ b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/stopwatch/Stopwatch/Stopwatch_cardvariable.ts @@ -0,0 +1,4 @@ +export const Stopwatchcardvariable = { + "cardButton": false, + "cardmodeldata": `` +} \ No newline at end of file diff --git a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts index 5b6b3b6..0aa2bb1 100644 --- a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts +++ b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main-routing.module.ts @@ -1,4 +1,7 @@ + +import { StopwatchComponent } from './BuilderComponents/stopwatch/Stopwatch/Stopwatch.component'; + import { SequencegenaratorComponent } from './fnd/sequencegenarator/sequencegenarator.component'; import { Component, NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -261,6 +264,13 @@ const routes: Routes = [ // buildercomponents + + + +{path:'Stopwatch',component:StopwatchComponent}, + + + { path: 'tokenregistery', component: Token_registeryComponent }, { path: 'Stepper_workflow', component: Stepper_workflowComponent }, diff --git a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main.module.ts b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main.module.ts index 0914655..6c86817 100644 --- a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main.module.ts +++ b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/main.module.ts @@ -1,5 +1,8 @@ +import { StopwatchComponent } from './BuilderComponents/stopwatch/Stopwatch/Stopwatch.component'; + + import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -136,6 +139,13 @@ import { MyworkspaceComponent } from './admin/myworkspace/myworkspace.component' + +StopwatchComponent, + + + + + Token_registeryComponent, diff --git a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/assets/i18n/en.json b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/assets/i18n/en.json index d9ffd31..6ba5887 100644 --- a/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/assets/i18n/en.json +++ b/stop_watch_app-stop_watch_app-f-f/authsec_angular/frontend/angular-clarity-master/src/assets/i18n/en.json @@ -226,4 +226,16 @@ "MENU_ACTION_LINK": "Menu Action Link", "STATUS": "Status", "SUB_MENU": "Sub Menu", + "currentTime": "currentTime", + "duration": "duration", + "lapTime": "lapTime", + "milliseconds": "milliseconds", + "hours": "hours", + "seconds": "seconds", + "isRunning": "isRunning", + "minutes": "minutes", + "Stopwatch": "Stopwatch", + "startTime": "startTime", + "stopTime": "stopTime", + "status": "status" } \ No newline at end of file