Commit 2f43d5a6 authored by Le Dinh Trung's avatar Le Dinh Trung

Merge branch 'hotfix/fix-all' into 'dev'

Hotfix/fix all

See merge request !9
parents 6ac57a0f 66e7f51a
......@@ -12,10 +12,10 @@
<b-collapse id="nav-collapse" is-nav>
<b-navbar-nav>
<b-nav-item href="/home/users">USER</b-nav-item>
<b-nav-item href="/home/categories">CATEGORY</b-nav-item>
<b-nav-item href="/home/products">PRODUCT</b-nav-item>
<b-nav-item href="/home/posts">POST</b-nav-item>
<b-nav-item href="/users">USER</b-nav-item>
<b-nav-item href="/categories">CATEGORY</b-nav-item>
<b-nav-item href="/products">PRODUCT</b-nav-item>
<b-nav-item href="/posts">POST</b-nav-item>
</b-navbar-nav>
<!-- Right aligned nav items -->
......@@ -35,7 +35,7 @@
</template>
<script>
export default {
name: "nav",
name: "Nav",
};
</script>
<script>
......@@ -66,7 +66,7 @@ export default {
this.$auth.$storage.setUniversal("loggedIn", "false");
this.$auth.$storage.setUniversal("token", "");
this.$auth.$storage.setUniversal("userName", "");
this.$router.push("/");
this.$router.push("/login");
},
},
};
......
......@@ -23,7 +23,7 @@
</template>
<script>
export default {
name: "sidebar",
name: "SideBar",
};
</script>
<script>
......
......@@ -3,11 +3,11 @@
<Nav />
<nuxt />
</div>
</template>
<script>
import Nav from "@/components/Nav";
import SideBar from "@/components/SideBar";
export default {
components: { Nav },
......
export default ({ redirect }) => {
// console.log('[LOG]: middleware is running ...')
if (localStorage.getItem("token")=="") {
return redirect('/')
return redirect('/login')
}
};
\ No newline at end of file
......@@ -45,6 +45,7 @@ export default {
'@nuxtjs/axios',
'@nuxtjs/auth-next',
'@nuxtjs/toast',
'@pinia/nuxt',
],
bootstrapVue: {
......@@ -52,12 +53,23 @@ export default {
},
axios: {
baseURL: process.env.API_URL || ' http://127.0.0.1:8000/api/',
debug: process.env.DEBUG || false,
proxyHeaders: false,
baseURL: 'http://127.0.0.1:8000/api/',
debug: false,
proxyHeaders: true,
credentials: false,
},
// publicRuntimeConfig: {
// axios: {
// browserBaseURL: process.env.BROWSER_BASE_URL
// }
// },
// privateRuntimeConfig: {
// axios: {
// baseURL: process.env.BASE_URL
// }
// },
auth: {
},
......
......@@ -11,8 +11,8 @@
"dependencies": {
"@nuxtjs/auth-next": "5.0.0-1667386184.dfbbb54",
"@nuxtjs/axios": "^5.0.0",
"@nuxtjs/bootstrap-vue": "^2.0.4",
"@nuxtjs/toast": "^3.3.1",
"@pinia/nuxt": "^0.4.6",
"axios": "^1.2.1",
"bootstrap": "^4.6.2",
"bootstrap-vue": "^2.23.1",
......@@ -21,6 +21,8 @@
"jsonwebtoken": "^9.0.0",
"moment-jalaali": "^0.9.6",
"nuxt": "^2.15.8",
"pinia": "^2.0.29",
"pinia-plugin-persistedstate": "^3.0.2",
"prism-themes": "^1.9.0",
"vue": "^2.7.10",
"vue-axios": "^3.5.2",
......@@ -1690,6 +1692,14 @@
"node": ">=6.9.0"
}
},
"node_modules/@babel/standalone": {
"version": "7.20.13",
"resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.20.13.tgz",
"integrity": "sha512-L13qadxX3yB4mU92iSiWKePm3hYfGaAXPMqGEPUDNzzsmNh0+1M7agMBF62UHM29kFWOWowGfRRDvfAU8uLovg==",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/template": {
"version": "7.20.7",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz",
......@@ -2147,6 +2157,73 @@
"resolved": "https://registry.npmjs.org/defu/-/defu-4.0.1.tgz",
"integrity": "sha512-lC+G0KvvWRbisQa50+iFelm3/eMmwo4IlBmfASOVlw9MZpHHyQeVsZxc5j23+TQy5ydgEoTVSrWl7ptou1kzJQ=="
},
"node_modules/@nuxt/kit": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@nuxt/kit/-/kit-3.1.1.tgz",
"integrity": "sha512-wmqVCIuD/te6BKf3YiqWyMumKI5JIpkiv0li/1Y3QHnTkoxyIhLkbFgNcQHuBxJ3eMlk2UjAjAqWiqBHTX54vQ==",
"dependencies": {
"@nuxt/schema": "3.1.1",
"c12": "^1.1.0",
"consola": "^2.15.3",
"defu": "^6.1.2",
"globby": "^13.1.3",
"hash-sum": "^2.0.0",
"ignore": "^5.2.4",
"jiti": "^1.16.2",
"knitwork": "^1.0.0",
"lodash.template": "^4.5.0",
"mlly": "^1.1.0",
"pathe": "^1.1.0",
"pkg-types": "^1.0.1",
"scule": "^1.0.0",
"semver": "^7.3.8",
"unctx": "^2.1.1",
"unimport": "^2.0.1",
"untyped": "^1.2.2"
},
"engines": {
"node": "^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
"node_modules/@nuxt/kit/node_modules/defu": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.2.tgz",
"integrity": "sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ=="
},
"node_modules/@nuxt/kit/node_modules/globby": {
"version": "13.1.3",
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz",
"integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==",
"dependencies": {
"dir-glob": "^3.0.1",
"fast-glob": "^3.2.11",
"ignore": "^5.2.0",
"merge2": "^1.4.1",
"slash": "^4.0.0"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@nuxt/kit/node_modules/scule": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/scule/-/scule-1.0.0.tgz",
"integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ=="
},
"node_modules/@nuxt/kit/node_modules/slash": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz",
"integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@nuxt/loading-screen": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@nuxt/loading-screen/-/loading-screen-2.0.4.tgz",
......@@ -2176,6 +2253,49 @@
"npm": ">=5.0.0"
}
},
"node_modules/@nuxt/schema": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@nuxt/schema/-/schema-3.1.1.tgz",
"integrity": "sha512-/KuoCDVGrLD9W7vwuYhu4HbdT/BpbrhA4Pm9dGn7Jah40kHDGqUnJxugvMjt+4suq53rLQyTA0LRDWfFxfxAOQ==",
"dependencies": {
"c12": "^1.1.0",
"create-require": "^1.1.1",
"defu": "^6.1.2",
"hookable": "^5.4.2",
"jiti": "^1.16.2",
"pathe": "^1.1.0",
"pkg-types": "^1.0.1",
"postcss-import-resolver": "^2.0.0",
"scule": "^1.0.0",
"std-env": "^3.3.1",
"ufo": "^1.0.1",
"unimport": "^2.0.1",
"untyped": "^1.2.2"
},
"engines": {
"node": "^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
"node_modules/@nuxt/schema/node_modules/defu": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.2.tgz",
"integrity": "sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ=="
},
"node_modules/@nuxt/schema/node_modules/scule": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/scule/-/scule-1.0.0.tgz",
"integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ=="
},
"node_modules/@nuxt/schema/node_modules/std-env": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.1.tgz",
"integrity": "sha512-3H20QlwQsSm2OvAxWIYhs+j01MzzqwMwGiiO1NQaJYZgJZFPuAbf95/DiKRBSTYIJ2FeGUc+B/6mPGcWP9dO3Q=="
},
"node_modules/@nuxt/schema/node_modules/ufo": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/ufo/-/ufo-1.0.1.tgz",
"integrity": "sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA=="
},
"node_modules/@nuxt/server": {
"version": "2.15.8",
"resolved": "https://registry.npmjs.org/@nuxt/server/-/server-2.15.8.tgz",
......@@ -2414,35 +2534,6 @@
"follow-redirects": "^1.14.0"
}
},
"node_modules/@nuxtjs/bootstrap-vue": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@nuxtjs/bootstrap-vue/-/bootstrap-vue-2.0.4.tgz",
"integrity": "sha512-Hhk03J3wEb8PKifGqh3htkFAFNyYVKXcwt49c0zXMcliiQKuhFCnPZWY9nJlz1EXMBUmMXN3bxMwrsXnad/oPw==",
"deprecated": "https://bootstrap-vue.js.org/docs/#nuxt-js",
"dependencies": {
"bootstrap-vue": "^1.0.1"
}
},
"node_modules/@nuxtjs/bootstrap-vue/node_modules/bootstrap-vue": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-1.5.1.tgz",
"integrity": "sha512-bkob7vTHA5VZN6U0Wj34Yj+6jNtqAtc6MwcsLdBz78fcy8Ju5tlYUYMDUefQ0rQH7hhdtFDn9GuDiqhUPmE1sA==",
"hasInstallScript": true,
"dependencies": {
"lodash.startcase": "^4.4.0",
"opencollective": "^1.0.3",
"popper.js": "^1.12.9",
"vue-functional-data-merge": "^2.0.3"
},
"peerDependencies": {
"vue": "^2.4.2"
}
},
"node_modules/@nuxtjs/bootstrap-vue/node_modules/vue-functional-data-merge": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/vue-functional-data-merge/-/vue-functional-data-merge-2.0.7.tgz",
"integrity": "sha512-pvLc+H+x2prwBj/uSEIITyxjz/7ZUVVK8uYbrYMmhDvMXnzh9OvQvVEwcOSBQjsubd4Eq41/CSJaWzy4hemMNQ=="
},
"node_modules/@nuxtjs/proxy": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/proxy/-/proxy-2.1.0.tgz",
......@@ -2505,11 +2596,54 @@
"node": ">= 0.6"
}
},
"node_modules/@pinia/nuxt": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@pinia/nuxt/-/nuxt-0.4.6.tgz",
"integrity": "sha512-HjrYEfLdFpmsjhicPJgL36jVhzHWukIQPFFHGTSF84Cplu+f2nY2XHKqe9ToHzE9rLee2RjLOwAzOnXa/I/u6A==",
"dependencies": {
"@nuxt/kit": "^3.0.0",
"pinia": ">=2.0.27"
},
"funding": {
"url": "https://github.com/sponsors/posva"
}
},
"node_modules/@polka/url": {
"version": "1.0.0-next.21",
"resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz",
"integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g=="
},
"node_modules/@rollup/pluginutils": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
"integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==",
"dependencies": {
"@types/estree": "^1.0.0",
"estree-walker": "^2.0.2",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
}
},
"node_modules/@rollup/pluginutils/node_modules/estree-walker": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
},
"node_modules/@types/estree": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz",
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ=="
},
"node_modules/@types/html-minifier-terser": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.2.tgz",
......@@ -2775,6 +2909,11 @@
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A=="
},
"node_modules/@vue/devtools-api": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.5.0.tgz",
"integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q=="
},
"node_modules/@webassemblyjs/ast": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz",
......@@ -2973,6 +3112,38 @@
"node": ">=0.4.0"
}
},
"node_modules/agent-base": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
"dependencies": {
"debug": "4"
},
"engines": {
"node": ">= 6.0.0"
}
},
"node_modules/agent-base/node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/agent-base/node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/aggregate-error": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
......@@ -3369,49 +3540,6 @@
"@babel/core": "^7.0.0-0"
}
},
"node_modules/babel-polyfill": {
"version": "6.23.0",
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz",
"integrity": "sha512-0l7mVU+LrQ2X/ZTUq63T5i3VyR2aTgcRTFmBcD6djQ/Fek6q1A9t5u0F4jZVYHzp78jwWAzGfLpAY1b4/I3lfg==",
"dependencies": {
"babel-runtime": "^6.22.0",
"core-js": "^2.4.0",
"regenerator-runtime": "^0.10.0"
}
},
"node_modules/babel-polyfill/node_modules/core-js": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
"deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.",
"hasInstallScript": true
},
"node_modules/babel-polyfill/node_modules/regenerator-runtime": {
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
"integrity": "sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w=="
},
"node_modules/babel-runtime": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
"integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==",
"dependencies": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.11.0"
}
},
"node_modules/babel-runtime/node_modules/core-js": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
"deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.",
"hasInstallScript": true
},
"node_modules/babel-runtime/node_modules/regenerator-runtime": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
......@@ -3833,6 +3961,44 @@
"node": ">= 0.8"
}
},
"node_modules/c12": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/c12/-/c12-1.1.0.tgz",
"integrity": "sha512-9KRFWEng+TH8sGST4NNdiKzZGw1Z1CHnPGAmNqAyVP7suluROmBjD8hsiR34f94DdlrvtGvvmiGDsoFXlCBWIw==",
"dependencies": {
"defu": "^6.1.1",
"dotenv": "^16.0.3",
"giget": "^1.0.0",
"jiti": "^1.16.0",
"mlly": "^1.0.0",
"pathe": "^1.0.0",
"pkg-types": "^1.0.1",
"rc9": "^2.0.0"
}
},
"node_modules/c12/node_modules/defu": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.2.tgz",
"integrity": "sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ=="
},
"node_modules/c12/node_modules/dotenv": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
"engines": {
"node": ">=12"
}
},
"node_modules/c12/node_modules/rc9": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/rc9/-/rc9-2.0.1.tgz",
"integrity": "sha512-9EfjLgNmzP9255YX8bGnILQcmdtOXKtUlFTu8bOZPJVtaUDZ2imswcUdpK51tMjTRQyB7r5RebNijrzuyGXcVA==",
"dependencies": {
"defu": "^6.1.2",
"destr": "^1.2.2",
"flat": "^5.0.2"
}
},
"node_modules/cacache": {
"version": "15.3.0",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz",
......@@ -5292,6 +5458,8 @@
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
"integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
"optional": true,
"peer": true,
"dependencies": {
"iconv-lite": "^0.6.2"
}
......@@ -5300,6 +5468,8 @@
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"optional": true,
"peer": true,
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
},
......@@ -5515,6 +5685,14 @@
"node": ">=4.0"
}
},
"node_modules/estree-walker": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
"dependencies": {
"@types/estree": "^1.0.0"
}
},
"node_modules/esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
......@@ -6156,6 +6334,33 @@
"node": ">=0.10.0"
}
},
"node_modules/giget": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/giget/-/giget-1.0.0.tgz",
"integrity": "sha512-KWELZn3Nxq5+0So485poHrFriK9Bn3V/x9y+wgqrHkbmnGbjfLmZ685/SVA/ovW+ewoqW0gVI47pI4yW/VNobQ==",
"dependencies": {
"colorette": "^2.0.19",
"defu": "^6.1.1",
"https-proxy-agent": "^5.0.1",
"mri": "^1.2.0",
"node-fetch-native": "^1.0.1",
"pathe": "^1.0.0",
"tar": "^6.1.12"
},
"bin": {
"giget": "dist/cli.mjs"
}
},
"node_modules/giget/node_modules/colorette": {
"version": "2.0.19",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz",
"integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ=="
},
"node_modules/giget/node_modules/defu": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.2.tgz",
"integrity": "sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ=="
},
"node_modules/git-config-path": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-2.0.0.tgz",
......@@ -6485,25 +6690,6 @@
"node": ">= 0.4.0"
}
},
"node_modules/has-ansi": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
"integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==",
"dependencies": {
"ansi-regex": "^2.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/has-ansi/node_modules/ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/has-bigints": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz",
......@@ -6692,6 +6878,11 @@
"minimalistic-crypto-utils": "^1.0.1"
}
},
"node_modules/hookable": {
"version": "5.4.2",
"resolved": "https://registry.npmjs.org/hookable/-/hookable-5.4.2.tgz",
"integrity": "sha512-6rOvaUiNKy9lET1X0ECnyZ5O5kSV0PJbtA5yZUgdEF7fGJEVwSLSislltyt7nFwVVALYHQJtfGeAR2Y0A0uJkg=="
},
"node_modules/hsl-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz",
......@@ -6898,6 +7089,39 @@
"resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
"integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg=="
},
"node_modules/https-proxy-agent": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
"dependencies": {
"agent-base": "6",
"debug": "4"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/https-proxy-agent/node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/https-proxy-agent/node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/human-signals": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
......@@ -7606,6 +7830,11 @@
"node": ">=6"
}
},
"node_modules/jsonc-parser": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w=="
},
"node_modules/jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
......@@ -7681,6 +7910,11 @@
"node": ">= 8"
}
},
"node_modules/knitwork": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/knitwork/-/knitwork-1.0.0.tgz",
"integrity": "sha512-dWl0Dbjm6Xm+kDxhPQJsCBTxrJzuGl0aP9rhr+TG8D3l+GL90N8O8lYUi7dTSAN2uuDqCtNgb6aEuQH5wsiV8Q=="
},
"node_modules/last-call-webpack-plugin": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/last-call-webpack-plugin/-/last-call-webpack-plugin-3.0.0.tgz",
......@@ -7728,6 +7962,17 @@
"node": ">=8.9.0"
}
},
"node_modules/local-pkg": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz",
"integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==",
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
......@@ -7764,11 +8009,6 @@
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
"integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag=="
},
"node_modules/lodash.startcase": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz",
"integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg=="
},
"node_modules/lodash.template": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz",
......@@ -7804,6 +8044,17 @@
"yallist": "^3.0.2"
}
},
"node_modules/magic-string": {
"version": "0.26.7",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz",
"integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==",
"dependencies": {
"sourcemap-codec": "^1.4.8"
},
"engines": {
"node": ">=12"
}
},
"node_modules/make-dir": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
......@@ -8162,6 +8413,22 @@
"mkdirp": "bin/cmd.js"
}
},
"node_modules/mlly": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.1.0.tgz",
"integrity": "sha512-cwzBrBfwGC1gYJyfcy8TcZU1f+dbH/T+TuOhtYP2wLv/Fb51/uV7HJQfBPtEupZ2ORLRU1EKFS/QfS3eo9+kBQ==",
"dependencies": {
"acorn": "^8.8.1",
"pathe": "^1.0.0",
"pkg-types": "^1.0.1",
"ufo": "^1.0.1"
}
},
"node_modules/mlly/node_modules/ufo": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/ufo/-/ufo-1.0.1.tgz",
"integrity": "sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA=="
},
"node_modules/moment": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
......@@ -8216,6 +8483,14 @@
"rimraf": "bin.js"
}
},
"node_modules/mri": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
"integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
"engines": {
"node": ">=4"
}
},
"node_modules/mrmime": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz",
......@@ -8401,6 +8676,11 @@
}
}
},
"node_modules/node-fetch-native": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.0.1.tgz",
"integrity": "sha512-VzW+TAk2wE4X9maiKMlT+GsPU4OMmR1U9CrHSmd3DFLn2IcZ9VJ6M6BBugGfYUnPCLSYxXdZy17M0BEJyhUTwg=="
},
"node_modules/node-html-parser": {
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/node-html-parser/-/node-html-parser-3.3.6.tgz",
......@@ -8724,243 +9004,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/opencollective": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz",
"integrity": "sha512-YBRI0Qa8+Ui0/STV1qYuPrJm889PT3oCPHMVoL+8Y3nwCffj7PSrB2NlGgrhgBKDujxTjxknHWJ/FiqOsYcIDw==",
"dependencies": {
"babel-polyfill": "6.23.0",
"chalk": "1.1.3",
"inquirer": "3.0.6",
"minimist": "1.2.0",
"node-fetch": "1.6.3",
"opn": "4.0.2"
},
"bin": {
"oc": "dist/bin/opencollective.js",
"opencollective": "dist/bin/opencollective.js"
}
},
"node_modules/opencollective/node_modules/ansi-escapes": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz",
"integrity": "sha512-wiXutNjDUlNEDWHcYH3jtZUhd3c4/VojassD8zHdHCY13xbZy2XbW+NKQwA0tWGBVzDA9qEzYwfoSsWmviidhw==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/opencollective/node_modules/ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/opencollective/node_modules/ansi-styles": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/opencollective/node_modules/chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==",
"dependencies": {
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/opencollective/node_modules/chardet": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
"integrity": "sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg=="
},
"node_modules/opencollective/node_modules/cli-cursor": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
"integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==",
"dependencies": {
"restore-cursor": "^2.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/opencollective/node_modules/cli-width": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz",
"integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw=="
},
"node_modules/opencollective/node_modules/external-editor": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
"integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
"dependencies": {
"chardet": "^0.4.0",
"iconv-lite": "^0.4.17",
"tmp": "^0.0.33"
},
"engines": {
"node": ">=0.12"
}
},
"node_modules/opencollective/node_modules/figures": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
"integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==",
"dependencies": {
"escape-string-regexp": "^1.0.5"
},
"engines": {
"node": ">=4"
}
},
"node_modules/opencollective/node_modules/inquirer": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz",
"integrity": "sha512-thluxTGBXUGb8DuQcvH9/CM/CrcGyB5xUpWc9x6Slqcq1z/hRr2a6KxUpX4ddRfmbe0hg3E4jTvo5833aWz3BA==",
"dependencies": {
"ansi-escapes": "^1.1.0",
"chalk": "^1.0.0",
"cli-cursor": "^2.1.0",
"cli-width": "^2.0.0",
"external-editor": "^2.0.1",
"figures": "^2.0.0",
"lodash": "^4.3.0",
"mute-stream": "0.0.7",
"run-async": "^2.2.0",
"rx": "^4.1.0",
"string-width": "^2.0.0",
"strip-ansi": "^3.0.0",
"through": "^2.3.6"
}
},
"node_modules/opencollective/node_modules/is-fullwidth-code-point": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
"integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==",
"engines": {
"node": ">=4"
}
},
"node_modules/opencollective/node_modules/is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/opencollective/node_modules/mimic-fn": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
"engines": {
"node": ">=4"
}
},
"node_modules/opencollective/node_modules/minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha512-7Wl+Jz+IGWuSdgsQEJ4JunV0si/iMhg42MnQQG6h1R6TNeVenp4U9x5CC5v/gYqz/fENLQITAWXidNtVL0NNbw=="
},
"node_modules/opencollective/node_modules/mute-stream": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
"integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ=="
},
"node_modules/opencollective/node_modules/node-fetch": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz",
"integrity": "sha512-BDxbhLHXFFFvilHjh9xihcDyPkXQ+kjblxnl82zAX41xUYSNvuRpFRznmldR9+OKu+p+ULZ7hNoyunlLB5ecUA==",
"dependencies": {
"encoding": "^0.1.11",
"is-stream": "^1.0.1"
}
},
"node_modules/opencollective/node_modules/onetime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
"integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==",
"dependencies": {
"mimic-fn": "^1.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/opencollective/node_modules/restore-cursor": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
"integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==",
"dependencies": {
"onetime": "^2.0.0",
"signal-exit": "^3.0.2"
},
"engines": {
"node": ">=4"
}
},
"node_modules/opencollective/node_modules/string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
"dependencies": {
"is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^4.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/opencollective/node_modules/string-width/node_modules/ansi-regex": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
"integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
"engines": {
"node": ">=4"
}
},
"node_modules/opencollective/node_modules/string-width/node_modules/strip-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
"integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==",
"dependencies": {
"ansi-regex": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/opencollective/node_modules/strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
"dependencies": {
"ansi-regex": "^2.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/opencollective/node_modules/supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==",
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/opener": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
......@@ -8969,18 +9012,6 @@
"opener": "bin/opener-bin.js"
}
},
"node_modules/opn": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz",
"integrity": "sha512-iPBWbPP4OEOzR1xfhpGLDh+ypKBOygunZhM9jBtA7FS5sKjEiMZw0EFb82hnDOmTZX90ZWLoZKUza4cVt8MexA==",
"dependencies": {
"object-assign": "^4.0.1",
"pinkie-promise": "^2.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/optimize-css-assets-webpack-plugin": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.8.tgz",
......@@ -9231,6 +9262,11 @@
"node": ">=8"
}
},
"node_modules/pathe": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.0.tgz",
"integrity": "sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w=="
},
"node_modules/pbkdf2": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz",
......@@ -9273,23 +9309,62 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/pinkie": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
"integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==",
"engines": {
"node": ">=0.10.0"
"node_modules/pinia": {
"version": "2.0.29",
"resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.29.tgz",
"integrity": "sha512-5z/KpFecq/cIgfeTnulJXldiLcTITRkTe3N58RKYSj0Pc1EdR6oyCdnf5A9jLoVwBqX5LtHhd0kGlpzWvk9oiQ==",
"dependencies": {
"@vue/devtools-api": "^6.4.5",
"vue-demi": "*"
},
"funding": {
"url": "https://github.com/sponsors/posva"
},
"peerDependencies": {
"@vue/composition-api": "^1.4.0",
"typescript": ">=4.4.4",
"vue": "^2.6.14 || ^3.2.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
},
"typescript": {
"optional": true
}
}
},
"node_modules/pinkie-promise": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
"integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==",
"dependencies": {
"pinkie": "^2.0.0"
"node_modules/pinia-plugin-persistedstate": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.0.2.tgz",
"integrity": "sha512-84vPyUhPA/8Pr+1mT1ioNb2d8z4tvdgYRqMQf8xyauOVBKjo0ZcRBwPQBV7ZAJG43Kwar43nXG2jU+ZMvAFFRQ==",
"peerDependencies": {
"pinia": "^2.0.0"
}
},
"node_modules/pinia/node_modules/vue-demi": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.13.11.tgz",
"integrity": "sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==",
"hasInstallScript": true,
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
},
"engines": {
"node": ">=0.10.0"
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^3.0.0-0 || ^2.6.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
},
"node_modules/pkg-dir": {
......@@ -9303,6 +9378,16 @@
"node": ">=8"
}
},
"node_modules/pkg-types": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.1.tgz",
"integrity": "sha512-jHv9HB+Ho7dj6ItwppRDDl0iZRYBD0jsakHXtFgoLr+cHSF6xC+QL54sJmWxyGxOLYSHm0afhXhXcQDQqH9z8g==",
"dependencies": {
"jsonc-parser": "^3.2.0",
"mlly": "^1.0.0",
"pathe": "^1.0.0"
}
},
"node_modules/pnp-webpack-plugin": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.7.0.tgz",
......@@ -11111,11 +11196,6 @@
"aproba": "^1.1.1"
}
},
"node_modules/rx": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz",
"integrity": "sha512-CiaiuN6gapkdl+cZUr67W6I8jquN4lkak3vtIsIWCl4XIPP8ffsoyN6/+PuGXnQy8Cu8W2y9Xxh31Rq4M6wUug=="
},
"node_modules/rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
......@@ -11673,6 +11753,12 @@
"integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==",
"deprecated": "See https://github.com/lydell/source-map-url#deprecated"
},
"node_modules/sourcemap-codec": {
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
"deprecated": "Please use @jridgewell/sourcemap-codec instead"
},
"node_modules/split-string": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
......@@ -11884,6 +11970,17 @@
"node": ">=6"
}
},
"node_modules/strip-literal": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.0.tgz",
"integrity": "sha512-5o4LsH1lzBzO9UFH63AJ2ad2/S2AVx6NtjOcaz+VTT2h1RiRvbipW72z8M/lxEhcPHDBQwpDrnTF7sXy/7OwCQ==",
"dependencies": {
"acorn": "^8.8.1"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/style-resources-loader": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/style-resources-loader/-/style-resources-loader-1.5.0.tgz",
......@@ -12597,6 +12694,17 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/unctx": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/unctx/-/unctx-2.1.1.tgz",
"integrity": "sha512-RffJlpvLOtolWsn0fxXsuSDfwiWcR6cyuykw2e0+zAggvGW1SesXt9WxIWlWpJhwVCZD/WlxxLqKLS50Q0CkWA==",
"dependencies": {
"acorn": "^8.8.1",
"estree-walker": "^3.0.1",
"magic-string": "^0.26.7",
"unplugin": "^1.0.0"
}
},
"node_modules/unfetch": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/unfetch/-/unfetch-4.2.0.tgz",
......@@ -12638,6 +12746,51 @@
"node": ">=4"
}
},
"node_modules/unimport": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/unimport/-/unimport-2.0.1.tgz",
"integrity": "sha512-hMeDspGrEcocahicTr0AQYUGes24FvJtOxk9QEjeEOGv+n1EdpsDiT6z8t209PWhemPg0T5w/ooTVhup2GdrFA==",
"dependencies": {
"@rollup/pluginutils": "^5.0.2",
"escape-string-regexp": "^5.0.0",
"fast-glob": "^3.2.12",
"local-pkg": "^0.4.3",
"magic-string": "^0.27.0",
"mlly": "^1.1.0",
"pathe": "^1.1.0",
"pkg-types": "^1.0.1",
"scule": "^1.0.0",
"strip-literal": "^1.0.0",
"unplugin": "^1.0.1"
}
},
"node_modules/unimport/node_modules/escape-string-regexp": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
"integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/unimport/node_modules/magic-string": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz",
"integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.13"
},
"engines": {
"node": ">=12"
}
},
"node_modules/unimport/node_modules/scule": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/scule/-/scule-1.0.0.tgz",
"integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ=="
},
"node_modules/union-value": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
......@@ -12694,6 +12847,25 @@
"node": ">= 0.8"
}
},
"node_modules/unplugin": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.0.1.tgz",
"integrity": "sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==",
"dependencies": {
"acorn": "^8.8.1",
"chokidar": "^3.5.3",
"webpack-sources": "^3.2.3",
"webpack-virtual-modules": "^0.5.0"
}
},
"node_modules/unplugin/node_modules/webpack-sources": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz",
"integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==",
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/unquote": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz",
......@@ -12743,6 +12915,22 @@
"node": ">=0.10.0"
}
},
"node_modules/untyped": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/untyped/-/untyped-1.2.2.tgz",
"integrity": "sha512-EANYd5L6AdpgfldlgMcmvOOnj092nWhy0ybhc7uhEH12ipytDYz89EOegBQKj8qWL3u1wgYnmFjADhsuCJs5Aw==",
"dependencies": {
"@babel/core": "^7.20.12",
"@babel/standalone": "^7.20.12",
"@babel/types": "^7.20.7",
"scule": "^1.0.0"
}
},
"node_modules/untyped/node_modules/scule": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/scule/-/scule-1.0.0.tgz",
"integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ=="
},
"node_modules/upath": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz",
......@@ -13686,6 +13874,11 @@
"source-map": "~0.6.1"
}
},
"node_modules/webpack-virtual-modules": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz",
"integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw=="
},
"node_modules/webpack/node_modules/acorn": {
"version": "6.4.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz",
......
<template>
<div>
<div>
<h1 style="text-align: center">ABOUT</h1>
</div>
</div>
</template>
\ No newline at end of file
......@@ -5,10 +5,10 @@
<b-icon icon="house-fill" scale="1.25" shift-v="1.25" aria-hidden="true"></b-icon>
Home
</b-breadcrumb-item>
<b-breadcrumb-item href="/home/categories">Category</b-breadcrumb-item>
<b-breadcrumb-item href="/categories">Category</b-breadcrumb-item>
</b-breadcrumb>
<div style="float: right">
<b-button v-b-modal.modal-create >New Category</b-button></div>
<b-button v-b-modal.modal-create class="text-white">New Category</b-button></div>
<!-- create modal -->
<b-modal id="modal-create" title="Create Category" class="modal fade" >
<p class="my-4">
......@@ -192,7 +192,7 @@
<script>
import Nav from "@/components/Nav";
import axios from "axios";
import { BootstrapVue, BootstrapVueIcons } from 'bootstrap-vue'
import { BootstrapVue, BootstrapVueIcons } from 'bootstrap-vue';
export default {
layout: 'admin',
......@@ -234,7 +234,7 @@ export default {
name: "",
id: "",
ordering: "",
status: "",
parent_id: "",
created_at: "",
updated_at: "",
},
......@@ -250,76 +250,76 @@ export default {
},
computed: {
formTitle() {
return this.editedIndex === -1 ? "New Item" : "Edit Item";
return this.editedIndex === -1 ? "New Item" : "Edit Item"
},
},
watch: {
dialog(val) {
val || this.close();
val || this.close()
},
dialogDelete(val) {
val || this.closeDelete();
val || this.closeDelete()
},
},
created() {
this.initialize();
this.getCategories();
this.initialize()
this.getCategories()
},
methods: {
initialize() {
this.users = [];
this.categories= [];
this.users = []
this.categories= []
},
editItem(item) {
this.editedIndex = this.categories.indexOf(item);
this.editedItem = Object.assign({}, item);
this.dialog = true;
this.editedIndex = this.categories.indexOf(item)
this.editedItem = Object.assign({}, item)
this.dialog = true
},
deleteItem(item) {
this.editedIndex = this.categories.indexOf(item);
this.editedItem = Object.assign({}, item);
this.dialogDelete = true;
this.editedIndex = this.categories.indexOf(item)
this.editedItem = Object.assign({}, item)
this.dialogDelete = true
},
deleteItemConfirm() {
this.categories.splice(this.editedIndex, 1);
this.closeDelete();
this.categories.splice(this.editedIndex, 1)
this.closeDelete()
},
close() {
this.dialog = false;
this.dialog = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
})
},
closeDelete() {
this.dialogDelete = false;
this.dialogDelete = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
})
},
save() {
if (this.editedIndex > -1) {
Object.assign(this.categories[this.editedIndex], this.editedItem);
Object.assign(this.categories[this.editedIndex], this.editedItem)
} else {
this.categories.push(this.editedItem);
this.categories.push(this.editedItem)
}
this.close();
this.close()
},
getCategories() {
axios
.get("http://127.0.0.1:8000/api/categories/")
this.$axios
.get("/categories/")
.then((response) => (this.categories = response.data.data))
.catch(function (error) {
console.log(error);
});
console.log(error)
})
},
createCategory() {
const set = new Set([this.image]);
const image = Array.from(set);
const self = this;
axios
.post('http://127.0.0.1:8000/api/categories/',{
const set = new Set([this.image])
const image = Array.from(set)
const self = this
this.$axios
.post('/categories/',{
name: this.name,
ordering: this.ordering,
parent_id: this.parent_id,
......@@ -335,35 +335,39 @@ export default {
self.$toast.success('Category created successfully!', {
duration: 3000
})
this.editedItem = response.data.data
console.log(this.editedItem)
this.categories.push(this.editedItem)
})
.catch(errors => {
this.$bvModal.hide('modal-create')
console.log(errors.response.data.message);
this.message = errors.response.data.message;
console.log(errors.response.data.message)
this.message = errors.response.data.message
self.$toast.error('something went wrong while trying create!',{
duration: 3000
});
});
})
})
},
fileSelected(event){
console.log(event)
const file = event.target.files[0];
this.url = URL.createObjectURL(file);
this.image = file;
const file = event.target.files[0]
this.url = URL.createObjectURL(file)
this.image = file
console.log(file)
console.log(this.image)
},
deleteCategory(ID,index) {
this.editedIndex = this.categories.indexOf(index);
const self = this
this.editedIndex = this.categories.indexOf(index)
if(confirm("Do you really want to delete?")){
try{
axios
.delete(`http://127.0.0.1:8000/api/categories/${ID}`)
this.$axios
.delete(`/categories/${ID}`)
.then(response => {
this.categories.splice(this.editedIndex, 1);
this.categories.splice(this.editedIndex, 1)
self.$toast.success('Category deleted successfully!',{
duration: 3000
});
})
})
} catch(error){
console.log(error)
......@@ -374,25 +378,26 @@ export default {
console.log(this.categories.indexOf(item))
},
editCategory(item) {
this.$bvModal.show('modal-edit');
this.eID = item.id;
this.eName= item.name,
this.eOrdering= item.ordering,
this.eParentId= item.parent_id,
this.eImage= item.images,
console.log(this?.eID);
console.log(item);
this.$bvModal.show('modal-edit')
this.eID = item.id
this.eName= item.name
this.eOrdering= item.ordering
this.eParentId= item.parent_id
this.eImage= item.images
this.editedIndex = this.categories.indexOf(item)
console.log(this?.eID)
console.log(item)
},
updateCategory(userID) {
const set = new Set([this.eImage]);
const image = Array.from(set);
const set = new Set([this.eImage])
const image = Array.from(set)
const self = this
console.log(this.eName);
console.log(this.eOrdering);
console.log(this?.eID);
console.log(this.eName)
console.log(this.eOrdering)
console.log(this?.eID)
try{
axios
.post(`http://127.0.0.1:8000/api/categories/update/${this?.eID}`,{
this.$axios
.post(`categories/update/${this?.eID}`,{
name: this.eName,
ordering: this.eOrdering,
parent_id: this.eParentId,
......@@ -405,8 +410,11 @@ export default {
.then(response => {
self.$toast.success('User updated successfully!',{
duration: 3000
});
console.log(response);
})
console.log(response)
this.editedItem = response.data.data
this.$bvModal.hide('modal-edit')
Object.assign(this.categories[this.editedIndex], this.editedItem)
})
} catch(error){
console.log(error)
......
......@@ -115,7 +115,7 @@ export default {
this.$toast.error("Username or Password not valid", {
duration: 2000,
});
this.$router.push("/");
this.$router.push("/login");
}
},
checkForm: function (e) {
......
......@@ -10,7 +10,7 @@
></b-icon>
Home
</b-breadcrumb-item>
<b-breadcrumb-item href="/home/posts">Post</b-breadcrumb-item>
<b-breadcrumb-item href="/posts">Post</b-breadcrumb-item>
</b-breadcrumb>
<div style="float: right">
<b-button class="text-white" v-b-modal.modal-create>New Post</b-button>
......@@ -117,7 +117,7 @@
type="text"
class="form-control mb-2"
placeholder="Description"
v-model="sUserID"
v-model="sUserId"
size="sm"
disabled
/>
......@@ -279,7 +279,7 @@ export default {
},
{ text: "Category ID", value: "category_id" },
{ text: "content", value: "content", sortable: false },
{ text: "user_id", value: "user_id" },
{ text: "author", value: "user_id" },
{ text: "status", value: "status" },
{ text: "Actions", value: "actions", sortable: false },
],
......@@ -301,12 +301,11 @@ export default {
message: [],
editedIndex: -1,
editedItem: {
name: "",
id: "",
ordering: "",
title: "",
category_id: "",
content: "",
user_id: "",
status: "",
created_at: "",
updated_at: "",
},
defaultItem: {
name: "",
......@@ -316,26 +315,26 @@ export default {
created_at: "",
updated_at: "",
},
};
}
},
computed: {
formTitle() {
return this.editedIndex === -1 ? "New Item" : "Edit Item";
return this.editedIndex === -1 ? "New Item" : "Edit Item"
},
nameState() {
return this.name.length > 2 ? true : false;
return this.name.length > 2 ? true : false
},
},
watch: {
dialog(val) {
val || this.close();
val || this.close()
},
dialogDelete(val) {
val || this.closeDelete();
val || this.closeDelete()
},
},
created() {
this.initialize(), this.getposts(), this.getCategories();
this.initialize(), this.getposts(), this.getCategories()
},
methods: {
initialize() {
......@@ -350,62 +349,61 @@ export default {
this.sImages = null
},
editItem(item) {
this.editedIndex = this.posts.indexOf(item);
this.editedItem = Object.assign({}, item);
this.dialog = true;
this.editedIndex = this.posts.indexOf(item)
this.editedItem = Object.assign({}, item)
this.dialog = true
},
deleteItem(item) {
this.editedIndex = this.posts.indexOf(item);
this.editedItem = Object.assign({}, item);
this.dialogDelete = true;
this.editedIndex = this.posts.indexOf(item)
this.editedItem = Object.assign({}, item)
this.dialogDelete = true
},
deleteItemConfirm() {
this.posts.splice(this.editedIndex, 1);
this.closeDelete();
this.posts.splice(this.editedIndex, 1)
this.closeDelete()
},
close() {
this.dialog = false;
this.dialog = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
})
},
closeDelete() {
this.dialogDelete = false;
this.dialogDelete = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
})
},
save() {
if (this.editedIndex > -1) {
Object.assign(this.posts[this.editedIndex], this.editedItem);
Object.assign(this.posts[this.editedIndex], this.editedItem)
} else {
this.posts.push(this.editedItem);
this.posts.push(this.editedItem)
}
this.close();
this.close()
},
getCategories() {
axios
.get("http://127.0.0.1:8000/api/categories/")
this.$axios
.get("/categories/")
.then((response) => (this.categories = response.data.data))
.catch(function (error) {
console.log(error);
});
console.log(error)
})
},
getposts() {
axios
.get("http://127.0.0.1:8000/api/posts/")
this.$axios
.get("/posts/")
.then((response) => (this.posts = response.data.data))
.catch(function (error) {
console.log(error);
});
console.log(error)
})
},
createPost() {
const self = this;
axios
.post(
"http://127.0.0.1:8000/api/posts/",
const self = this
this.$axios
.post("/posts/",
{
title: this.title,
category_id: this.category_id,
......@@ -422,78 +420,80 @@ export default {
}
)
.then((response) => {
this.$bvModal.hide("modal-create");
this.$bvModal.hide("modal-create")
self.$toast.success("Post created successfully!", {
duration: 3000,
});
})
this.editedItem = response.data.data
console.log(this.editedItem)
this.posts.push(this.editedItem)
})
.catch((errors) => {
this.$bvModal.hide("modal-create");
console.log(errors.response.data.message);
this.message = errors.response.data.message;
this.$bvModal.hide("modal-create")
console.log(errors.response.data.message)
this.message = errors.response.data.message
self.$toast.error("something went wrong while trying create!", {
duration: 3000,
});
});
})
})
},
deletePost(ID, index) {
const self = this;
this.editedIndex = this.posts.indexOf(index);
const self = this
this.editedIndex = this.posts.indexOf(index)
if (confirm("Do you really want to delete?")) {
axios
.delete(`http://127.0.0.1:8000/api/posts/${ID}`)
this.$axios
.delete(`/posts/${ID}`)
.then((response) => {
this.posts.splice(this.editedIndex, 1);
this.posts.splice(this.editedIndex, 1)
self.$toast.success("Post deleted successfully!", {
duration: 3000,
});
})
})
.catch((error) => {
console.log(error);
console.log(error)
self.$toast.error("Error!", {
duration: 3000,
});
});
})
})
}
},
async showPost(item) {
const ID = item.id;
const ID = item.id
try {
const resp = await fetch(`http://127.0.0.1:8000/api/posts/${ID}`, {
const resp = await this.$axios.get(`/posts/${ID}`, {
method: "GET",
headers: {
"Content-Type": "multipart/form-data",
Authorization: this.$auth.$storage.getUniversal("token"),
},
}).then((response) => {
return response.json();
});
this.sTitle = resp.data.title;
this.sContent = resp.data.content;
this.sCategoryId = resp.data.category_id;
this.sUserId = resp.data.user_id;
this.sStatus = resp.data.status;
this.sImages = resp.data.images;
})
console.log(resp.data)
this.sTitle = resp.data.data.title
this.sContent = resp.data.data.content
this.sCategoryId = resp.data.data.category_id
this.sUserId = resp.data.data.user_id
this.sStatus = resp.data.data.status
this.sImages = resp.data.data.images
} catch (error) {
console.log(error);
console.log(error)
}
this.$bvModal.show("modal-show");
this.$bvModal.show("modal-show")
},
editPost(item) {
this.$bvModal.show("modal-edit");
this.eId = item.id;
this.eTitle = item.title;
this.eCategoryId = item.category_id;
this.eContent = item.content;
this.eStatus = item.status;
this.eUserId = item.user_id;
// this.eImages = item.images
this.$bvModal.show("modal-edit")
this.eId = item.id
this.eTitle = item.title
this.eCategoryId = item.category_id
this.eContent = item.content
this.eStatus = item.status
this.eUserId = item.user_id
this.editedIndex = this.posts.indexOf(item)
},
updatePost() {
const self = this;
axios
const self = this
this.$axios
.post(
`http://127.0.0.1:8000/api/posts/update/${this?.eId}`,
`/posts/update/${this?.eId}`,
{
title: this.eTitle,
category_id: this.eCategoryId,
......@@ -510,19 +510,22 @@ export default {
}
)
.then((response) => {
this.$bvModal.hide("modal-edit");
this.$bvModal.hide("modal-edit")
self.$toast.success("Post updated successfully!", {
duration: 3000,
});
console.log(response);
})
console.log(response)
this.editedItem = response.data.data
this.$bvModal.hide('modal-edit')
Object.assign(this.posts[this.editedIndex], this.editedItem)
})
.catch((error) => {
console.log(error);
this.$bvModal.hide("modal-edit");
console.log(error)
this.$bvModal.hide("modal-edit")
self.$toast.error("something went wrong while trying create!", {
duration: 3000,
});
});
})
})
},
},
};
......
......@@ -5,7 +5,7 @@
<b-icon icon="house-fill" scale="1.25" shift-v="1.25" aria-hidden="true"></b-icon>
Home
</b-breadcrumb-item>
<b-breadcrumb-item href="/home/products">Product</b-breadcrumb-item>
<b-breadcrumb-item href="/products">Product</b-breadcrumb-item>
</b-breadcrumb>
<div style="float: right">
<b-button class="text-white" v-b-modal.modal-create >New Product</b-button></div>
......@@ -393,11 +393,10 @@ export default {
editedIndex: -1,
editedItem: {
name: "",
id: "",
ordering: "",
status: "",
created_at: "",
updated_at: "",
category_id: "",
price: "",
description: "",
stock: "",
},
defaultItem: {
name: "",
......@@ -448,7 +447,7 @@ export default {
quantity: "",
},
];
]
},
editItem(item) {
this.editedIndex = this.products.indexOf(item)
......@@ -456,12 +455,12 @@ export default {
this.dialog = true
},
deleteItem(item) {
this.editedIndex = this.products.indexOf(item);
this.editedItem = Object.assign({}, item);
this.dialogDelete = true;
this.editedIndex = this.products.indexOf(item)
this.editedItem = Object.assign({}, item)
this.dialogDelete = true
},
deleteItemConfirm() {
this.products.splice(this.editedIndex, 1);
this.products.splice(this.editedIndex, 1)
this.closeDelete()
},
close() {
......@@ -469,45 +468,45 @@ export default {
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
});
})
},
closeDelete() {
this.dialogDelete = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
});
})
},
save() {
if (this.editedIndex > -1) {
Object.assign(this.products[this.editedIndex], this.editedItem);
Object.assign(this.products[this.editedIndex], this.editedItem)
} else {
this.products.push(this.editedItem);
this.products.push(this.editedItem)
}
this.close()
},
getCategories() {
axios
.get("http://127.0.0.1:8000/api/categories/")
this.$axios
.get("/categories/")
.then((response) => (this.categories = response.data.data))
.catch(function (error) {
console.log(error)
});
})
},
getProducts() {
axios
.get("http://127.0.0.1:8000/api/products/")
this.$axios
.get("/products/")
.then((response) => (this.products = response.data.data))
.catch(function (error) {
console.log(error)
});
})
},
createProduct() {
const self = this;
const self = this
// const set = new Set([this.images]);
// const images = Array.from(set);
axios
.post('http://127.0.0.1:8000/api/products/',{
this.$axios
.post('/products/',{
name: this.name,
price: this.price,
category_id: this.category_id,
......@@ -525,28 +524,31 @@ export default {
self.$toast.success('Product created successfully!', {
duration: 3000
})
this.editedItem = response.data.data
console.log(this.editedItem)
this.products.push(this.editedItem)
})
.catch(errors => {
this.$bvModal.hide('modal-create')
console.log(errors.response.data.message)
this.message = errors.response.data.message;
this.message = errors.response.data.message
self.$toast.error('something went wrong while trying create!',{
duration: 3000
})
})
},
deleteProduct(ID,index) {
const self = this;
this.editedIndex = this.products.indexOf(index);
const self = this
this.editedIndex = this.products.indexOf(index)
if(confirm("Do you really want to delete?")){
try{
axios
.delete(`http://127.0.0.1:8000/api/products/${ID}`)
this.$axios
.delete(`/products/${ID}`)
.then(response => {
this.products.splice(this.editedIndex, 1);
this.products.splice(this.editedIndex, 1)
self.$toast.success('Category deleted successfully!',{
duration: 3000
});
})
})
} catch(error){
console.log(error)
......@@ -556,24 +558,20 @@ export default {
async showProduct(item) {
const ID = item.id
try {
const resp = await fetch(`http://127.0.0.1:8000/api/products/${ID}`, {
const resp = await this.$axios.get(`/products/${ID}`, {
method: "GET",
headers: {
"Content-Type": "multipart/form-data",
"Authorization": this.$auth.$storage.getUniversal("token")
}
}).then((response) => {
return response.json()
});
this.sName = resp.data.name
this.sPrice = resp.data.price
this.sCategoryId = resp.data.category_id
this.sDescription = resp.data.description
this.sStock = resp.data.stock
this.sVariants = resp.data.variants
this.sImages = resp.data.images
console.log(this.sVariants)
console.log(this.sImages)
Authorization: this.$auth.$storage.getUniversal("token"),
},
})
this.sName = resp.data.data.name
this.sPrice = resp.data.data.price
this.sCategoryId = resp.data.data.category_id
this.sDescription = resp.data.data.description
this.sStock = resp.data.data.stock
this.sVariants = resp.data.data.variants
this.sImages = resp.data.data.images
} catch (error) {
console.log(error)
}
......@@ -588,12 +586,13 @@ export default {
this.eStock = item.stock
this.eDescription = item.description
this.eVariants = item.variants
this.editedIndex = this.products.indexOf(item)
},
updateProduct(ID) {
const self = this
try{
axios
.post(`http://127.0.0.1:8000/api/products/update/${this?.eId}`,{
this.$axios
.post(`/products/update/${this?.eId}`,{
name: this.eName,
price: this.ePrice,
category_id: this.eCategoryId,
......@@ -609,8 +608,11 @@ export default {
.then(response => {
self.$toast.success('User updated successfully!',{
duration: 3000
});
})
console.log(response)
this.editedItem = response.data.data
this.$bvModal.hide('modal-edit')
Object.assign(this.products[this.editedIndex], this.editedItem)
})
} catch(error){
console.log(error)
......@@ -621,14 +623,14 @@ export default {
color: "",
size: "",
quantity: "",
});
})
},
addMoreVariant() {
this.eVariants.push({
color: "",
size: "",
quantity: "",
});
})
},
remove(index) {
this.variants.splice(index, 1)
......
......@@ -31,7 +31,6 @@
v-model="email"
required
/>
<label>Password :</label>
<input
type="password"
......
<template>
<div>content</div>
</template>
<script>
export default {
layout: "default",
};
</script>
<style>
</style>
\ No newline at end of file
......@@ -10,7 +10,7 @@
<b-breadcrumb-item href="/home/users">User</b-breadcrumb-item>
</b-breadcrumb>
<div style="float: right">
<b-button v-b-modal.modal-login >New User</b-button>
<b-button v-b-modal.modal-login class="text-white">New User</b-button>
<!-- modal create user -->
<b-modal id="modal-login" title="Create User" class="modal fade" >
<Notification :message="error" v-if="error" />
......@@ -100,23 +100,12 @@
<v-spacer></v-spacer>
<v-dialog v-model="dialog" max-width="500px">
<template v-slot:activator="{ on, attrs }">
<!-- <v-btn
color="primary"
dark
class="mb-2"
v-bind="attrs"
v-on="on"
v-on:click="getUser"
>
New User
</v-btn> -->
<!-- modal create user -->
</template>
<v-card>
<v-card-title>
<span class="text-h5">{{ formTitle }}</span>
</v-card-title>
<v-card-text>
<v-container>
<v-row>
......@@ -153,7 +142,6 @@
</v-row>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" text @click="close">
......@@ -183,7 +171,7 @@
</v-toolbar>
</template>
<template v-slot:item.actions="{ item }">
<v-icon small class="mr-2" @click=" editUser(item);" :id ="item.id"> mdi-pencil </v-icon>
<v-icon small class="mr-2" @click=" editUser(item)" :id ="item.id"> mdi-pencil </v-icon>
<v-icon small @click="deleteUser(item.id, item)" :id ="item.id"> mdi-delete </v-icon>
</template>
<template v-slot:no-data>
......@@ -196,7 +184,6 @@
import Nav from "@/components/Nav";
import axios from "axios";
export default {
layout: "admin",
components: { Nav },
......@@ -250,20 +237,20 @@ export default {
},
computed: {
formTitle() {
return this.editedIndex === -1 ? "New Item" : "Edit Item";
return this.editedIndex === -1 ? "New Item" : "Edit Item"
},
},
watch: {
dialog(val) {
val || this.close();
val || this.close()
},
dialogDelete(val) {
val || this.closeDelete();
val || this.closeDelete()
},
},
created() {
this.initialize();
this.getUsers();
this.initialize()
this.getUsers()
},
methods: {
initialize() {
......@@ -271,53 +258,53 @@ export default {
this.editedItem = {}
},
editItem(item) {
this.editedIndex = this.users.indexOf(item);
this.editedItem = Object.assign({}, item);
this.dialog = true;
this.editedIndex = this.users.indexOf(item)
this.editedItem = Object.assign({}, item)
this.dialog = true
},
deleteItem(item) {
this.editedIndex = this.users.indexOf(item);
this.editedItem = Object.assign({}, item);
this.dialogDelete = true;
this.editedIndex = this.users.indexOf(item)
this.editedItem = Object.assign({}, item)
this.dialogDelete = true
},
deleteItemConfirm() {
this.users.splice(this.editedIndex, 1);
this.closeDelete();
this.users.splice(this.editedIndex, 1)
this.closeDelete()
},
close() {
this.dialog = false;
this.dialog = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
})
},
closeDelete() {
this.dialogDelete = false;
this.dialogDelete = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
})
},
save() {
if (this.editedIndex > -1) {
Object.assign(this.users[this.editedIndex], this.editedItem);
Object.assign(this.users[this.editedIndex], this.editedItem)
} else {
this.users.push(this.editedItem);
this.users.push(this.editedItem)
}
this.close();
this.close()
},
getUsers() {
axios
.get("http://127.0.0.1:8000/api/users/")
this.$axios
.get('/users/')
.then((response) => (this.users = response.data.data.data))
.catch(function (error) {
console.log(error);
});
console.log(error)
})
},
createUser() {
const self = this
axios
.post('http://127.0.0.1:8000/api/users/',{
this.$axios
.post('/users/',{
headers: {
'Content-Type': 'application/json'
},
......@@ -330,36 +317,34 @@ export default {
this.$bvModal.hide('modal-login')
self.$toast.success('User created successfully!',{
duration: 3000
});
})
console.log(response)
this.editedItem = response.data.data
console.log(this.editedItem)
this.users.push(this.editedItem)
})
.catch(errors => {
this.$bvModal.hide('modal-login')
console.log(errors.response.data.message);
this.message = errors.response.data.message;
console.log(errors.response.data.message)
this.message = errors.response.data.message
self.$toast.error('something went wrong while trying create!',{
duration: 3000
});
});
})
})
},
deleteUser(userID, index) {
const self = this
this.editedIndex = this.users.indexOf(index);
this.editedIndex = this.users.indexOf(index)
if(confirm("Do you really want to delete?")){
try{
axios
.delete(`http://127.0.0.1:8000/api/users/${userID}`)
this.$axios
.delete(`/users/${userID}`)
.then(response => {
console.log(response.data)
this.users.splice(this.editedIndex, 1);
this.users.splice(this.editedIndex, 1)
self.$toast.success('User deleted successfully!',{
duration: 3000
});
})
})
} catch(error){
console.log(error)
......@@ -367,29 +352,28 @@ export default {
}
},
editUser(user) {
this.$bvModal.show('modal-edit');
this.eID = user.id;
this.eEmail = user.email;
this.eName = user.name;
this.editedIndex = this.users.indexOf(user);
console.log(this?.eID);
this.$bvModal.show('modal-edit')
this.eID = user.id
this.eEmail = user.email
this.eName = user.name
this.editedIndex = this.users.indexOf(user)
console.log(this?.eID)
},
updateUser(userID) {
const self = this
console.log(this.eName);
console.log(this.eEmail);
console.log(this?.eID);
console.log(this.eName)
console.log(this.eEmail)
console.log(this?.eID)
try{
axios
.put(`http://127.0.0.1:8000/api/users/${this?.eID}`,{
this.$axios
.put(`/users/${this?.eID}`,{
email: this.eEmail,
password: this.ePassword,
name:this.eName,} )
.then(response => {
self.$toast.success('User updated successfully!',{
duration: 3000
});
})
console.log(response)
this.editedItem = response.data.data
this.$bvModal.hide('modal-edit')
......
export default ({ $axios}) => {
$axios.onRequest(config => {
config.headers.common['Content-Type'] = 'multipart/form-data';
});
export default function ({ $axios }, inject) {
const api = $axios.create({
headers: {
common: {
Accept: 'application/json, text/plain, */*'
}
}
})
// Set baseURL to something different
api.setBaseURL('http://127.0.0.1:8000/api/')
// Inject to context as $api
inject('api', api)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment