-
Notifications
You must be signed in to change notification settings - Fork 973
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4690 from Countly/SER-868-update-version--view-to…
…-new-UI [SER-868] version history new UI
- Loading branch information
Showing
9 changed files
with
114 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
frontend/express/public/core/version-history/javascripts/countly.views.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* global countlyVue, app, countlyGlobal, countlyVersionHistoryManager, CV, jQuery*/ | ||
var VersionHistoryView = countlyVue.views.create({ | ||
template: CV.T('/core/version-history/templates/version-history.html'), | ||
data: function() { | ||
return { | ||
tableData: { | ||
db: [], | ||
fs: [], | ||
pkg: "", | ||
mongo: "" | ||
} | ||
}; | ||
}, | ||
mounted: function() { | ||
this.tableData = countlyVersionHistoryManager.getData(true) || this.tableData; | ||
}, | ||
methods: { | ||
getTable: function(dataObj) { | ||
if (!Array.isArray(dataObj)) { | ||
dataObj = []; | ||
} | ||
if (dataObj.length === 0) { | ||
dataObj.push({"version": countlyGlobal.countlyVersion, "updated": new Date().toString()}); | ||
dataObj[dataObj.length - 1].version += " " + jQuery.i18n.map["version_history.current-version"]; | ||
|
||
} | ||
else { | ||
dataObj[dataObj.length - 1].version = this.tableData.pkg + " " + jQuery.i18n.map["version_history.current-version"]; | ||
dataObj[dataObj.length - 1].updated = new Date(dataObj[dataObj.length - 1].updated).toString(); | ||
} | ||
|
||
return dataObj; | ||
} | ||
}, | ||
computed: { | ||
dbTitle: function() { | ||
return jQuery.i18n.map["version_history.page-title"] + " (DB)"; | ||
}, | ||
fsTitle: function() { | ||
return jQuery.i18n.map["version_history.page-title"] + " (FS)"; | ||
}, | ||
packageVersion: function() { | ||
return jQuery.i18n.map["version_history.package-version"] + ": " + this.tableData.pkg; | ||
}, | ||
mongoVersion: function() { | ||
return "MongDb version: " + this.tableData.mongo; | ||
}, | ||
versionHistoryViewDbRows: function() { | ||
return this.getTable(this.tableData.db); | ||
|
||
}, | ||
versionHistoryViewFsRows: function() { | ||
return this.getTable(this.tableData.fs); | ||
} | ||
|
||
} | ||
}); | ||
|
||
app.route("/versions", 'versions', function() { | ||
this.renderWhenReady(new CV.views.BackboneWrapper({ | ||
component: VersionHistoryView | ||
})); | ||
}); |
5 changes: 5 additions & 0 deletions
5
frontend/express/public/core/version-history/stylesheets/_main.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.header{ | ||
display: flex; | ||
flex-direction: column; /* Stack divs vertically */ | ||
gap: 20px; /* Add space between divs */ | ||
} |
38 changes: 38 additions & 0 deletions
38
frontend/express/public/core/version-history/templates/version-history.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<div v-bind:class="[componentId]" class="version-history-view"> | ||
<cly-header> | ||
<template v-slot:header-left> | ||
<div class="header"> | ||
<div>{{ packageVersion }}</div> | ||
<div>{{ mongoVersion }}</div> | ||
</div> | ||
</template> | ||
</cly-header> | ||
<cly-main> | ||
|
||
<cly-section> | ||
<cly-datatable-n :rows="versionHistoryViewDbRows" :resizable="true" > | ||
<template v-slot:header-left="selectScope"> | ||
<p> {{ dbTitle }} </p> | ||
</template> | ||
<template v-slot="scope"> | ||
<el-table-column column-key="version" prop="version" sortable="custom" :label="i18n('version_history.version')"></el-table-column> | ||
<el-table-column column-key="updated" prop="updated" sortable="custom" :label="i18n('version_history.upgraded')"></el-table-column> | ||
</template> | ||
</cly-datatable-n> | ||
</cly-section> | ||
|
||
<cly-section> | ||
<cly-datatable-n :rows="versionHistoryViewFsRows" :resizable="true" > | ||
<template v-slot:header-left="selectScope"> | ||
<p> {{ fsTitle }} </p> | ||
</template> | ||
<template v-slot="scope"> | ||
<el-table-column column-key="version" prop="version" sortable="custom" :label="i18n('version_history.version')"></el-table-column> | ||
<el-table-column column-key="updated" prop="updated" sortable="custom" :label="i18n('version_history.upgraded')"></el-table-column> | ||
</template> | ||
</cly-datatable-n> | ||
</cly-section> | ||
|
||
</cly-main> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters