Pārlūkot izejas kodu

Copy to clipboard on clicking added

pabon 5 gadi atpakaļ
vecāks
revīzija
54079154da

+ 41 - 1
dashboard/templates/_reportsidebar.html

@@ -30,4 +30,44 @@
       </div>
   </div>
 </div>
-</div>
+</div>
+
+
+<!-- Copy to Clipboard by Pabon Starts -->
+
+<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
+
+<script>
+
+  var len = $('.list-group-item').length;
+
+  for(let i = 0 ; i < len ; i++){
+    // $('.list-group-item')[i].id = i+1;
+    $('.list-group-item')[i].firstChild.id = i+1;
+    // console.log($('.list-group-item')[i].firstChild.id);
+  }
+
+  $(document).on('click', '.list-group-item', (e) => {
+    // console.log("CLicked");
+
+    var id = $(e.target).closest('.list-group-item').find('p')[0].id;
+
+    // console.log(id);
+
+    var text = document.getElementById(id).textContent;
+
+    // console.log(document.getElementById(id).textContent);
+
+    var dummy = document.createElement("textarea");
+    document.body.appendChild(dummy);
+    dummy.value = text;
+    dummy.select();
+    document.execCommand("copy");
+    document.body.removeChild(dummy);
+
+  })
+
+
+</script>
+
+<!-- Copy to Clipboard by Pabon Ends -->

+ 2 - 2
review_automation/settings.py

@@ -10,7 +10,7 @@ SECRET_KEY = '0t@j@klm8b@2rdl@po$$24pirh$&cg#p6f#)@$@n8^kn7k2%9b'
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
 
-ALLOWED_HOSTS = []
+ALLOWED_HOSTS = ['10.0.0.23']
 
 
 # Application definition
@@ -123,4 +123,4 @@ CLIENT_ID = "174657415928-0bt50gt42pslq47gf21ao67n15rom96r.apps.googleuserconten
 CLIENT_SECRET = "ZXYpt07Su0pW3y3jPGOXY_C_"
 TOKEN_URI = "https://oauth2.googleapis.com/token"
 HOST_URI = "http://127.0.0.1:8000"
-NLU_SERVER_URI = 'http://localhost:5005'
+NLU_SERVER_URI = 'http://10.0.0.17:5005'