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

Storage APIs Added, WS connection changed #159

Merged
merged 12 commits into from
Dec 19, 2024
2 changes: 1 addition & 1 deletion studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "eslint --ext .js,.vue ./",
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
"test": "echo \"No test specified\" && exit 0",
"dev": "concurrently \"quasar dev\" \"node connect-ws.js\"",
"dev": "quasar dev",
"build": "quasar build"
},
"dependencies": {
Expand Down
6 changes: 4 additions & 2 deletions studio/quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module.exports = configure(function (/* ctx */) {
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli-vite/boot-files
boot: [
'ws'
'ws',
'axios'
],

// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
Expand Down Expand Up @@ -102,7 +103,8 @@ module.exports = configure(function (/* ctx */) {

// Quasar plugins
plugins: [
'Notify'
'Notify',
'Loading'
],
},

Expand Down
3 changes: 3 additions & 0 deletions studio/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
<script setup>
defineOptions({
name: "App",
mounted() {
window.zillaApp = this;
}
});
</script>
27 changes: 27 additions & 0 deletions studio/src/boot/axios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import axios from 'axios';
import { boot } from 'quasar/wrappers'
import { hideLoader, showLoader } from 'src/services/loading';

export default boot(({ app }) => {
axios.interceptors.request.use(
(config) => {
showLoader();
return config;
},
(error) => {
hideLoader();
return Promise.reject(error);
}
);

axios.interceptors.response.use(
(response) => {
hideLoader();
return response;
},
(error) => {
hideLoader();
return Promise.reject(error);
}
);
})
16 changes: 11 additions & 5 deletions studio/src/pages/shared/CommonTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
unelevated
icon="img:icons/trash-white.svg"
:ripple="false"
v-if="showStorage"
v-if="showStorage && selectedRows.length > 0"
color="negative"
class="rounded-10 text-white text-capitalize self-center btn-add-new"
@click="handleClick"
@click="handleDelete"
/>

<q-btn
unelevated
icon="img:/icons/login.svg"
:ripple="false"
v-if="showStorage"
v-if="showStorage && selectedRows.length > 0"
color="dark"
class="rounded-10 text-white text-capitalize self-center btn-add-new highlighted-border"
@click="handleClick"
Expand All @@ -52,7 +52,7 @@
unelevated
icon="img:/icons/export-bucket.svg"
:ripple="false"
v-if="showStorage"
v-if="showStorage && selectedRows.length > 0"
color="light-green"
class="rounded-10 text-white text-capitalize self-center btn-add-new"
@click="handleClick"
Expand All @@ -65,7 +65,7 @@
v-if="showStorage"
color="dark"
class="rounded-10 text-white text-capitalize self-center btn-add-new highlighted-border"
@click="handleClick"
@click="handleAdd"
/>

<q-input
Expand Down Expand Up @@ -503,6 +503,12 @@ export default defineComponent({
handleClick() {
this.$emit("add-new");
},
handleDelete() {
this.$emit("delete-item", this.selectedRows);
},
handleAdd() {
this.$emit("add-item");
},
goToPage(page) {
if (page >= 1 && page <= this.totalPages) {
this.pagination.page = page;
Expand Down
74 changes: 3 additions & 71 deletions studio/src/pages/user_account/FunctionComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -325,65 +325,9 @@ export default defineComponent({
field: "type",
sortable: true,
},
// {
// name: "bodyOrExternalName",
// label: "Body/ External Name",
// align: "center",
// field: "bodyOrExternalName",
// sortable: true,
// },
{ name: "actions", label: "Actions", align: "center" },
],
tableData: [
{
id: 1,
name: "Example Data Table",
parameters: "Lorem ipsum",
returnType: "Lorem ipsum",
language: "PHP",
type: "External",
},
{
id: 2,
name: "Example Data Table",
parameters: "Lorem ipsum",
returnType: "Lorem ipsum",
language: "JavaScript",
type: "Embedded",
},
{
id: 3,
name: "Example Data Table",
parameters: "Lorem ipsum",
returnType: "Lorem ipsum",
language: "R",
type: "External",
},
{
id: 4,
name: "Example Data Table",
parameters: "Lorem ipsum",
returnType: "Lorem ipsum",
language: "PHP",
type: "Embedded",
},
{
id: 5,
name: "Example Data Table",
parameters: "Lorem ipsum",
returnType: "Lorem ipsum",
language: "SQL",
type: "External",
},
{
id: 6,
name: "Example Data Table",
parameters: "Lorem ipsum",
returnType: "Lorem ipsum",
language: "Python",
type: "Embedded",
},
],
tableData: [],
functionTypeRow: [
{ name: "", type: "", defaultValue: "" },
{ name: "", type: "", defaultValue: "" },
Expand Down Expand Up @@ -530,19 +474,7 @@ export default defineComponent({
},
getFunctionInformations() {
this.$ws.sendMessage(
`SELECT
p.proname as "name",
pg_catalog.pg_get_function_arguments(p.oid) as "parameters",
pg_catalog.pg_get_function_result(p.oid) as "returnType"
FROM
pg_catalog.pg_proc p
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
WHERE
pg_catalog.pg_function_is_visible(p.oid)
AND n.nspname <> 'pg_catalog'
AND n.nspname <> 'information_schema'
ORDER BY p.proname;
`,
`SHOW FUNCTIONS;`,
"get_function"
);
},
Expand All @@ -554,7 +486,7 @@ ORDER BY p.proname;
return defaultValue
? `${name} ${type} DEFAULT ${defaultValue}`
: `${name} ${type}`;
})
})
.join(", ");

return `
Expand Down
Loading
Loading