Skip to content

Commit

Permalink
Merge pull request #279 from skadefro/master
Browse files Browse the repository at this point in the history
up
  • Loading branch information
skadefro authored Aug 14, 2023
2 parents c5b411f + 9b40878 commit f164620
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
5 changes: 4 additions & 1 deletion OpenFlow/src/DBHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,10 @@ export class DBHelper {
}
private async AgentUpdate(_id: string, slug: string, watch: boolean, span: Span) {
Logger.instanse.debug("Clear queue cache : " + slug + " " + _id, span);
if (!NoderedUtil.IsNullEmpty(slug)) await this.DeleteKey(("agent_" + slug).toString(), watch, false, span);
if (!NoderedUtil.IsNullEmpty(slug)) {
await this.DeleteKey(("agent_" + slug).toString(), watch, false, span);
await this.DeleteKey(("agent_" + slug + "agent").toString(), watch, false, span);
}
if (!NoderedUtil.IsNullEmpty(_id)) await this.DeleteKey(("agent_" + _id).toString(), watch, false, span);
}
private async QueueUpdate(_id: string, name: string, watch: boolean, span: Span) {
Expand Down
4 changes: 2 additions & 2 deletions OpenFlow/src/WebServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,10 @@ export class WebServer {
id: result._id.toString()})).finish()})

} else {
throw new Error("Access denied")
throw new Error("Access denied, downloading " + msg.id)
}
} else {
throw new Error("Access denied")
throw new Error("Access denied (No id)")
// var filename = msg.filename;
// await protowrap.sendFileContent(client, reply.rid, filename, SendFileHighWaterMark);
// msg.filename = path.basename(filename);
Expand Down
5 changes: 4 additions & 1 deletion OpenFlow/src/dockerdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export class dockerdriver implements i_agent_driver {
const Env = [
"jwt=" + agentjwt,
"agentid=" + agent._id,
"packageid=" + agent.package,
"apiurl=" + apiurl,
"grpcapiurl=" + grpcapiurl,
"wsapiurl=" + wsapiurl,
Expand All @@ -193,6 +192,10 @@ export class dockerdriver implements i_agent_driver {
"oidc_authorization_endpoint=" + Config.agent_oidc_authorization_endpoint,
"oidc_token_endpoint=" + Config.agent_oidc_token_endpoint,
]
let packageid = agent.package || "";
if(packageid != "") {
Env.push("packageid=" + packageid);
}
if(agent.environment != null) {
var keys = Object.keys(agent.environment);
for(var i = 0; i < keys.length; i++) {
Expand Down
20 changes: 10 additions & 10 deletions OpenFlow/src/public/Controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8002,10 +8002,10 @@ export class AgentCtrl extends entityCtrl<any> {
console.log("filtered again", this.packages)
}
if (this.model._id == null || this.model._id == "") {
this.model.package = "";
if ((this.model.package == null || this.model.package == "") && this.packages.length > 0) {
this.model.package = this.packages[0]._id;
}
// this.model.package = "";
// if ((this.model.package == null || this.model.package == "") && this.packages.length > 0) {
// this.model.package = this.packages[0]._id;
// }
}
this.packages.unshift({ _id: "", name: "None" })
}
Expand Down Expand Up @@ -8663,12 +8663,12 @@ export class RunPackageCtrl extends entityCtrl<Base> {
this.packages = this.packages.filter(x => x.chrome != true && x.chromium != true)
console.log("filtered again", this.packages)
}
if(this.packages.find(x => x._id == this.package) == null) {
this.package = "";
}
if(this.package == "" && this.packages.length > 0) {
this.package = this.packages[0]._id;
}
// if(this.packages.find(x => x._id == this.package) == null) {
// this.package = "";
// }
// if(this.package == "" && this.packages.length > 0) {
// this.package = this.packages[0]._id;
// }
if (!this.$scope.$$phase) { this.$scope.$apply(); }
}
async addprocess(streamid:string, schedulename:string = undefined): Promise<void> {
Expand Down

0 comments on commit f164620

Please sign in to comment.