Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix Agent download link when no tarball detected.
[src/xds/xds-server.git]
/
webapp
/
src
/
app
/
config
/
config.component.ts
diff --git
a/webapp/src/app/config/config.component.ts
b/webapp/src/app/config/config.component.ts
index
681c296
..
1e1e9c2
100644
(file)
--- a/
webapp/src/app/config/config.component.ts
+++ b/
webapp/src/app/config/config.component.ts
@@
-8,9
+8,11
@@
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/debounceTime';
import { ConfigService, IConfig, IProject, ProjectType } from "../common/config.service";
import 'rxjs/add/operator/debounceTime';
import { ConfigService, IConfig, IProject, ProjectType } from "../common/config.service";
-import { XDSServerService, IServerStatus } from "../common/xdsserver.service";
+import { XDSServerService, IServerStatus, IXDSAgentInfo } from "../common/xdsserver.service";
+import { XDSAgentService, IAgentStatus } from "../common/xdsagent.service";
import { SyncthingService, ISyncThingStatus } from "../common/syncthing.service";
import { AlertService } from "../common/alert.service";
import { SyncthingService, ISyncThingStatus } from "../common/syncthing.service";
import { AlertService } from "../common/alert.service";
+import { ISdk, SdkService } from "../common/sdk.service";
@Component({
templateUrl: './app/config/config.component.html',
@Component({
templateUrl: './app/config/config.component.html',
@@
-23,15
+25,19
@@
import { AlertService } from "../common/alert.service";
export class ConfigComponent implements OnInit {
config$: Observable<IConfig>;
export class ConfigComponent implements OnInit {
config$: Observable<IConfig>;
- severStatus$: Observable<IServerStatus>;
+ sdks$: Observable<ISdk[]>;
+ serverStatus$: Observable<IServerStatus>;
+ agentStatus$: Observable<IAgentStatus>;
localSTStatus$: Observable<ISyncThingStatus>;
curProj: number;
userEditedLabel: boolean = false;
localSTStatus$: Observable<ISyncThingStatus>;
curProj: number;
userEditedLabel: boolean = false;
+ xdsAgentZipUrl: string = "";
// TODO replace by reactive FormControl + add validation
syncToolUrl: string;
// TODO replace by reactive FormControl + add validation
syncToolUrl: string;
- syncToolRetry: string;
+ xdsAgentUrl: string;
+ xdsAgentRetry: string;
projectsRootDir: string;
showApplyBtn = { // Used to show/hide Apply buttons
"retry": false,
projectsRootDir: string;
showApplyBtn = { // Used to show/hide Apply buttons
"retry": false,
@@
-44,8
+50,10
@@
export class ConfigComponent implements OnInit {
constructor(
private configSvr: ConfigService,
constructor(
private configSvr: ConfigService,
- private sdkSvr: XDSServerService,
+ private xdsServerSvr: XDSServerService,
+ private xdsAgentSvr: XDSAgentService,
private stSvr: SyncthingService,
private stSvr: SyncthingService,
+ private sdkSvr: SdkService,
private alert: AlertService,
private fb: FormBuilder
) {
private alert: AlertService,
private fb: FormBuilder
) {
@@
-59,14
+67,18
@@
export class ConfigComponent implements OnInit {
ngOnInit() {
this.config$ = this.configSvr.conf;
ngOnInit() {
this.config$ = this.configSvr.conf;
- this.severStatus$ = this.sdkSvr.Status$;
+ this.sdks$ = this.sdkSvr.Sdks$;
+ this.serverStatus$ = this.xdsServerSvr.Status$;
+ this.agentStatus$ = this.xdsAgentSvr.Status$;
this.localSTStatus$ = this.stSvr.Status$;
this.localSTStatus$ = this.stSvr.Status$;
- // Bind
syncTool
Url to baseURL
+ // Bind
xdsAgent
Url to baseURL
this.config$.subscribe(cfg => {
this.syncToolUrl = cfg.localSThg.URL;
this.config$.subscribe(cfg => {
this.syncToolUrl = cfg.localSThg.URL;
- this.syncToolRetry = String(cfg.localSThg.retry);
+ this.xdsAgentUrl = cfg.xdsAgent.URL;
+ this.xdsAgentRetry = String(cfg.xdsAgent.retry);
this.projectsRootDir = cfg.projectsRootDir;
this.projectsRootDir = cfg.projectsRootDir;
+ this.xdsAgentZipUrl = cfg.xdsAgentZipUrl;
});
// Auto create label name
});
// Auto create label name
@@
-89,9
+101,9
@@
export class ConfigComponent implements OnInit {
switch (field) {
case "retry":
let re = new RegExp('^[0-9]+$');
switch (field) {
case "retry":
let re = new RegExp('^[0-9]+$');
- let rr = parseInt(this.
syncTool
Retry, 10);
- if (re.test(this.
syncTool
Retry) && rr >= 0) {
- this.configSvr.
syncTool
Retry = rr;
+ let rr = parseInt(this.
xdsAgent
Retry, 10);
+ if (re.test(this.
xdsAgent
Retry) && rr >= 0) {
+ this.configSvr.
xdsAgent
Retry = rr;
} else {
this.alert.warning("Not a valid number", true);
}
} else {
this.alert.warning("Not a valid number", true);
}
@@
-105,8
+117,10
@@
export class ConfigComponent implements OnInit {
this.showApplyBtn[field] = false;
}
this.showApplyBtn[field] = false;
}
- syncToolRestartConn() {
+ xdsAgentRestartConn() {
+ let aurl = this.xdsAgentUrl;
this.configSvr.syncToolURL = this.syncToolUrl;
this.configSvr.syncToolURL = this.syncToolUrl;
+ this.configSvr.xdsAgentUrl = aurl;
this.configSvr.loadProjects();
}
this.configSvr.loadProjects();
}
@@
-117,6
+131,7
@@
export class ConfigComponent implements OnInit {
label: formVal['label'],
path: formVal['path'],
type: ProjectType.SYNCTHING,
label: formVal['label'],
path: formVal['path'],
type: ProjectType.SYNCTHING,
+ // FIXME: allow to set defaultSdkID from New Project config panel
});
}
});
}