mirror of
				https://github.com/whyour/qinglong.git
				synced 2025-11-04 11:16:07 +08:00 
			
		
		
		
	修复env启用禁用
This commit is contained in:
		
							parent
							
								
									49ab1ad93a
								
							
						
					
					
						commit
						173b87a7b1
					
				| 
						 | 
				
			
			@ -12,7 +12,7 @@ export class Env {
 | 
			
		|||
    this.value = options.value;
 | 
			
		||||
    this._id = options._id;
 | 
			
		||||
    this.created = options.created || new Date().valueOf();
 | 
			
		||||
    this.status = options.status || EnvStatus.noacquired;
 | 
			
		||||
    this.status = options.status || EnvStatus.normal;
 | 
			
		||||
    this.timestamp = new Date().toString();
 | 
			
		||||
    this.position = options.position;
 | 
			
		||||
    this.name = options.name;
 | 
			
		||||
| 
						 | 
				
			
			@ -21,11 +21,8 @@ export class Env {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
export enum EnvStatus {
 | 
			
		||||
  'noacquired',
 | 
			
		||||
  'normal',
 | 
			
		||||
  'disabled',
 | 
			
		||||
  'invalid',
 | 
			
		||||
  'abnormal',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export const initEnvPosition = 9999999999;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -183,7 +183,7 @@ export default class EnvService {
 | 
			
		|||
    return new Promise((resolve: any) => {
 | 
			
		||||
      this.cronDb.update(
 | 
			
		||||
        { _id: { $in: ids } },
 | 
			
		||||
        { $set: { status: EnvStatus.noacquired } },
 | 
			
		||||
        { $set: { status: EnvStatus.normal } },
 | 
			
		||||
        { multi: true },
 | 
			
		||||
        async (err, num) => {
 | 
			
		||||
          await this.set_envs();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								src/pages/env/index.tsx
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/pages/env/index.tsx
									
									
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -241,7 +241,7 @@ const Env = () => {
 | 
			
		|||
                `${record.status === Status.已禁用 ? '启用' : '禁用'}成功`,
 | 
			
		||||
              );
 | 
			
		||||
              const newStatus =
 | 
			
		||||
                record.status === Status.已禁用 ? Status.未获取 : Status.已禁用;
 | 
			
		||||
                record.status === Status.已禁用 ? Status.已启用 : Status.已禁用;
 | 
			
		||||
              const result = [...value];
 | 
			
		||||
              result.splice(index, 1, {
 | 
			
		||||
                ...record,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user