Added menus to pipeline cards

This commit is contained in:
Shubham Takode 2024-02-06 12:37:41 +05:30
parent d9eed64770
commit 04c7a922cf
12 changed files with 67 additions and 22 deletions

3
.gitignore vendored
View File

@ -48,3 +48,6 @@ gen-code
# System Files
.DS_Store
Thumbs.db
# history
/.history

5
myreadme.md Normal file
View File

@ -0,0 +1,5 @@
D:\MyClearML>forclearml\Scripts\activate
python mypipeline.py
D:\MyClearML>clearml-agent daemon

19
package-lock.json generated
View File

@ -5374,6 +5374,16 @@
"node": ">=14"
}
},
"node_modules/@popperjs/core": {
"version": "2.11.8",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
}
},
"node_modules/@schematics/angular": {
"version": "16.2.9",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-16.2.9.tgz",
@ -10532,6 +10542,15 @@
}
}
},
"node_modules/font-awesome": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz",
"integrity": "sha512-U6kGnykA/6bFmg1M/oT9EkFeIYv7JlX3bozwQJWiiLz6L0w3F5vBVPxHlwyX/vtNq1ckcpRKOB9f2Qal/VtFpg==",
"peer": true,
"engines": {
"node": ">=0.10.3"
}
},
"node_modules/for-each": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",

View File

@ -1,43 +1,41 @@
const fs = require('fs');
const fs = require("fs");
const targets = [
'https://api.trains-master.hosted.allegro.ai', // 1
];
const targets = ["http://localhost:8008"];
const PROXY_CONFIG = {
'^/version.json$': {
"^/version.json$": {
bypass: (req, res, proxyOptions) => {
let url;
if (req.url === '/version.json') {
url = 'src/version.json';
} else if (req.url === '/configuration.json') {
url = 'src/configuration.json';
} else if (req.url === '/onboarding.json') {
url = 'src/onboarding.json';
if (req.url === "/version.json") {
url = "src/version.json";
} else if (req.url === "/configuration.json") {
url = "src/configuration.json";
} else if (req.url === "/onboarding.json") {
url = "src/onboarding.json";
} else {
return req.url;
return req.url;
}
const ver = fs.readFileSync(url);
res.writeHead(200, {
'Content-Length': ver.length,
'Content-Type': 'application/json'
"Content-Length": ver.length,
"Content-Type": "application/json",
});
res.end(ver);
return true;
}
}
},
},
};
targets.forEach((target, i) => {
const path = `/service/${i+1}/api`;
PROXY_CONFIG[path + '/*'] = {
const path = `/service/${i + 1}/api`;
PROXY_CONFIG[path + "/*"] = {
target: target,
secure: false,
changeOrigin: true,
pathRewrite: {
[path]: ''
}
[path]: "",
},
};
});

View File

@ -64,6 +64,7 @@ export const ICONS = {
METRICS: 'fa-chart-area',
TOKEN: 'fa-key',
EDIT: 'al-ico-edit',
EDIT2: 'fa-pen-to-square',
EDITABLE: 'fa-pencil',
RESET: 'al-ico-reset',
CLONE: 'al-ico-clone',

View File

@ -2,6 +2,12 @@
class="p-0 cell menu-button al-icon al-color blue-300 al-ico-bars-menu"
></div>
<mat-menu #pipelinesMenu="matMenu">
<button mat-menu-item (click)="edit.emit()">
<i class="fa-solid al-icon sm-md" [class]="icons.EDIT2"></i>Edit
</button>
<button mat-menu-item (click)="runs.emit()">
<i class="al-icon sm-md" [class]="icons.RUN"></i>Runs
</button>
<button mat-menu-item (click)="rename.emit()">
<i class="al-icon sm-md" [class]="icons.EDIT"></i>Rename
</button>

View File

@ -13,6 +13,8 @@ export class PipelineCardMenuComponent {
@Input() project: Project;
@Input() allTags: string[];
@Output() run = new EventEmitter();
@Output() edit = new EventEmitter();
@Output() runs = new EventEmitter();
@Output() addTag = new EventEmitter<string>();
@Output() rename = new EventEmitter();
@Output() delete = new EventEmitter();

View File

@ -47,6 +47,8 @@
(run)="run.emit()"
(rename)="editName.inlineActivated()"
(addTag)="addTag.emit($event)"
(runs)="runs.emit(project)"
(edit)="edit.emit(project)"
(delete)="delete.emit()"
data-id="pipelineCardMenu"
></sm-pipeline-card-menu>

View File

@ -44,6 +44,8 @@ import {ShowTooltipIfEllipsisDirective} from '@common/shared/ui-components/indic
export class PipelineCardComponent extends ProjectCardComponent {
@Input() allTags: string[];
@Output() run = new EventEmitter();
@Output() runs = new EventEmitter(); // view runs for pipeline
@Output() edit = new EventEmitter(); // edit pipeline
@Output() addTag = new EventEmitter<string>();
@Output() removeTag = new EventEmitter<string>();
@Output() delete = new EventEmitter();

View File

@ -38,6 +38,8 @@
(addTag)="addTag(project, $event)"
(removeTag)="removeTag(project, $event)"
(delete)="deleteProject(project)"
(runs)="projectCardClicked($event)"
(edit)="pipelineEditClicked($event)"
></sm-pipeline-card>
</ng-container>

View File

@ -118,6 +118,11 @@ if __name__ == '__main__':
this.store.dispatch(setSelectedProjectId({projectId: project.id, example: isExample(project)}));
}
public pipelineEditClicked(pipeline: ProjectsGetAllResponseSingle) {
this.router.navigate([pipeline.id, 'edit'], {relativeTo: this.projectId ? this.route.parent.parent.parent : this.route});
this.store.dispatch(setSelectedProjectId({projectId: pipeline.id, example: isExample(pipeline)}));
}
protected override getName() {
return EntityTypeEnum.pipeline;
}

View File

@ -65,7 +65,7 @@ export const BASE_ENV = {
apiBaseUrl: null,
fileBaseUrl: null,
productName: 'clearml',
demo: false,
demo: true,
headerPrefix: 'X-Clearml',
version: versionConf.version,
userKey: 'EYVQ385RW7Y2QQUH88CZ7DWIQ1WUHP',
@ -73,7 +73,7 @@ export const BASE_ENV = {
companyID: 'd1bd92a3b039400cbafc60a7a5b1e52b',
loginNotice: '',
loginBanner: '',
autoLogin: false,
autoLogin: true,
whiteLabelLogo: null,
whiteLabelLink: null,
whiteLabelLoginTitle: null,