json-object-editor
Version:
JOE the Json Object Editor | Platform Edition
53 lines (50 loc) • 4.29 kB
JavaScript
var setting ={
title: '${name}',
//info:'view global settings used across all apps, plugins and the server',
info:"Each setting is global, and makes changes to the more advanced features of JOE.",
default_schema:true,
// Curated summary for agents
summary:{
description:'Global configuration key/value used by server, apps, and plugins.',
purpose:'Settings control behavior like API keys, feature flags, and templates. Use with care; many subsystems read these at runtime.',
labelField:'name',
defaultSort:{ field:'joeUpdated', dir:'desc' },
searchableFields:['name','info','_id'],
allowedSorts:['joeUpdated','created','name'],
relationships:{ outbound: [], inbound:{ graphRef:'server/relationships.graph.json' } },
joeManagedFields:['created','joeUpdated'],
fields:[
{ name:'_id', type:'string', required:true },
{ name:'itemtype', type:'string', required:true, const:'setting' },
{ name:'name', type:'string', required:true },
{ name:'info', type:'string' },
{ name:'setting_type', type:'string', enumValues:['text','code','wysiwyg'] },
{ name:'value', type:'string' },
{ name:'_protected', type:'boolean' },
{ name:'joeUpdated', type:'string', format:'date-time', required:true },
{ name:'created', type:'string', format:'date-time', required:true }
]
},
fields:[
'name',
'info',
{name:'setting_type',type:'select',values:['text','code','wysiwyg'],rerender:'value'},
{name:'value',type:function(item){
return (item.setting_type || '');
},language:'javascript'},
{sidebar_start:'right'},
'updated',
'_protected',
{sidebar_end:'right'},
{section_start:'system',collapsed:true},
'_id','created','itemtype',
{section_end:'system'}
],
idprop: '_id',
listView:{
title: '<joe-title>${name}</joe-title><joe-subtitle>${info}</joe-subtitle>',
listWindowTitle: 'Settings'
},
menuicon:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" viewBox="-8 -8 40 40" class="icon icons8-Settings" > <path d="M 12.0625 0 C 9.7745 -1.9428903e-16 9.8125 0.21875 9.8125 0.21875 C 9.5405 1.53775 9.2555 2.43275 9.0625 2.96875 C 7.8965 3.34975 6.82525 3.94775 5.90625 4.71875 C 5.35225 4.60975 4.45775 4.40675 3.21875 3.96875 C 3.21875 3.96875 3.052 3.8235 1.875 5.8125 C 0.696 7.7995 0.875 7.90625 0.875 7.90625 C 1.788 8.76425 2.387 9.426 2.75 9.875 C 2.593 10.559 2.5 11.268 2.5 12 C 2.5 12.663 2.5585 13.3125 2.6875 13.9375 C 2.3145 14.3785 1.70525 15.043 0.78125 15.875 C 0.78125 15.875 0.613 15.95675 1.75 17.96875 C 2.886 19.98075 3.03125 19.84375 3.03125 19.84375 C 4.28225 19.43075 5.193 19.25325 5.75 19.15625 C 6.666 19.95925 7.72925 20.56375 8.90625 20.96875 C 9.10025 21.49675 9.4065 22.41425 9.6875 23.78125 C 9.6875 23.78125 9.6505 24 11.9375 24 C 14.2215 24 14.21875 23.78125 14.21875 23.78125 C 14.49075 22.46325 14.7435 21.56625 14.9375 21.03125 C 16.1035 20.65025 17.17575 20.05225 18.09375 19.28125 C 18.64875 19.39025 19.54325 19.59225 20.78125 20.03125 C 20.78125 20.03125 20.944 20.1755 22.125 18.1875 C 23.302 16.1985 23.125 16.09375 23.125 16.09375 C 22.211 15.23575 21.613 14.573 21.25 14.125 C 21.406 13.439 21.5 12.732 21.5 12 C 21.5 11.337 21.4415 10.6875 21.3125 10.0625 C 21.6855 9.6225 22.29375 8.958 23.21875 8.125 C 23.21875 8.125 23.387 8.04425 22.25 6.03125 C 21.114 4.01825 20.96875 4.15625 20.96875 4.15625 C 19.71875 4.56925 18.807 4.74675 18.25 4.84375 C 17.334 4.04175 16.26975 3.43625 15.09375 3.03125 C 14.90075 2.50425 14.5945 1.58475 14.3125 0.21875 C 14.3125 0.21875 14.3465 0 12.0625 0 z M 12 4 C 16.418 4 20 7.582 20 12 C 20 16.418 16.418 20 12 20 C 7.582 20 4 16.418 4 12 C 4 7.582 7.582 4 12 4 z M 12 5 C 8.134 5 5 8.134 5 12 C 5 15.866 8.134 19 12 19 C 15.866 19 19 15.866 19 12 C 19 8.134 15.866 5 12 5 z M 12 8 C 14.209 8 16 9.791 16 12 C 16 14.209 14.209 16 12 16 C 9.791 16 8 14.209 8 12 C 8 9.791 9.791 8 12 8 z"></path></svg>'
};
module.exports = setting;