Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pa table header refresh #24

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
008f85b
update documentation
aschwanden1 Jul 25, 2022
7243e79
Fix customization.js, instance directory was not accessible by cherry…
aschwanden1 Jul 25, 2022
48a9532
style buttons and tabs
aschwanden1 Jul 26, 2022
1650109
breadcrumb styling to give it a more clean and professional look
aschwanden1 Jul 27, 2022
0ffb581
merge
aschwanden1 Aug 3, 2022
08aa9f3
add styling for the main summary table
aschwanden1 Aug 3, 2022
552f594
debug assistance for resp object
aschwanden1 Aug 3, 2022
ee7795f
testing commit
aschwanden1 Aug 3, 2022
78e0e51
Add configurations for curated sight and intro blurbs
aschwanden1 Aug 3, 2022
53c7db3
added new home tab for new curate sites page
aschwanden1 Aug 4, 2022
60b7def
update mongoDB restore documentation
aschwanden1 Aug 4, 2022
6c3ae41
Dashboard title styling and CSS in header, as well as making it confi…
aschwanden1 Aug 4, 2022
8a1481e
Implementation of intro and outro blurbs in a vue component
aschwanden1 Aug 4, 2022
5036863
Implement persistance layer reusable for many uses. Now integrated w…
aschwanden1 Aug 5, 2022
c76829b
Update intro text to give example of intro blurbs we could use
aschwanden1 Aug 5, 2022
26fa56a
move lib.js to js directory and update references
aschwanden1 Aug 5, 2022
279d722
move imgs to img directory and update references
aschwanden1 Aug 5, 2022
e3fedf5
RowAccordian setup and implementation, initial
aschwanden1 Aug 6, 2022
a87335d
Update curated sites
aschwanden1 Aug 6, 2022
93e5100
Implement property passing and toggle functionality
aschwanden1 Aug 6, 2022
3f95ca3
Refactor summary site view into its own page
aschwanden1 Aug 6, 2022
86ad558
Documentation changes, as per code review
aschwanden1 Aug 9, 2022
0bc50c0
remove extraneous debug code
aschwanden1 Aug 9, 2022
0ed5fa9
remove curated sites
aschwanden1 Aug 9, 2022
165860c
Removing ALL CSS styling changes.
aschwanden1 Aug 9, 2022
0c539f0
IntroBlurb styling and banner position
aschwanden1 Aug 10, 2022
45786e2
delete localstorage file
aschwanden1 Aug 10, 2022
fe280cc
rename summarySiteView.js
aschwanden1 Aug 10, 2022
1391065
remove JSON not used yet
aschwanden1 Aug 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
# psi-j-testing-service
# psi-j-testing-service

# make virtual environment
virtualvenv psi
source psi/bin/activate

# install some things.

pip3 install -r requirements.txt

cd ~/psi-j-testing-service/src/psij/testing
python3 service.py

# you will need mongoDB, follow the instructions here, it takes a while to install.
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/

On Mac OS X, the last step is:
brew services start [email protected]



Creating A Local Dev Environment
------------------------------------------------------
This starts the service witch allows things to run locally:
cd ~/psi-j-testing-service;
python3 src/psij/testing/service.py
Comment on lines +24 to +26
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this belongs in a README-dev.md document or under a section that specifies that this allows one to create a local development environment.


then you can see it at this url:
http://127.0.0.1:9909/summary.html



To populate the data i need to run psi-j-python:
Edit testing.conf first and, at a minimum, update the url to point to your server
server_url = http://0.0.0.0:9909

~/psi-j-python: pip3 install -r requirements-dev.txt
~/psi-j-python: make tests -- --upload-results


Restoring a mongodump DB:
You'll want to get a full dump, that way you can play with the data:

First untar these:
mongodump-psij.tar
mongodump-sdk.tar.gz

mongorestore dump/



28 changes: 28 additions & 0 deletions src/psij/web/style.css → src/psij/web/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ body {
width: 100%;
text-align: right;
margin-bottom: 32pt;
position: relative;
}

#toolbar .spacer {
Expand Down Expand Up @@ -547,3 +548,30 @@ td.run-id {
.calendar-cell {
text-align: center;
}

.IntroBlurb {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we may want to be consistent with naming conventions. Either use CamelCase for everything or use dashes, as in intro-blurb.

background-color: #ffffff;
border: 1px solid #e2e2e2;
border-radius: 5px;
padding: 9px;
margin: 10px 0 10px 0;
font-size: 13px;
color: #000000;
position: relative;
}

.IntroBlurb .CloseMe {
position: absolute;
top: 7px;
right: 10px;
color: #999999;
font-size: 17px;
cursor: pointer;
}

.dashboard-title {
position: absolute;
left: 110px;
top: 10px;
font-weight: bold;
}
File renamed without changes
38 changes: 38 additions & 0 deletions src/psij/web/js/IntroBlurb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var VC = VC || {};

VC.IntroBlurb = Vue.component("intro-blurb", {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry a bit here about an inner platform, in which we are developing a complex solution for something that can already be done with standard tools. It may be better to have a simple variable in customization.js that allows one to distinguish between the projects. Then, in the html source, we can have two divs with the relevant blurbs and corresponding v-if conditions. For example:

<div v-if="CUSTOMIZATION.projectName == 'PSI/J'">intro for psi-j</div>
<div v-if="CUSTOMIZATION.projectName == 'SDK'">intro for sdk</div>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may not have been at the meeting. I was told that we would have different deployments and that people wanted to be able to change the text without having to make changes in the code, other than a config file. The idea was that the config file could be changed to accomodate any text string changes OR you could have one config file for PSI/J and another one for SDK and another one for another use case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible that things weren't that clear during the meeting. I apologize for that. We already have different deployments and we don't want to maintain two codebases, which we don't. But changing html or changing a .js file, that is still changing some form of code. So again, let's try to keep this simple with text in a single place rather than spread around.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I meant was just keep all the text in one file. It doesn't have to be customization.js. It could be any other config file, whatever you want me to call it. The reason they want it in 1 file is because that way it's easier to make text changes because it's all in one place. Also, they want to be able to specify which machines to show. And, as another requirement, they told me they want to be able to do more than 1 or 2 deployments. And so, if we do it in the HTML file, we'll have to add a new IF statement for every place where we do a text replacement, whenever we add a new deployment. However, if all the text is in one config file, we just add or create a new config file.

data: function () {

return {
show: 0
}
},
template: '<div v-if="this.show == 1" ref="myRef" class="IntroBlurb" v-on:click="close( $event )">' +
'<div class="main_slot"><slot></slot></div>' +
'<div class="CloseMe">X</div>' +
'</div>',
mounted: function( event ) {
console.log('mounted');
var content = this.$slots.default[0].text;
console.dir( content );

var hideBlurb = Cookies.get( content );

if( hideBlurb === "1" ) {
// hide
this.show = 0;
} else {
this.show = 1;
}
},
methods: {
close: function( event ) {

var ihtml = this.$el.firstChild.innerHTML;
console.log(ihtml);

Cookies.set( ihtml, "1" )
this.show = 0;
}
}
});
26 changes: 26 additions & 0 deletions src/psij/web/js/RowAccordian.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var VC = VC || {};

VC.RowAccordian = Vue.component("row-accordian", {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think vuetify already has the necessary component: https://vuetifyjs.com/en/components/expansion-panels/

Maybe we can use that instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They want to do it in a Table format and we want that table to look seamless to the user with triangle open/closers on the side (so we would need to find one that does that). Also, it's been my experience that if we want the accordian to do anything else in the future, it'll be easier if we just make it ourselves.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep styling separate from functionality. I would rather have one consistent styling coming from vuetify than coming up with something else for every component.

It is important here to not only think of what is easy for us, but what would be easy for external contributors to quickly jump into. I think we are already doing a bit too much customization (and I am very much guilty of this), but I also think that in cases such as this, when a component already exists, we should use it.

props: [
'logo_name',
'machines',
'logo_results',
'machine_row_results'
],
data: function () {

return {
open: 1
}
},
template: '<table>' +
'</table>',
mounted: function( event ) {
},
methods: {
toggle: function( event ) {

this.open = this.open ? 0 : 1;
}
}
});
12 changes: 12 additions & 0 deletions src/psij/web/js/customization.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CUSTOMIZATION = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was not meant to be placed in the repo, at least not like this. This is used to distinguish between the different deployments (SDK and PSI/J), and we should either not have it in the repo, or have it disabled and clearly marked as a template (e.g. customization.js.example), or something like that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so I could just rename it to customization.js.example That would rename it and disable it. sound ok?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe, I could move the entire CONF variable to another file and not check in the customization.js Would that work?

projectName: "PSI/J"
}

var CONF = {
STR: {
"dashboardTitle": "Exascale dashboard testing service",
"introBlurb": "The dashboard testing service shows you the status of various sites in the calendar view by date and machine without curation.",
"bottomBlurb": "The curated sites tab will eventually show labs on the left which are expandable to show the machines of each lab on the y axis. Meanwhile, the X axis will show you test cases like PSI/J and PSI/J Parcel, etc."
}
};

1 change: 1 addition & 0 deletions src/psij/web/lib.js → src/psij/web/js/lib.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// lib.js
var badness = function(obj) {
if (obj['failed_count'] > 0) {
if (obj['completed_count'] < obj['failed_count']) {
Expand Down
89 changes: 89 additions & 0 deletions src/psij/web/js/summary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
var sites = [
];

settingsDefaults({"viewMode": "calendar", "inactiveTimeout": 10, "showBranchBubbles": false});

set = function(dst, src) {
dst.length = 0;
for (var i = 0; i < src.length; i++) {
dst.push(src[i]);
}
}

update = function() {
$.get("summary", settings("inactiveTimeout"), function(data) {
set(sites, data);
});
};

update();

var siteStatus = new Vue({
el: "#container",
components: {
'intro-blurb':VC.IntroBlurb
},
vuetify: new Vuetify(),
data: {
sites: sites,
mode: '',
now: moment().utc().startOf("day"),
settingsDialog: false,
STR: CONF.STR
},
methods: globalMethods,
computed: {
inactiveTimeout: makeSetting("inactiveTimeout", update),
showBranchBubbles: makeSetting("showBranchBubbles", update, "bool"),
allBranches: function() {
var unique = {};
for (var i = 0; i < this.sites.length; i++) {
var site = this.sites[i];
var branches = site.branches;
for (var j = 0; j < branches.length; j++) {
var branch = branches[j];
if (branch.name in unique) {
var existing = unique[branch.name];
existing['failed_count'] += branch['failed_count'];
existing['completed_count'] += branch['completed_count'];
}
else {
unique[branch.name] = {... branch};
unique[branch.name]['sites'] = {};
}
unique[branch.name]['sites'][site.site_id] = branch;
}
}

values = [];
for (var k in unique) {
values.push(unique[k]);
}
return this.sort('name', values);
},
branchIndexMap: function() {
var all = this.allBranches;
var map = {};
for (var i = 0; i < all.length; i++) {
map[all[i].name] = i;
}
return map;
}
}
});

var setViewMode = function(viewMode) {
if (viewMode === undefined) {
viewMode = Cookies.get('viewMode');
}
if (viewMode === undefined) {
viewMode = 'calendar';
}
Cookies.set('viewMode', viewMode);
$('.view-mode-group').removeClass('selected');
$('#view-mode-' + viewMode).addClass('selected');
siteStatus.mode = viewMode;
}

setViewMode();

8 changes: 4 additions & 4 deletions src/psij/web/run.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/ansi_up.js"></script>
<script src="lib.js"></script>
<link rel="stylesheet" href="style.css">
<script src="js/lib.js"></script>
<link rel="stylesheet" href="css/style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet">
<script src="/instance/customization.js"></script>
<script src="/js/customization.js"></script>
</head>
<body>
<div id="container">
Expand All @@ -33,7 +33,7 @@
{{ branch.name }}
<div class="counts">
<span class="failed-count" v-if="branch.failed_count > 0">{{ branch.failed_count }}</span>
<img class="check-mark" src="checkmark.png" v-if="branch.failed_count == 0"/>
<img class="check-mark" src="imgs/checkmark.png" v-if="branch.failed_count == 0"/>
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/psij/web/site.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/ansi_up.js"></script>
<script src="lib.js"></script>
<link rel="stylesheet" href="style.css">
<script src="js/lib.js"></script>
<link rel="stylesheet" href="css/style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet">
<script src="/instance/customization.js"></script>
<script src="/js/customization.js"></script>
</head>
<body>
<div id="container">
Expand Down Expand Up @@ -48,7 +48,7 @@
</div>
<div class="counts">
<span class="failed-count" v-if="branch.failed_count > 0">{{ branch.failed_count }}</span>
<img class="check-mark" src="checkmark.png" v-if="branch.failed_count == 0"/>
<img class="check-mark" src="imgs/checkmark.png" v-if="branch.failed_count == 0"/>
</div>
</div>
</div>
Expand Down
Loading