Explorar o código

update HC Plugin to only use Full Access Token

CauseFX %!s(int64=4) %!d(string=hai) anos
pai
achega
5655d42d77

+ 6 - 5
api/plugins/healthChecks/plugin.php

@@ -102,17 +102,18 @@ class HealthChecks extends Organizr
 					'html' => '
 						<div class="row">
 						    <div class="col-lg-12">
-						        <div class="panel panel-info">
+						        <div class="panel panel-danger">
 						            <div class="panel-heading">
 						                <span lang="en">ATTENTION</span>
 						            </div>
 						            <div class="panel-wrapper collapse in" aria-expanded="true">
 						                <div class="panel-body">
-						                	<h4 lang="en">This is only used for the import button...</h4>
+						                	<h4 lang="en">Please use a Full Access Token</h4>
 						                    <br/>
-						                    <span>
-						                    	<span lang="en">Make sure to save before using the import button on Services tab</span>
-						                    </span>
+						                    <div>
+						                    	<p lang="en">Do not use a Read-Only Token as that will not give a correct UUID for sending the results to HealthChecks.io</p>
+						                    	<p lang="en">Make sure to save before using the import button on Services tab</p>
+						                    </div>
 						                </div>
 						            </div>
 						        </div>

+ 2 - 1
api/plugins/healthChecks/settings.js

@@ -45,7 +45,8 @@ $(document).on('click', '.importNewHCService', function() {
 					$.each(checks, function(i,v) {
 						let alreadySetup = false;
 						if(typeof v.unique_key !== 'undefined'){
-							var uuid = v.unique_key;
+							data = 'Please use a Full Access Token';
+							throw new Error('Read-Only Token Used');
 						}else{
 							var uuid = v.ping_url;
 							uuid = uuid.match(/([0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12})/g);