Git Product home page Git Product logo

ngcp-admin-ui's Introduction

Administration User Interface

The main goal of this project is to replace the administration interface ngcp-panel using a modern web technology stack. The ngcp-panel is written in Perl and is the main web interface, that allows administrators to configure and provision the Sipwise VoIP Platform. The plan is to decouple the new interface from the backend completely, and to evolve it to a service oriented architecture. We are using Vue.js as core frontend technology and the Quasar Framework as UI- and Component-Framework that builds on top of Vue.js.

Concepts

We are using the quasar-cli as main development tool to get the full developer experience.

List of additional packages:

Getting started

To be able to contribute to the new administration interface you need to go through the following steps.

Install Sipwise VoIP Platform

First install an instance of the Sipwise VoIP Platform to be able to access the REST-API. Check the according documentation for more information.

Configure Sipwise VoIP Platform

Enable CORS headers to be able to access the REST-API from the application on your local machine.

ngcpcfg set /etc/ngcp-config/config.yml www_admin.http_admin.ui_enable=yes
ngcpcfg set /etc/ngcp-config/config.yml www_admin.http_csc.csc_dev=yes
ngcpcfg apply "enable ngcp-admin-ui dev mode"

Clone repository

Clone the repository to your local machine

git clone [email protected]:sipwise/ngcp-admin-ui.git
cd ngcp-admin-ui.git

Note: the git repository branch must match NGCP (REST API) version, please checkout the proper branch if necessary:

git checkout mr8.5.3

Run Quasar development server locally in Docker

Prerequisites:

Run the following command from root folder of git repository:

yarn run docker-dev <ip-or-fqdn-of-sipwise-voip-platform>

Run development environment in your system of choice

yarn run config <ip-or-fqdn-of-sipwise-voip-platform>
yarn run dev

After that, you can open https://localhost:8081/v2/ in your browser to see AUI in action.

Note: this run / dev scenario might experience some issues in redirections to couple pages in the fallback AUI interface. If you have such issue, please use other run scenarios like running in Docker.

Run Quasar development server within the Sipwise VoIP platform

To get the full developer experience we need to run the development server within the Sipwise VoIP Platform.

./bin/ngcp-dev.sh <ip-or-fqdn-of-sipwise-voip-platform>

Translations

To keep translation files consistent and updated please run i18n:extract command before each commit to the GIT repo.

yarn run i18n:extract

That CLI command will collect all new translation keys from the JS source code, and will place those keys into all translation files in a proper format.

Example of the JS code with translations:

const someOptions = {
    label: this.$t('Remove message'),
    message: this.$t('The {email} will be removed. Are you sure?', { email: this.email })
}

Important: We are trying to avoid usage of the dynamic keys (example below) because it's very difficult to detect and collect automatically.

Example (anti-pattern):

function getTranslatedMessage (weatherState) {
    return this.$t('Tooday is ' + weatherState)
}

Try to avoid such code and use text messages with substitution variables (like email in example above) or if there are only a couple similar messages, you can use a map object to convert some exact state to exact translation message. But if it's really impossible to do, and you have to use dynamic keys, you should place such keys to the English translation file manually and execute i18n:extract which will do all the rest.

For example, for the code above, you would need to place next lines into en.json:

{
    ...
    "Today is sunny": "",
    "Today is windy": "",
    "Today is cloudy": ""
}

Note: if you want to see information about missed or possible unused translation keys you could run i18n:extract-report command. It will just display detailed report without any modifications in the language files.

Keep in mind that some of "Unused translations" keys might be dynamic translation keys which cannot be detected in source code automatically and were added manually.

yarn run i18n:extract-report

Contribution

Go to contribution guide

Education & Resources

Here you can find some helpful resources about our technology stack.

Quasar Framework

Vue.js

ngcp-admin-ui's People

Contributors

hpherzog avatar carlovenus avatar svleonenko avatar sipwise-jenkins avatar taurus-forever avatar guillemj avatar victortsvetov avatar sergiik avatar mmontecelo-sipwise avatar mika avatar linuxmaniac avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.