Skip to content

Commit

Permalink
feat(core-stats-flow): support group specification
Browse files Browse the repository at this point in the history
  • Loading branch information
ElonH committed May 26, 2020
1 parent b6f4cb9 commit 9a98a11
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/app/@dataflow/rclone/core-stats-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { NoopAuthFlowSupNode } from './noop-auth-flow';
import { FlowOutNode, CombErr, AjaxFlowInteralNode } from '../core';
import { IRcloneServer } from '../extra';

export interface CoreStatsFlowParamsNode {
group?: string;
}
export interface CoreStatsFlowOutNode extends FlowOutNode {
'core-stats': {
bytes: number;
Expand All @@ -20,10 +23,17 @@ export interface CoreStatsFlowOutNode extends FlowOutNode {

export interface CoreStatsFlowSupNode extends CoreStatsFlowOutNode, NoopAuthFlowSupNode {}

export abstract class CoreStatsFlow extends PostFlow<IRcloneServer, CoreStatsFlowOutNode> {
// public prerequest$: Observable<CombErr<IRcloneServer>>;
export abstract class CoreStatsFlow extends PostFlow<
CoreStatsFlowInNode,
CoreStatsFlowOutNode,
CoreStatsFlowParamsNode
> {
// public prerequest$: Observable<CombErr<CoreStatsFlowInNode>>;
protected cmd: string = 'core/stats';
protected params: object = {};
protected params = (pre: CombErr<CoreStatsFlowInNode>): CoreStatsFlowParamsNode => {
if (pre[1].length !== 0 || !pre[0].group) return {};
return { group: pre[0].group };
};
protected cacheSupport: boolean = false;
protected reconstructAjaxResult(x: AjaxFlowInteralNode): CombErr<CoreStatsFlowOutNode> {
if (x[1].length !== 0) return [{}, x[1]] as any;
Expand Down

0 comments on commit 9a98a11

Please sign in to comment.