Skip to content

Commit

Permalink
Merge pull request #77 from constantine2nd/develop
Browse files Browse the repository at this point in the history
Git commit id
  • Loading branch information
constantine2nd authored Dec 25, 2024
2 parents de4cac4 + bbfd1ae commit e418bb8
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<link rel="stylesheet" href="/styles/androidstudio.min.css" />
<script src="/js/highlight.min.js"></script>
<script src="/js/highlightjs-line-numbers.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
.loading-page {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "api-explorer",
"version": "1.0.29",
"version": "1.1.1",
"private": true,
"scripts": {
"dev": "vite & ts-node server/app.ts",
Expand Down
16 changes: 14 additions & 2 deletions server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,20 @@ console.log(
)

// Get commit ID
export const commitId = execSync('git rev-parse HEAD').toString().trim();
console.log('Current Commit ID:', commitId);
export let commitId = '';

try {
// Try to get the commit ID
commitId = execSync('git rev-parse HEAD', { encoding: 'utf-8' }).trim();
console.log('Current Commit ID:', commitId);
} catch (error) {
// Log the error but do not terminate the process
console.error('Warning: Failed to retrieve the commit ID. Proceeding without it.');
console.error('Error details:', error.message);
commitId = 'unknown'; // Assign a fallback value
}
// Continue execution with or without a valid commit ID
console.log('Execution continues with commitId:', commitId);

// Error Handling to Shut Down the App
server.on('error', (err) => {
Expand Down
33 changes: 28 additions & 5 deletions src/components/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,9 @@ const copyToClipboard = () => {
<input type="text" v-show="exampleRequestBody" v-model="exampleRequestBody" />
</div>
<div v-show="successResponseBody">
<pre><span>{{ responseHeaderTitle }}:</span>
<code>
<div id="code" v-html="successResponseBody"></div>
</code>
</pre>
<p class="header-container">{{ responseHeaderTitle }}:</p>
<pre><button @click="copyToClipboard" class="copy-button icon-md-heavy" title="Copy to Clipboard"><i class="material-icons">content_copy</i></button>
<code><div id="code" v-html="successResponseBody"></div></code></pre>
</div>
<el-form ref="roleFormRef" :model="roleForm">
<div v-show="showRequiredRoles">
Expand Down Expand Up @@ -456,4 +454,29 @@ li {
#conector-method-link {
color: white !important;
}
.copy-button {
background: none;
border: none;
padding: 0;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}

.copy-button .material-icons {
font-size: 20px;
color: #757575;
transition: color 0.2s ease, transform 0.2s ease;
}

.copy-button:hover .material-icons {
color: #424242;
transform: scale(1.1);
}

.copy-button:active .material-icons {
color: #212121;
transform: scale(0.95);
}
</style>

0 comments on commit e418bb8

Please sign in to comment.