Skip to content

Commit

Permalink
Merge pull request #1076 from slntopp/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dimquaa authored Aug 31, 2023
2 parents 3599151 + 5340d21 commit 6a012be
Show file tree
Hide file tree
Showing 131 changed files with 6,752 additions and 3,645 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
fetch-depth: 1
- name: Setup Go
uses: WillAbides/setup-go-faster@v1.8.0
uses: WillAbides/setup-go-faster@v1.10.1
with:
go-version: 1.19
- name: Static Check
Expand Down
7 changes: 5 additions & 2 deletions Dockerfiles/proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ RUN upx ./proxy

RUN adduser -SD nocloud

FROM scratch
FROM alpine:latest

WORKDIR /
COPY --from=builder /go/src/github.com/slntopp/nocloud/proxy /proxy
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd

COPY --from=builder /docker_health_check /docker_health_check
HEALTHCHECK --start-period=10s CMD ["/docker_health_check"]

USER nocloud
# USER nocloud
EXPOSE 8000

LABEL org.opencontainers.image.source https://github.com/slntopp/nocloud
LABEL nocloud.update "true"

Expand Down
24 changes: 12 additions & 12 deletions admin-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,44 @@
"@ant-design/icons-vue": "^4.0.6",
"@sardinefish/asn1": "^1.0.4",
"ansi-regex": "^6.0.1",
"apexcharts": "^3.40.0",
"apexcharts": "^3.41.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-preset-es2015": "^6.24.1",
"core-js": "^3.30.2",
"core-js": "^3.32.1",
"date-fns": "^2.29.3",
"glob-parent": "^6.0.2",
"js-cookie": "^3.0.5",
"json-schema": "^0.4.0",
"nocloud-ui": "^1.0.4",
"nocloudjsrest": "^1.5.8",
"nocloud-ui": "^1.0.7",
"nocloudjsrest": "^1.5.14",
"nth-check": "^2.1.1",
"sass-loader": "^13.0.2",
"sha256-uint8array": "^0.10.5",
"sha256-uint8array": "^0.10.7",
"sortablejs": "^1.15.0",
"vnc-ui-vue": "^1.0.0",
"vue": "^2.7.14",
"vue-apexcharts": "^1.6.2",
"vue-i18n": "^8.28.2",
"vue-router": "^3.6.5",
"vue2-editor": "^2.10.3",
"vuetify": "^2.6.15",
"vuetify": "^2.7.1",
"vuex": "^3.4.0",
"yaml": "^2.2.2"
"yaml": "^2.3.1"
},
"devDependencies": {
"@babel/eslint-parser": "^7.21.8",
"@babel/eslint-parser": "^7.22.10",
"@vue/cli-plugin-babel": "~5.0.7",
"@vue/cli-plugin-eslint": "~5.0.7",
"@vue/cli-plugin-router": "~5.0.7",
"@vue/cli-plugin-vuex": "~5.0.7",
"@vue/cli-service": "~5.0.7",
"eslint": "^8.40.0",
"eslint-plugin-vue": "^9.12.0",
"eslint": "^8.47.0",
"eslint-plugin-vue": "^9.17.0",
"sass": "~1.32.6",
"vue-cli-plugin-vuetify": "~2.5.8",
"vue-template-compiler": "^2.7.14",
"vuetify-loader": "^1.9.2",
"webpack": "^5.82.0",
"webpack-cli": "^5.0.2"
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
}
}
44 changes: 40 additions & 4 deletions admin-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@
</v-list-item-content>
</v-list-item>

<v-list-item v-bind="listItemBind" :to="{ name: 'Showcases' }">
<v-list-item-icon>
<v-icon>mdi-store-search</v-icon>
</v-list-item-icon>

<v-list-item-content>
<v-list-item-title>{{ navTitle("Showcases") }}</v-list-item-title>
</v-list-item-content>
</v-list-item>

<v-subheader>BILLING</v-subheader>

<v-list-item v-bind="listItemBind" :to="{ name: 'Plans' }">
Expand Down Expand Up @@ -152,13 +162,23 @@
</v-list-item-content>
</v-list-item>

<v-list-item v-bind="listItemBind" :to="{ name: 'Reports' }">
<v-list-item-icon>
<v-icon>mdi-chart-gantt</v-icon>
</v-list-item-icon>

<v-list-item-content>
<v-list-item-title>{{ navTitle("Reports") }}</v-list-item-title>
</v-list-item-content>
</v-list-item>

<v-subheader v-if="plugins?.length > 0">PLUGINS</v-subheader>
<v-list-item
v-bind="listItemBind"
v-for="plugin of plugins"
:key="plugin.url"
:to="{ name: 'Plugin', params: plugin }"
:to="{ name: 'Plugin', params: plugin, query: { url: plugin.url } }"
>
<v-list-item-icon>
<v-icon>mdi-{{ plugin.icon }}</v-icon>
Expand All @@ -171,6 +191,16 @@
<v-subheader>SYSTEM</v-subheader>
<v-list-item v-bind="listItemBind" :to="{ name: 'Chats' }">
<v-list-item-icon>
<v-icon>mdi-chat</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{ navTitle("Chats") }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-list-item v-bind="listItemBind" :to="{ name: 'History' }">
<v-list-item-icon>
<v-icon>mdi-history</v-icon>
Expand Down Expand Up @@ -222,7 +252,7 @@
</v-btn>
</v-col>
<v-col class="d-flex justify-end align-center">
<balance title="Balance: " />
<balance title="Balance: " loged-in-user />
<languages v-if="false" />
<v-menu offset-y transition="slide-y-transition">
<template v-slot:activator="{ on, attrs }">
Expand Down Expand Up @@ -387,16 +417,22 @@ export default {
if (this.isLoggedIn) {
this.$store.dispatch("auth/fetchUserData");
this.$store.dispatch("plugins/fetch");
}
},
mounted() {
this.onResize();
window.addEventListener("resize", this.onResize, { passive: true });
},
watch: {
isLoggedIn(newVal) {
if (newVal) {
this.$store.dispatch("plugins/fetch");
}
},
},
};
</script>
<style scoped lang="scss">
@import "@/styles/globalStyles.scss";
</style>
</style>
1 change: 1 addition & 0 deletions admin-ui/src/components/ServicesProvider/info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
color="background-light"
>
<nocloud-table
table-name="sp-binded-plans"
:items="plans"
:headers="headers"
:loading="isPlanLoading"
Expand Down
125 changes: 22 additions & 103 deletions admin-ui/src/components/ServicesProvider/map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,83 +54,8 @@
</v-icon>
</template>
<v-card class="pa-4" color="background-light">
<v-icon
@click="formatText('b', marker.id)"
@mousedown.prevent
>
mdi-format-bold
</v-icon>

<v-icon
@click="formatText('i', marker.id)"
@mousedown.prevent
>
mdi-format-italic
</v-icon>

<v-icon
@click="formatText('u', marker.id)"
@mousedown.prevent
>
mdi-format-underline
</v-icon>

<v-icon
@click="formatText('s', marker.id)"
@mousedown.prevent
>
mdi-format-strikethrough
</v-icon>

<v-icon
class="mx-1"
@click="formatText('a', marker.id)"
@mousedown.prevent
>
mdi-link
</v-icon>

<v-icon
class="mx-1"
@click="formatText('img', marker.id)"
@mousedown.prevent
>
mdi-image-outline
</v-icon>

<v-dialog width="400" :ref="`color-dialog.${marker.id}`">
<template v-slot:activator="{ on, attrs }">
<v-icon v-on="on" v-bind="attrs">mdi-palette</v-icon>
</template>

<v-card class="pa-2">
<v-color-picker
hide-mode-switch
style="margin: 0 auto"
mode="hexa"
v-model="textColor"
/>

<v-card-actions class="justify-end">
<v-btn @click="formatText('color', marker.id)">
Save
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>

<v-textarea
label="Description"
style="
color: #fff;
background: var(--v-background-light-base);
transition: 0.3s;
"
:ref="`textarea_${marker.id}`"
v-model="marker.extra.description"
/>

<v-text-field
class="mt-7"
dense
label="Title"
v-model="marker.title"
Expand All @@ -139,17 +64,13 @@
@input="(e) => inputHandler(e, marker)"
/>

<div class="d-flex justify-end">
<v-switch
label="Is primary"
style="
color: #fff;
background: var(--v-background-light-base);
transition: 0.3s;
"
v-model="marker.extra.primary"
/>
</div>
<color-picker label="Color" v-model="marker.extra.color" />

<v-text-field
dense
label="Icon link"
v-model="marker.extra.link"
/>

<v-card-actions class="justify-end">
<v-btn @click.stop="saveAndClose(marker.id)"> Save </v-btn>
Expand Down Expand Up @@ -194,9 +115,10 @@
import snackbar from "@/mixins/snackbar.js";
import api from "@/api.js";
import { NcMap } from "nocloud-ui";
import ColorPicker from "@/components/ui/colorPicker.vue";
export default {
components: { NcMap },
components: { ColorPicker, NcMap },
mixins: [snackbar],
name: "support-map",
props: {
Expand Down Expand Up @@ -264,18 +186,19 @@ export default {
}
},
onEnterHandler(id, e) {
const ref = this.$refs["textField_" + id][0];
const ref = this.$refs["textField_" + id]?.[0];
this.mouseLeaveHandler(id);
ref.blur();
e.stopPropagation();
},
inputHandler(e, marker) {
if (!e) {
marker.title = " ";
} else {
marker.title = e.trim();
}
this.markers = this.markers.map((m) => {
if (m.id === marker.id) {
m.title = !e ? " " : e.trim();
}
return m;
});
},
delMarker(e, id, x, y) {
e.stopPropagation();
Expand All @@ -290,13 +213,11 @@ export default {
let error = 0;
this.markers.forEach((el) => {
if (el.title && !el.title.trim()) {
const ref = this.$refs["textField_" + el.id][0];
const ref = this.$refs["textField_" + el.id]?.[0];
this.mouseEnterHandler(el.id);
setTimeout(() => {
ref.focus();
ref?.focus();
}, 100);
error = 1;
}
});
Expand All @@ -318,8 +239,6 @@ export default {
);
}
console.log(this.item.locations, this.markers);
if (this.item.locations.length < 1) {
this.item.locations = [{ id: "_nocloud.remove" }];
}
Expand All @@ -329,7 +248,7 @@ export default {
this.showSnackbarSuccess({
message: "Service edited successfully",
});
this.$emit('set-locations',data.locations)
this.$emit("set-locations", data.locations);
})
.catch((err) => {
this.showSnackbarError({
Expand Down Expand Up @@ -398,9 +317,9 @@ export default {
setTimeout(() => {
const marker = {
id: this.selected,
type: this.type || undefined,
type: this.type || this.item.type,
title: " ",
extra: {},
extra: { country: target.id },
x,
y,
};
Expand Down
Loading

0 comments on commit 6a012be

Please sign in to comment.