Skip to content

Commit

Permalink
Storage APIs Added, WS connection changed (#159)
Browse files Browse the repository at this point in the history
* Studio UI Code Added

* Studio Sub Directory Added

* Websocket Connection Added

* Function and Views Update

* Validations Added, Auth Page APIs Added

* Update app.js

* Storage APIs Added

* Dummy Data Removed from Functions

* Websocket Connection Changed
  • Loading branch information
Tafseerhussain authored Dec 19, 2024
1 parent 931dd10 commit 353d98a
Show file tree
Hide file tree
Showing 11 changed files with 513 additions and 209 deletions.
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

0 comments on commit 353d98a

Please sign in to comment.