Changeset 2265498
- Timestamp:
- 03/22/2020 07:36:00 PM (6 years ago)
- Location:
- xlogin/trunk/html/admin
- Files:
-
- 2 edited
-
xsvcs.html (modified) (1 diff)
-
xsvcs.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xlogin/trunk/html/admin/xsvcs.html
r2264830 r2265498 85 85 <button type="button" @click="svc=null">Cancel</button> 86 86 87 <button type="button" @click="updateSvcConfig(svc)">Update</button> 87 <button type="button" 88 @click="updateSvcConfig(svc)" 89 :disabled="incompleteSvcConfig" 90 >Update</button> 88 91 </div> 89 92 </pl2010-modal> <!--}}}--> -
xlogin/trunk/html/admin/xsvcs.js
r2264830 r2265498 28 28 }); 29 29 }, 30 computed: { 31 incompleteSvcConfig: function() { 32 let xs = this.svc; 33 if (!xs || !xs.data || !xs.data.config) 34 return true; 35 let cfg = xs.data.config; 36 if (!cfg) 37 return true; 38 switch (xs.model) { 39 case 'oauth2': 40 if (!cfg.client_id || cfg.client_id.trim() == '') 41 return true; 42 if (!cfg.client_secret || cfg.client_secret.trim() == '') 43 return true; 44 break; 45 case 'generic': 46 default: 47 // Generic object as JSON. 48 try { 49 cfg = JSON.parse(xs.data.config); 50 } 51 catch (err) { 52 return true; 53 } 54 if (!cfg || typeof cfg != 'object') 55 return true; 56 break; 57 } 58 return null; 59 } 60 }, 30 61 methods: { 31 62 /** … … 35 66 pl2010_XLoginApi.get('/xsvcs/'+xs.type+'/config').done(resp => { 36 67 xs.data = this.dataMarshalIn(xs, resp.data); 37 if (xs.data) 38 this.svc = xs; 68 if (xs.data) { 69 this.svc = jQuery.extend({}, xs); 70 } 39 71 }); 40 72 },
Note: See TracChangeset
for help on using the changeset viewer.