Skip to content

Commit

Permalink
Fix client side rpc timeout by using the one supplied from controller (
Browse files Browse the repository at this point in the history
…#3)

* Fetch rpc timeout value from controller
* Set title to EVerest admin panel
* Update some dependencies
* Fix usage of v-text
* Add tag input to package workflow

---------

Signed-off-by: Kai-Uwe Hermann <[email protected]>
  • Loading branch information
hikinggrass authored Oct 2, 2023
1 parent 50026c5 commit cca2952
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 36 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Package everest-admin-panel

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
tag:
type: string
description: Image tag
default: 'latest'

jobs:
package:
Expand All @@ -20,5 +26,5 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: manually_dispatched
tag_name: ${{ inputs.tag }}
files: everest-admin-panel.tar.gz
56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@koumoul/vjsf": "^2.11.3",
"core-js": "^3.8.3",
"just-clone": "^5.0.1",
"konva": "^8.3.5",
"@koumoul/vjsf": "^2.22.1",
"core-js": "^3.32.2",
"just-clone": "^6.2.0",
"konva": "^8.4.3",
"register-service-worker": "^1.7.2",
"roboto-fontface": "*",
"vue": "^2.6.14",
"vue-class-component": "^7.2.3",
"vue": "^2.7.14",
"vue-class-component": "^7.2.6",
"vue-property-decorator": "^9.1.2",
"vue-router": "^3.5.1",
"vuetify": "^2.6.0",
"vue-router": "^3.6.5",
"vuetify": "^2.7.1",
"vuex": "^3.6.2"
},
"devDependencies": {
"@mdi/font": "^6.5.95",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@vue/cli": "^5.0.1",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-pwa": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/eslint-config-typescript": "^9.1.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"sass": "^1.32.7",
"sass-loader": "^12.0.0",
"typescript": "~4.5.5",
"vue-cli-plugin-vuetify": "~2.4.7",
"vue-template-compiler": "^2.6.14",
"vuetify-loader": "^1.7.0"
"@mdi/font": "^6.9.96",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"@vue/cli": "^5.0.8",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-pwa": "~5.0.8",
"@vue/cli-plugin-router": "~5.0.8",
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-plugin-vuex": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/eslint-config-typescript": "^12.0.0",
"eslint": "^8.50.0",
"eslint-plugin-vue": "^9.17.0",
"sass": "^1.68.0",
"sass-loader": "^12.6.0",
"typescript": "~5.2.2",
"vue-cli-plugin-vuetify": "~2.5.8",
"vue-template-compiler": "^2.7.14",
"vuetify-loader": "^1.9.2"
}
}
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<title>EVerest admin panel</title>
</head>
<body>
<noscript>
Expand Down
7 changes: 6 additions & 1 deletion src/modules/evbc/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ class EVBackendClient {
}

_on_connected() {
// fetch rpc timeout value
const wait_for_rpc_timeout_value = this._cxn.issue_rpc("get_rpc_timeout", null, false).then((result) => {
this._cxn._rpc_timeout_ms = result as number;
});

// fetch all needed definitions
// FIXME (aw): how to deal with errors, what about the 'as' type casting ?
const wait_for_modules = this._cxn.issue_rpc("get_modules", null, false).then((result) => {
Expand All @@ -131,7 +136,7 @@ class EVBackendClient {
this._publish("connection_state", { type: "INFO", text: `Received ${Object.keys(result).length} config files` });
});

Promise.all([wait_for_modules, wait_for_interfaces, wait_for_configs]).then(() => {
Promise.all([wait_for_rpc_timeout_value, wait_for_modules, wait_for_interfaces, wait_for_configs]).then(() => {
this.initialized = true;
this._publish("connection_state", { type: "INITIALIZED", text: "Done initializing" });
});
Expand Down
5 changes: 3 additions & 2 deletions src/modules/evbc/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class EVBackendConnection {
_loopback = false;
_pending_commands = new Map();
_url: string;
_rpc_timeout_ms = RPC_COMMAND_TIMEOUT_MS;
issue_rpc: (method: string, params: unknown, notification: boolean) => Promise<unknown>;

constructor(url: string, listener: ConnectionStatusListener) {
Expand Down Expand Up @@ -111,8 +112,8 @@ class EVBackendConnection {
return new Promise((resolve, reject) => {
const timeout_id = setTimeout(() => {
this._pending_commands.delete(id);
reject(`RPC communication timeout to everest controller process`);
}, RPC_COMMAND_TIMEOUT_MS);
reject(`RPC communication timeout to everest controller process after '${this._rpc_timeout_ms}'ms`);
}, this._rpc_timeout_ms);
this._pending_commands.set(id, { resolve, reject, timeout_id });
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/LoginPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
<v-icon class="grey lighten-1" dark> mdi-server </v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="server.id"></v-list-item-title>
<v-list-item-subtitle v-text="server.addr"></v-list-item-subtitle>
<v-list-item-title>{{ server.id }}</v-list-item-title>
<v-list-item-subtitle>{{ server.addr }}</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action v-if="server.editable">
<v-btn icon @click.prevent.stop="edit_server(index)"><v-icon>mdi-pencil</v-icon></v-btn>
Expand Down

0 comments on commit cca2952

Please sign in to comment.