- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 6.9k
 
feat(Add) : Add Settings Toggle for Pause confirmation dialogue #6148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Draft
      
      
            Raj4478
  wants to merge
  10
  commits into
  louislam:master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
Raj4478:master
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Draft
                    Changes from 2 commits
      Commits
    
    
            Show all changes
          
          
            10 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      c714767
              
                feat(Add) : Add Settings Toggle for Pause confirmation dialogue
              
              
                Raj4478 a7e1514
              
                fixed lintig issue
              
              
                Raj4478 71f3a44
              
                Added fixes
              
              
                Raj4478 72565af
              
                Used the generic confirm logic
              
              
                Raj4478 314c41d
              
                major fixes
              
              
                Raj4478 c617331
              
                feat(Added): ConfirmwithDonotShowAgain
              
              
                Raj4478 e35f0b0
              
                Merge branch 'louislam:master' into master
              
              
                Raj4478 02ccd2f
              
                Remove 'Do not show again' checkbox from Confirm modal
              
              
                Raj4478 0f5d779
              
                reverted Confirm to Original
              
              
                Raj4478 7bfd08f
              
                Merge branch 'master' into master
              
              
                Raj4478 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| <template> | ||
| <div ref="modal" class="modal fade" tabindex="-1"> | ||
| <div class="modal-dialog"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h5 id="exampleModalLabel" class="modal-title"> | ||
| {{ title || $t("Confirm") }} | ||
| </h5> | ||
| <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" /> | ||
| </div> | ||
| <div class="modal-body"> | ||
| <slot /> | ||
| <div class="form-check mt-3"> | ||
| <input | ||
| id="doNotShowAgain" | ||
| v-model="doNotShowAgain" | ||
| class="form-check-input" | ||
| type="checkbox" | ||
| /> | ||
| <label class="form-check-label" for="doNotShowAgain"> | ||
| {{ $t("Do not show this again") }} | ||
| </label> | ||
| </div> | ||
| </div> | ||
| <div class="modal-footer"> | ||
| <button type="button" class="btn" :class="btnStyle" data-bs-dismiss="modal" @click="yes"> | ||
| {{ yesText }} | ||
| </button> | ||
| <button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="no"> | ||
| {{ noText }} | ||
| </button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </template> | ||
| 
     | 
||
| <script> | ||
| import { Modal } from "bootstrap"; | ||
| 
     | 
||
| export default { | ||
| props: { | ||
| /** Style of button */ | ||
| btnStyle: { | ||
| type: String, | ||
| default: "btn-primary", | ||
| }, | ||
| /** Text to use as yes */ | ||
| yesText: { | ||
| type: String, | ||
| default: "Yes", | ||
| }, | ||
| /** Text to use as no */ | ||
| noText: { | ||
| type: String, | ||
| default: "No", | ||
| }, | ||
| /** Title to show on modal. Defaults to translated version of "Confirm" */ | ||
| title: { | ||
| type: String, | ||
| default: null, | ||
| } | ||
                
       | 
||
| }, | ||
| emits: [ "yes", "no" ], | ||
| data() { | ||
| return { | ||
| modal: null, | ||
| doNotShowAgain: false, | ||
| }; | ||
| }, | ||
| mounted() { | ||
| this.modal = new Modal(this.$refs.modal); | ||
| }, | ||
| methods: { | ||
| /** | ||
| * Show the confirm dialog | ||
| * @returns {void} | ||
| */ | ||
| show() { | ||
| this.doNotShowAgain = false; | ||
| this.modal.show(); | ||
| }, | ||
| /** | ||
| * @fires string "yes" Notify the parent when Yes is pressed | ||
| * @returns {void} | ||
| */ | ||
| yes() { | ||
| if (this.doNotShowAgain) { | ||
| localStorage.setItem("uptime-kuma-pause-confirm-disabled", "true"); | ||
| } | ||
                
      
                  CommanderStorm marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| this.$emit("yes"); | ||
| }, | ||
| /** | ||
| * @fires string "no" Notify the parent when No is pressed | ||
| * @returns {void} | ||
| */ | ||
| no() { | ||
| this.$emit("no"); | ||
| } | ||
| }, | ||
| }; | ||
| </script> | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.