@@ -199,22 +199,22 @@ class SystemConfigHandler extends SystemHandler {
199199
200200 try {
201201 try {
202- value = Schema . intersect ( this . ctx . config . settings ) ( yaml . load ( this . ctx . config . configSource ) ) ;
202+ value = Schema . intersect ( this . ctx . setting . settings ) ( yaml . load ( this . ctx . setting . configSource ) ) ;
203203 } catch ( e ) {
204- value = yaml . load ( this . ctx . config . configSource ) ;
204+ value = yaml . load ( this . ctx . setting . configSource ) ;
205205 }
206- for ( const schema of this . ctx . config . settings ) processNode ( value , schema ) ;
206+ for ( const schema of this . ctx . setting . settings ) processNode ( value , schema ) ;
207207 } catch ( e ) { }
208208 this . response . body = {
209- schema : Schema . intersect ( this . ctx . config . settings ) . toJSON ( ) ,
209+ schema : Schema . intersect ( this . ctx . setting . settings ) . toJSON ( ) ,
210210 value : yaml . dump ( value ) ,
211211 } ;
212212 }
213213
214214 @requireSudo
215215 @param ( 'value' , Types . String )
216216 async post ( { } , value : string ) {
217- const oldConfig = yaml . load ( this . ctx . config . configSource ) ;
217+ const oldConfig = yaml . load ( this . ctx . setting . configSource ) ;
218218 let config ;
219219 const processNode = ( node : any , old : any , schema : Schema < any , any > , parent ?: any , accessKey ?: string ) => {
220220 if ( [ 'union' , 'intersect' ] . includes ( schema . type ) ) {
@@ -231,11 +231,11 @@ class SystemConfigHandler extends SystemHandler {
231231
232232 try {
233233 config = yaml . load ( value ) ;
234- for ( const schema of this . ctx . config . settings ) processNode ( config , oldConfig , schema , null , '' ) ;
234+ for ( const schema of this . ctx . setting . settings ) processNode ( config , oldConfig , schema , null , '' ) ;
235235 } catch ( e ) {
236236 throw new ValidationError ( 'value' , '' , e . message ) ;
237237 }
238- await this . ctx . config . saveConfig ( config ) ;
238+ await this . ctx . setting . saveConfig ( config ) ;
239239 }
240240}
241241
@@ -357,7 +357,7 @@ class SystemUserPrivHandler extends SystemHandler {
357357 }
358358}
359359
360- export const inject = [ 'config ' , 'check' ] ;
360+ export const inject = [ 'setting ' , 'check' ] ;
361361export async function apply ( ctx ) {
362362 ctx . Route ( 'manage' , '/manage' , SystemMainHandler ) ;
363363 ctx . Route ( 'manage_dashboard' , '/manage/dashboard' , SystemDashboardHandler ) ;
0 commit comments